35 #ifndef _BLAZE_MATH_VIEWS_COLUMN_H_
36 #define _BLAZE_MATH_VIEWS_COLUMN_H_
123 template<
typename MT
125 inline DisableIf_< Or< IsComputation<MT>, IsTransExpr<MT> >, ColumnExprTrait_<MT> >
167 template<
typename MT
169 inline const DisableIf_< Or< IsComputation<MT>, IsTransExpr<MT> >, ColumnExprTrait_<const MT> >
193 template<
typename MT
195 inline DisableIf_< Or< IsComputation<MT>, IsTransExpr<MT> >, ColumnExprTrait_<MT> >
225 template<
typename MT
227 inline const EnableIf_< IsMatMatAddExpr<MT>, ColumnExprTrait_<MT> >
228 column(
const Matrix<MT,SO>& matrix,
size_t index )
232 return column( (~matrix).leftOperand(), index ) +
column( (~matrix).rightOperand(), index );
250 template<
typename MT
252 inline const EnableIf_< IsMatMatSubExpr<MT>, ColumnExprTrait_<MT> >
253 column(
const Matrix<MT,SO>& matrix,
size_t index )
257 return column( (~matrix).leftOperand(), index ) -
column( (~matrix).rightOperand(), index );
275 template<
typename MT
277 inline const EnableIf_< IsMatMatMultExpr<MT>, ColumnExprTrait_<MT> >
278 column(
const Matrix<MT,SO>& matrix,
size_t index )
282 return (~matrix).leftOperand() *
column( (~matrix).rightOperand(), index );
300 template<
typename MT
302 inline const EnableIf_< IsVecTVecMultExpr<MT>, ColumnExprTrait_<MT> >
303 column(
const Matrix<MT,SO>& matrix,
size_t index )
307 return (~matrix).leftOperand() * (~matrix).rightOperand()[index];
325 template<
typename MT
327 inline const EnableIf_< IsMatScalarMultExpr<MT>, ColumnExprTrait_<MT> >
328 column(
const Matrix<MT,SO>& matrix,
size_t index )
332 return column( (~matrix).leftOperand(), index ) * (~matrix).rightOperand();
350 template<
typename MT
352 inline const EnableIf_< IsMatScalarDivExpr<MT>, ColumnExprTrait_<MT> >
353 column(
const Matrix<MT,SO>& matrix,
size_t index )
357 return column( (~matrix).leftOperand(), index ) / (~matrix).rightOperand();
375 template<
typename MT
377 inline const EnableIf_< IsMatForEachExpr<MT>, ColumnExprTrait_<MT> >
378 column(
const Matrix<MT,SO>& matrix,
size_t index )
382 return forEach(
column( (~matrix).operand(), index ), (~matrix).operation() );
400 template<
typename MT
402 inline const EnableIf_< IsMatEvalExpr<MT>, ColumnExprTrait_<MT> >
403 column(
const Matrix<MT,SO>& matrix,
size_t index )
407 return eval(
column( (~matrix).operand(), index ) );
425 template<
typename MT
427 inline const EnableIf_< IsMatSerialExpr<MT>, ColumnExprTrait_<MT> >
428 column(
const Matrix<MT,SO>& matrix,
size_t index )
450 template<
typename MT
452 inline const EnableIf_< IsMatTransExpr<MT>, ColumnExprTrait_<MT> >
453 column(
const Matrix<MT,SO>& matrix,
size_t index )
457 return trans(
row( (~matrix).operand(), index ) );
480 template<
typename MT,
bool SO,
bool DF,
bool SF >
483 template<
typename MT,
bool SO,
bool DF,
bool SF >
486 template<
typename MT,
bool SO,
bool DF,
bool SF >
489 template<
typename MT,
bool SO,
bool DF,
bool SF >
490 inline bool isIntact(
const Column<MT,SO,DF,SF>&
column ) noexcept;
492 template<
typename MT,
bool SO,
bool DF,
bool SF >
493 inline bool isSame(
const Column<MT,SO,DF,SF>& a,
const Column<MT,SO,DF,SF>& b ) noexcept;
505 template<
typename MT
525 template<
typename MT
554 template<
typename MT
560 for(
size_t i=0UL; i<column.size(); ++i )
561 if( !
isDefault( column[i] ) )
return false;
586 template<
typename MT
591 typedef ConstIterator_< Column<MT,SO,false,SF> >
ConstIterator;
593 const ConstIterator
end( column.end() );
594 for( ConstIterator element=column.begin(); element!=
end; ++element )
595 if( !
isDefault( element->value() ) )
return false;
619 template<
typename MT
625 return ( column.col_ <= column.matrix_.columns() &&
643 template<
typename MT
649 return (
isSame( a.matrix_, b.matrix_ ) && ( a.col_ == b.col_ ) );
669 template<
typename MT
674 inline bool tryAssign(
const Column<MT,SO,DF,SF>& lhs,
const Vector<VT,false>& rhs,
size_t index )
679 return tryAssign( lhs.matrix_, ~rhs, index, lhs.col_ );
700 template<
typename MT
705 inline bool tryAddAssign(
const Column<MT,SO,DF,SF>& lhs,
const Vector<VT,false>& rhs,
size_t index )
710 return tryAddAssign( lhs.matrix_, ~rhs, index, lhs.col_ );
731 template<
typename MT
736 inline bool trySubAssign(
const Column<MT,SO,DF,SF>& lhs,
const Vector<VT,false>& rhs,
size_t index )
741 return trySubAssign( lhs.matrix_, ~rhs, index, lhs.col_ );
762 template<
typename MT
767 inline bool tryMultAssign(
const Column<MT,SO,DF,SF>& lhs,
const Vector<VT,false>& rhs,
size_t index )
772 return tryMultAssign( lhs.matrix_, ~rhs, index, lhs.col_ );
793 template<
typename MT
798 inline bool tryDivAssign(
const Column<MT,SO,DF,SF>& lhs,
const Vector<VT,false>& rhs,
size_t index )
803 return tryDivAssign( lhs.matrix_, ~rhs, index, lhs.col_ );
824 template<
typename MT
828 inline DerestrictTrait_< Column<MT,SO,DF,SF> > derestrict( Column<MT,SO,DF,SF>& column )
830 typedef DerestrictTrait_< Column<MT,SO,DF,SF> >
ReturnType;
831 return ReturnType( derestrict( column.matrix_ ), column.col_ );
847 template<
typename MT,
bool SO,
bool DF,
bool SF >
848 struct IsRestricted< Column<MT,SO,DF,SF> > :
public BoolConstant< IsRestricted<MT>::value >
864 template<
typename MT,
bool SO,
bool DF,
bool SF >
865 struct DerestrictTrait< Column<MT,SO,DF,SF> >
867 using Type = Column< RemoveReference_< DerestrictTrait_<MT> > >;
883 template<
typename MT,
bool SO,
bool SF >
884 struct HasConstDataAccess< Column<MT,SO,true,SF> >
901 template<
typename MT,
bool SO,
bool SF >
902 struct HasMutableDataAccess< Column<MT,SO,true,SF> >
903 :
public BoolConstant< HasMutableDataAccess<MT>::value >
919 template<
typename MT,
bool SO,
bool SF >
920 struct IsAligned< Column<MT,SO,true,SF> >
921 :
public BoolConstant< And< IsAligned<MT>, Or< IsColumnMajorMatrix<MT>, IsSymmetric<MT> > >::value >
937 template<
typename MT,
bool SO,
bool SF >
938 struct IsPadded< Column<MT,SO,true,SF> >
939 :
public BoolConstant< And< IsPadded<MT>, Or< IsColumnMajorMatrix<MT>, IsSymmetric<MT> > >::value >
955 template<
typename MT,
bool DF >
956 struct IsOpposedView< Column<MT,false,DF,false> >
973 template<
typename MT,
bool SO,
bool DF,
bool SF,
typename T >
974 struct AddTrait< Column<MT,SO,DF,SF>, T >
976 using Type = AddTrait_< ColumnTrait_<MT>, T >;
979 template<
typename T,
typename MT,
bool SO,
bool DF,
bool SF >
980 struct AddTrait< T, Column<MT,SO,DF,SF> >
982 using Type = AddTrait_< T, ColumnTrait_<MT> >;
998 template<
typename MT,
bool SO,
bool DF,
bool SF,
typename T >
999 struct SubTrait< Column<MT,SO,DF,SF>, T >
1001 using Type = SubTrait_< ColumnTrait_<MT>, T >;
1004 template<
typename T,
typename MT,
bool SO,
bool DF,
bool SF >
1005 struct SubTrait< T, Column<MT,SO,DF,SF> >
1007 using Type = SubTrait_< T, ColumnTrait_<MT> >;
1023 template<
typename MT,
bool SO,
bool DF,
bool SF,
typename T >
1024 struct MultTrait< Column<MT,SO,DF,SF>, T >
1026 using Type = MultTrait_< ColumnTrait_<MT>, T >;
1029 template<
typename T,
typename MT,
bool SO,
bool DF,
bool SF >
1030 struct MultTrait< T, Column<MT,SO,DF,SF> >
1032 using Type = MultTrait_< T, ColumnTrait_<MT> >;
1048 template<
typename MT,
bool SO,
bool DF,
bool SF,
typename T >
1049 struct CrossTrait< Column<MT,SO,DF,SF>, T >
1051 using Type = CrossTrait_< ColumnTrait_<MT>, T >;
1054 template<
typename T,
typename MT,
bool SO,
bool DF,
bool SF >
1055 struct CrossTrait< T, Column<MT,SO,DF,SF> >
1057 using Type = CrossTrait_< T, ColumnTrait_<MT> >;
1073 template<
typename MT,
bool SO,
bool DF,
bool SF,
typename T >
1074 struct DivTrait< Column<MT,SO,DF,SF>, T >
1076 using Type = DivTrait_< ColumnTrait_<MT>, T >;
1079 template<
typename T,
typename MT,
bool SO,
bool DF,
bool SF >
1080 struct DivTrait< T, Column<MT,SO,DF,SF> >
1082 using Type = DivTrait_< T, ColumnTrait_<MT> >;
1098 template<
typename MT,
bool SO,
bool DF,
bool SF >
1099 struct SubvectorTrait< Column<MT,SO,DF,SF> >
1101 using Type = SubvectorTrait_< ResultType_< Column<MT,SO,DF,SF> > >;
Header file for the subtraction trait.
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:653
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
Header file for the ColumnExprTrait class template.
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:533
Header file for the And class template.
Header file for the IsTransExpr type trait class.
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Header file for the IsMatMatAddExpr type trait class.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, ColumnExprTrait_< MT > > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:126
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Header file for the IsMatTransExpr type trait class.
Column specialization for dense matrices.
Header file for the DisableIf class template.
Header file for the multiplication trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the IsVecTVecMultExpr type trait class.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
Header file for the Or class template.
Header file for the IsMatMatMultExpr type trait class.
const DMatForEachExpr< MT, OP, SO > forEach(const DenseMatrix< MT, SO > &dm, OP op)
Evaluates the given custom operation on each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1046
Header file for the IsMatSerialExpr type trait class.
Header file for the IsMatScalarMultExpr type trait class.
Header file for the subvector trait.
Reference to a specific column of a dense or sparse matrix.The Column template represents a reference...
Definition: BaseTemplate.h:354
Header file for the IsAligned type trait.
typename ColumnExprTrait< MT >::Type ColumnExprTrait_
Auxiliary alias declaration for the ColumnExprTrait type trait.The ColumnExprTrait_ alias declaration...
Definition: ColumnExprTrait.h:133
Header file for the IsOpposedView type trait.
Header file for the IsMatEvalExpr type trait class.
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:254
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
Header file for the HasConstDataAccess type trait.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, RowExprTrait_< MT > > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:126
Header file for the Matrix base class.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2642
Header file for the IsMatScalarDivExpr type trait class.
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
Header file for the column trait.
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:89
Header file for the HasMutableDataAccess type trait.
const DMatEvalExpr< MT, SO > eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:705
Header file for the IsMatMatSubExpr type trait class.
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:950
Header file for the IsComputation type trait class.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
Header file for the IntegralConstant class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
Column specialization for sparse matrices.
Header file for the IsMatForEachExpr type trait class.
#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 FunctionTrace class.