35 #ifndef _BLAZE_MATH_VIEWS_COLUMN_H_ 36 #define _BLAZE_MATH_VIEWS_COLUMN_H_ 180 inline decltype(
auto)
column( const
Matrix<MT,SO>& matrix, RCAs... args )
254 template<
typename MT
257 inline decltype(
auto)
column(
Matrix<MT,SO>& matrix,
size_t index, RCAs... args )
303 template<
typename MT
306 inline decltype(
auto)
column( const
Matrix<MT,SO>& matrix,
size_t index, RCAs... args )
331 template<
typename MT
334 inline decltype(
auto)
column(
Matrix<MT,SO>&& matrix,
size_t index, RCAs... args )
364 template<
size_t... CCAs
371 return column<CCAs...>( (~matrix).leftOperand(), args... ) +
372 column<CCAs...>( (~matrix).rightOperand(), args... );
390 template<
size_t... CCAs
397 return column<CCAs...>( (~matrix).leftOperand(), args... ) -
398 column<CCAs...>( (~matrix).rightOperand(), args... );
416 template<
size_t... CCAs
423 return column<CCAs...>( (~matrix).leftOperand(), args... ) *
424 column<CCAs...>( (~matrix).rightOperand(), args... );
442 template<
size_t... CCAs
449 return (~matrix).leftOperand() *
column<CCAs...>( (~matrix).rightOperand(), args... );
478 if( (~matrix).
columns() <= I ) {
483 return (~matrix).leftOperand() * (~matrix).rightOperand()[I];
503 template<
typename MT
512 if( (~matrix).
columns() <= index ) {
517 return (~matrix).leftOperand() * (~matrix).rightOperand()[index];
535 template<
size_t... CCAs
542 return column<CCAs...>( (~matrix).leftOperand(), args... ) * (~matrix).rightOperand();
560 template<
size_t... CCAs
567 return column<CCAs...>( (~matrix).leftOperand(), args... ) / (~matrix).rightOperand();
585 template<
size_t... CCAs
592 return map( column<CCAs...>( (~matrix).operand(), args... ), (~matrix).operation() );
610 template<
size_t... CCAs
617 return map( column<CCAs...>( (~matrix).leftOperand(), args... ),
618 column<CCAs...>( (~matrix).rightOperand(), args... ),
619 (~matrix).operation() );
637 template<
size_t... CCAs
644 return eval( column<CCAs...>( (~matrix).operand(), args... ) );
662 template<
size_t... CCAs
669 return serial( column<CCAs...>( (~matrix).operand(), args... ) );
687 template<
size_t... CCAs
694 return column<CCAs...>( (~matrix).operand(), args... );
712 template<
size_t... CCAs
719 return trans( row<CCAs...>( (~matrix).operand(), args... ) );
741 template<
typename MT
746 inline void reset( Column<MT,SO,DF,SF,CCAs...>&
column )
762 template<
typename MT
767 inline void reset( Column<MT,SO,DF,SF,CCAs...>&& column )
785 template<
typename MT
790 inline void clear( Column<MT,SO,DF,SF,CCAs...>& column )
808 template<
typename MT
813 inline void clear( Column<MT,SO,DF,SF,CCAs...>&& column )
852 inline bool isDefault(
const Column<MT,SO,true,SF,CCAs...>& column )
856 for(
size_t i=0UL; i<column.size(); ++i )
857 if( !isDefault<RF>( column[i] ) )
return false;
895 inline bool isDefault(
const Column<MT,SO,false,SF,CCAs...>& column )
899 for(
const auto& element : column )
900 if( !isDefault<RF>( element.value() ) )
return false;
925 template<
typename MT
930 inline bool isIntact(
const Column<MT,SO,DF,SF,CCAs...>& column ) noexcept
932 return ( column.column() < column.operand().columns() &&
952 template<
typename MT1
960 inline bool isSame(
const Column<MT1,SO,DF,SF1,CCAs1...>& a,
961 const Column<MT2,SO,DF,SF2,CCAs2...>& b ) noexcept
963 return (
isSame( a.operand(), b.operand() ) && ( a.column() == b.column() ) );
984 template<
typename MT
990 inline bool trySet(
const Column<MT,SO,DF,SF,CCAs...>& column,
size_t index,
const ET& value )
994 return trySet( column.operand(), index, column.column(), value );
1015 template<
typename MT
1021 inline bool tryAdd(
const Column<MT,SO,DF,SF,CCAs...>& column,
size_t index,
const ET& value )
1025 return tryAdd( column.operand(), index, column.column(), value );
1046 template<
typename MT
1052 inline bool trySub(
const Column<MT,SO,DF,SF,CCAs...>& column,
size_t index,
const ET& value )
1056 return trySub( column.operand(), index, column.column(), value );
1077 template<
typename MT
1083 inline bool tryMult(
const Column<MT,SO,DF,SF,CCAs...>& column,
size_t index,
const ET& value )
1087 return tryMult( column.operand(), index, column.column(), value );
1109 template<
typename MT
1116 tryMult(
const Column<MT,SO,DF,SF,CCAs...>& column,
size_t index,
size_t size,
const ET& value )
1121 return tryMult( column.operand(), index, column.column(),
size, 1UL, value );
1142 template<
typename MT
1148 inline bool tryDiv(
const Column<MT,SO,DF,SF,CCAs...>& column,
size_t index,
const ET& value )
1152 return tryDiv( column.operand(), index, column.column(), value );
1174 template<
typename MT
1181 tryDiv(
const Column<MT,SO,DF,SF,CCAs...>& column,
size_t index,
size_t size,
const ET& value )
1186 return tryDiv( column.operand(), index, column.column(),
size, 1UL, value );
1207 template<
typename MT
1213 inline bool tryAssign(
const Column<MT,SO,DF,SF,CCAs...>& lhs,
1219 return tryAssign( lhs.operand(), ~rhs, index, lhs.column() );
1240 template<
typename MT
1246 inline bool tryAddAssign(
const Column<MT,SO,SF,SF,CCAs...>& lhs,
1252 return tryAddAssign( lhs.operand(), ~rhs, index, lhs.column() );
1273 template<
typename MT
1279 inline bool trySubAssign(
const Column<MT,SO,DF,SF,CCAs...>& lhs,
1285 return trySubAssign( lhs.operand(), ~rhs, index, lhs.column() );
1306 template<
typename MT
1312 inline bool tryMultAssign(
const Column<MT,SO,DF,SF,CCAs...>& lhs,
1318 return tryMultAssign( lhs.operand(), ~rhs, index, lhs.column() );
1339 template<
typename MT
1345 inline bool tryDivAssign(
const Column<MT,SO,DF,SF,CCAs...>& lhs,
1351 return tryDivAssign( lhs.operand(), ~rhs, index, lhs.column() );
1372 template<
typename MT
1377 inline decltype(
auto) derestrict( Column<MT,SO,DF,SF,I>& c )
1379 return column<I>( derestrict( c.operand() ),
unchecked );
1400 template<
typename MT
1405 inline decltype(
auto) derestrict( Column<MT,SO,DF,SF,I>&& c )
1407 return column<I>( derestrict( c.operand() ),
unchecked );
1428 template<
typename MT
1432 inline decltype(
auto) derestrict( Column<MT,SO,DF,SF>& c )
1455 template<
typename MT
1459 inline decltype(
auto) derestrict( Column<MT,SO,DF,SF>&& c )
1477 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs >
1478 struct Size< Column<MT,SO,DF,SF,CRAs...>, 0UL >
1479 :
public Size<MT,0UL>
1495 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CCAs >
1513 template<
typename MT,
bool SO,
bool SF,
size_t... CCAs >
1531 template<
typename MT,
bool SO,
bool SF,
size_t... CCAs >
1549 template<
typename MT,
bool SO,
bool SF,
size_t... CCAs >
1550 struct IsAligned< Column<MT,SO,true,SF,CCAs...> >
1551 :
public And< IsAligned<MT>, Or< IsColumnMajorMatrix<MT>, IsSymmetric<MT> > >
1567 template<
typename MT,
bool SF,
size_t... CCAs >
1585 template<
typename MT,
bool SO,
bool SF,
size_t... CCAs >
1586 struct IsPadded< Column<MT,SO,true,SF,CCAs...> >
1587 :
public And< IsPadded<MT>, Or< IsColumnMajorMatrix<MT>, IsSymmetric<MT> > >
1603 template<
typename MT,
bool DF,
size_t... CCAs >
1621 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CCAs,
size_t... CSAs >
1640 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CCAs,
size_t... CEAs >
1641 struct ElementsTrait< Column<MT,SO,DF,SF,CCAs...>, CEAs... >
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:131
Header file for the blaze::checked and blaze::unchecked instances.
Base class for all binary matrix map expression templates.The MatMatMapExpr class serves as a tag for...
Definition: MatMatMapExpr.h:66
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
Header file for the UNUSED_PARAMETER function template.
BLAZE_ALWAYS_INLINE bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b) noexcept
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:949
Header file for basic type definitions.
Base class for all matrix serial evaluation expression templates.The MatSerialExpr class serves as a ...
Definition: MatSerialExpr.h:67
Base class for all matrix/scalar division expression templates.The MatScalarDivExpr class serves as a...
Definition: MatScalarDivExpr.h:66
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Header file for the MatTransExpr base class.
Compile time check for resizable data types.This type trait tests whether the given data type is an o...
Definition: IsOpposedView.h:81
Header file for the IsColumnMajorMatrix type trait.
Header file for the implementation of the Column base template.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
Base class for all matrix/scalar multiplication expression templates.The MatScalarMultExpr class serv...
Definition: MatScalarMultExpr.h:67
Header file for the And class template.
Header file for the MatEvalExpr base class.
Header file for the MatMatMultExpr base class.
typename ElementsTrait< VT, CEAs... >::Type ElementsTrait_
Auxiliary alias declaration for the ElementsTrait type trait.The ElementsTrait_ alias declaration pro...
Definition: ElementsTrait.h:144
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
Header file for the elements trait.
Compile time check for data types with restricted data access.This type trait tests whether the given...
Definition: IsRestricted.h:82
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:109
Compile time check for low-level access to mutable data.This type trait tests whether the given data ...
Definition: HasMutableDataAccess.h:75
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Column specialization for dense matrices.
Header file for the MatMapExpr base class.
Compile time check for the memory layout of data types.This type trait tests whether the given data t...
Definition: IsContiguous.h:86
Header file for the IsSymmetric type trait.
Base class for all matrix/matrix subtraction expression templates.The MatMatSubExpr class serves as a...
Definition: MatMatSubExpr.h:67
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
Header file for the Or class template.
Header file for the subvector trait.
Base class for all matrix/matrix addition expression templates.The MatMatAddExpr class serves as a ta...
Definition: MatMatAddExpr.h:66
Header file for the MatMatSubExpr base class.
Header file for the IsAligned type trait.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:506
Base class for all unary matrix map expression templates.The MatMapExpr class serves as a tag for all...
Definition: MatMapExpr.h:66
Implementation of a type list.The TypeList class template represents a list of data types of arbitrar...
Definition: TypeList.h:119
Header file for the IsOpposedView type trait.
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:794
Header file for the exception macros of the math module.
Base template for the ElementsTrait class.
Definition: ElementsTrait.h:108
Header file for the MatSerialExpr base class.
Header file for the VecTVecMultExpr base class.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
typename SubvectorTrait< VT, CSAs... >::Type SubvectorTrait_
Auxiliary alias declaration for the SubvectorTrait type trait.The SubvectorTrait_ alias declaration p...
Definition: SubvectorTrait.h:145
Header file for the HasConstDataAccess type trait.
Header file for the DeclExpr base class.
Base class for all matrix/matrix multiplication expression templates.The MatMatMultExpr class serves ...
Definition: MatMatMultExpr.h:67
Header file for the Matrix base class.
Header file for the MatScalarMultExpr base class.
Base class for all Schur product expression templates.The SchurExpr class serves as a tag for all exp...
Definition: SchurExpr.h:66
Header file for run time assertion macros.
Header file for the Unique class template.
Header file for the IsContiguous type trait.
Header file for the SchurExpr base class.
Base class for all matrix evaluation expression templates.The MatEvalExpr class serves as a tag for a...
Definition: MatEvalExpr.h:66
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Header file for the column trait.
Header file for the isDefault shim.
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:101
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
Base class for all matrix transposition expression templates.The MatTransExpr class serves as a tag f...
Definition: MatTransExpr.h:66
Header file for the HasMutableDataAccess type trait.
Header file for the MatMatAddExpr base class.
Base class for all outer product expression templates.The VecTVecMultExpr class serves as a tag for a...
Definition: VecTVecMultExpr.h:67
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:177
Header file for the MatMatMapExpr base class.
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
Column specialization for sparse matrices.
Compile time logical 'and' evaluation.The And alias declaration performs at compile time a logical 'a...
Definition: And.h:76
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
Header file for the MatScalarDivExpr base class.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Searching a type list.The Contains class can be used to search the type list for a particular type Ty...
Definition: Contains.h:78
Header file for the Size type trait.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the TrueType type/value trait base class.
Header file for the function trace functionality.
Template for the blaze::checked and blaze::unchecked instances.blaze::Check is the template for the b...
Definition: Check.h:56
decltype(auto) map(const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs, OP op)
Evaluates the given binary operation on each single element of the dense matrices lhs and rhs...
Definition: DMatDMatMapExpr.h:1134