35#ifndef _BLAZE_MATH_VIEWS_COLUMN_H_
36#define _BLAZE_MATH_VIEWS_COLUMN_H_
141 using ReturnType = Column_<MT,I>;
142 return ReturnType( *matrix, args... );
190 using ReturnType =
const Column_<const MT,I>;
191 return ReturnType( *matrix, args... );
218 using ReturnType = Column_<MT,I>;
219 return ReturnType( *matrix, args... );
267 using ReturnType = Column_<MT>;
268 return ReturnType( *matrix, index, args... );
316 using ReturnType =
const Column_<const MT>;
317 return ReturnType( *matrix, index, args... );
344 using ReturnType = Column_<MT>;
345 return ReturnType( *matrix, index, args... );
371template<
size_t... CCAs
374inline decltype(
auto)
column(
const MatMatAddExpr<MT>& matrix, RCAs... args )
378 return column<CCAs...>( (*matrix).leftOperand(), args... ) +
379 column<CCAs...>( (*matrix).rightOperand(), args... );
398template<
size_t... CCAs
401inline decltype(
auto)
column(
const MatMatSubExpr<MT>& matrix, RCAs... args )
405 return column<CCAs...>( (*matrix).leftOperand(), args... ) -
406 column<CCAs...>( (*matrix).rightOperand(), args... );
425template<
size_t... CCAs
428inline decltype(
auto)
column(
const SchurExpr<MT>& matrix, RCAs... args )
432 return column<CCAs...>( (*matrix).leftOperand(), args... ) *
433 column<CCAs...>( (*matrix).rightOperand(), args... );
452template<
size_t... CCAs
455inline decltype(
auto)
column(
const MatMatMultExpr<MT>& matrix, RCAs... args )
459 return (*matrix).leftOperand() *
column<CCAs...>( (*matrix).rightOperand(), args... );
478template<
size_t... CCAs
481inline decltype(
auto)
column(
const MatMatKronExpr<MT>& matrix, RCAs... args )
485 const ColumnData<CCAs...> cd( args... );
488 if( (*matrix).columns() <= cd.column() ) {
493 const size_t columns( (*matrix).rightOperand().columns() );
518inline decltype(
auto)
column(
const VecTVecMultExpr<MT>& matrix, RCAs... args )
523 if( (*matrix).columns() <= I ) {
528 return (*matrix).leftOperand() * (*matrix).rightOperand()[I];
550inline decltype(
auto)
column(
const VecTVecMultExpr<MT>& matrix,
size_t index, RCAs... args )
555 if( (*matrix).columns() <= index ) {
560 return (*matrix).leftOperand() * (*matrix).rightOperand()[index];
579template<
size_t... CCAs
582inline decltype(
auto)
column(
const MatScalarMultExpr<MT>& matrix, RCAs... args )
586 return column<CCAs...>( (*matrix).leftOperand(), args... ) * (*matrix).rightOperand();
605template<
size_t... CCAs
608inline decltype(
auto)
column(
const MatScalarDivExpr<MT>& matrix, RCAs... args )
612 return column<CCAs...>( (*matrix).leftOperand(), args... ) / (*matrix).rightOperand();
631template<
size_t... CCAs
634inline decltype(
auto)
column(
const MatMapExpr<MT>& matrix, RCAs... args )
638 return map( column<CCAs...>( (*matrix).operand(), args... ), (*matrix).operation() );
657template<
size_t... CCAs
660inline decltype(
auto)
column(
const MatMatMapExpr<MT>& matrix, RCAs... args )
664 return map( column<CCAs...>( (*matrix).leftOperand(), args... ),
665 column<CCAs...>( (*matrix).rightOperand(), args... ),
666 (*matrix).operation() );
689inline decltype(
auto)
column(
const VecTVecMapExpr<MT>& matrix, RCAs... args )
694 if( (*matrix).columns() <= I ) {
699 return map( (*matrix).leftOperand(),
700 blaze::bind2nd( (*matrix).operation(), (*matrix).rightOperand()[I] ) );
722inline decltype(
auto)
column(
const VecTVecMapExpr<MT>& matrix,
size_t index, RCAs... args )
727 if( (*matrix).columns() <= index ) {
732 return map( (*matrix).leftOperand(),
733 blaze::bind2nd( (*matrix).operation(), (*matrix).rightOperand()[index] ) );
752template<
size_t... CCAs
755inline decltype(
auto)
column(
const MatEvalExpr<MT>& matrix, RCAs... args )
759 return eval( column<CCAs...>( (*matrix).operand(), args... ) );
778template<
size_t... CCAs
781inline decltype(
auto)
column(
const MatSerialExpr<MT>& matrix, RCAs... args )
785 return serial( column<CCAs...>( (*matrix).operand(), args... ) );
804template<
size_t... CCAs
807inline decltype(
auto)
column(
const MatNoAliasExpr<MT>& matrix, RCAs... args )
811 return noalias( column<CCAs...>( (*matrix).operand(), args... ) );
830template<
size_t... CCAs
833inline decltype(
auto)
column(
const MatNoSIMDExpr<MT>& matrix, RCAs... args )
837 return nosimd( column<CCAs...>( (*matrix).operand(), args... ) );
856template<
size_t... CCAs
859inline decltype(
auto)
column(
const DeclExpr<MT>& matrix, RCAs... args )
863 return column<CCAs...>( (*matrix).operand(), args... );
882template<
size_t... CCAs
885inline decltype(
auto)
column(
const MatTransExpr<MT>& matrix, RCAs... args )
890 return trans( row<CCAs...>( (*matrix).operand(), args... ) );
913template<
size_t... CCAs
917 , EnableIf_t< IsColumnMajorMatrix_v<MT> >* =
nullptr >
918inline decltype(
auto)
column(
const VecExpandExpr<MT,CEAs...>& matrix, RCAs... args )
923 const ColumnData<CCAs...> cd( args... );
924 if( (*matrix).columns() <= cd.column() ) {
948template<
size_t... CCAs
952 , EnableIf_t< !IsColumnMajorMatrix_v<MT> >* =
nullptr >
953inline decltype(
auto)
column(
const VecExpandExpr<MT,CEAs...>& matrix, RCAs... args )
957 const ColumnData<CCAs...> cd( args... );
960 if( (*matrix).columns() <= cd.column() ) {
965 using ET = ElementType_t< MatrixType_t<MT> >;
967 return UniformVector<ET,columnVector>( (*matrix).rows(), (*matrix).operand()[cd.column()] );
986template<
size_t... CCAs
990inline decltype(
auto)
column(
const MatRepeatExpr<MT,CRAs...>& matrix, RCAs... args )
994 const ColumnData<CCAs...> cd( args... );
997 if( (*matrix).columns() <= cd.column() ) {
1003 , cd.column() % (*matrix).operand().columns()
1005 , (*matrix).template repetitions<0UL>() );
1054 for(
size_t i=0UL; i<
column.size(); ++i )
1055 if( !isDefault<RF>(
column[i] ) )
return false;
1097 for(
const auto& element :
column )
1098 if( !isDefault<RF>( element.value() ) )
return false;
1123template<
typename MT
1128inline bool isIntact(
const Column<MT,SO,DF,SF,CCAs...>&
column )
noexcept
1130 return (
column.column() <
column.operand().columns() &&
1150template<
typename MT1
1158inline bool isSame(
const Column<MT1,SO,DF,SF1,CCAs1...>& a,
1159 const Column<MT2,SO,DF,SF2,CCAs2...>& b )
noexcept
1161 return (
isSame( a.operand(), b.operand() ) && ( a.column() == b.column() ) );
1182template<
typename MT
1188inline bool trySet(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
const ET& value )
1192 return trySet(
column.operand(), index,
column.column(), value );
1214template<
typename MT
1221 trySet(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
size_t size,
const ET& value )
1226 return trySet(
column.operand(), index,
column.column(),
size, 1UL, value );
1247template<
typename MT
1253inline bool tryAdd(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
const ET& value )
1257 return tryAdd(
column.operand(), index,
column.column(), value );
1279template<
typename MT
1286 tryAdd(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
size_t size,
const ET& value )
1291 return tryAdd(
column.operand(), index,
column.column(),
size, 1UL, value );
1312template<
typename MT
1318inline bool trySub(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
const ET& value )
1322 return trySub(
column.operand(), index,
column.column(), value );
1344template<
typename MT
1351 trySub(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
size_t size,
const ET& value )
1356 return trySub(
column.operand(), index,
column.column(),
size, 1UL, value );
1377template<
typename MT
1383inline bool tryMult(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
const ET& value )
1387 return tryMult(
column.operand(), index,
column.column(), value );
1409template<
typename MT
1416 tryMult(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
size_t size,
const ET& value )
1421 return tryMult(
column.operand(), index,
column.column(),
size, 1UL, value );
1442template<
typename MT
1448inline bool tryDiv(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
const ET& value )
1452 return tryDiv(
column.operand(), index,
column.column(), value );
1474template<
typename MT
1481 tryDiv(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
size_t size,
const ET& value )
1486 return tryDiv(
column.operand(), index,
column.column(),
size, 1UL, value );
1507template<
typename MT
1512inline bool tryShift(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
int count )
1516 return tryShift(
column.operand(), index,
column.column(), count );
1538template<
typename MT
1544 tryShift(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
size_t size,
int count )
1549 return tryShift(
column.operand(), index,
column.column(),
size, 1UL, count );
1570template<
typename MT
1576inline bool tryBitand(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
const ET& value )
1580 return tryBitand(
column.operand(), index,
column.column(), value );
1602template<
typename MT
1609 tryBitand(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
size_t size,
const ET& value )
1614 return tryBitand(
column.operand(), index,
column.column(),
size, 1UL, value );
1635template<
typename MT
1641inline bool tryBitor(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
const ET& value )
1645 return tryBitor(
column.operand(), index,
column.column(), value );
1667template<
typename MT
1674 tryBitor(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
size_t size,
const ET& value )
1679 return tryBitor(
column.operand(), index,
column.column(),
size, 1UL, value );
1700template<
typename MT
1706inline bool tryBitxor(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
const ET& value )
1710 return tryBitxor(
column.operand(), index,
column.column(), value );
1732template<
typename MT
1739 tryBitxor(
const Column<MT,SO,DF,SF,CCAs...>&
column,
size_t index,
size_t size,
const ET& value )
1744 return tryBitxor(
column.operand(), index,
column.column(),
size, 1UL, value );
1765template<
typename MT
1771inline bool tryAssign(
const Column<MT,SO,DF,SF,CCAs...>& lhs,
1772 const Vector<VT,false>& rhs,
size_t index )
1777 return tryAssign( lhs.operand(), *rhs, index, lhs.column() );
1798template<
typename MT
1804inline bool tryAddAssign(
const Column<MT,SO,SF,SF,CCAs...>& lhs,
1805 const Vector<VT,false>& rhs,
size_t index )
1810 return tryAddAssign( lhs.operand(), *rhs, index, lhs.column() );
1831template<
typename MT
1837inline bool trySubAssign(
const Column<MT,SO,DF,SF,CCAs...>& lhs,
1838 const Vector<VT,false>& rhs,
size_t index )
1843 return trySubAssign( lhs.operand(), *rhs, index, lhs.column() );
1864template<
typename MT
1870inline bool tryMultAssign(
const Column<MT,SO,DF,SF,CCAs...>& lhs,
1871 const Vector<VT,false>& rhs,
size_t index )
1876 return tryMultAssign( lhs.operand(), *rhs, index, lhs.column() );
1897template<
typename MT
1903inline bool tryDivAssign(
const Column<MT,SO,DF,SF,CCAs...>& lhs,
1904 const Vector<VT,false>& rhs,
size_t index )
1909 return tryDivAssign( lhs.operand(), *rhs, index, lhs.column() );
1930template<
typename MT
1936inline bool tryShiftAssign(
const Column<MT,SO,SF,SF,CCAs...>& lhs,
1937 const Vector<VT,false>& rhs,
size_t index )
1942 return tryShiftAssign( lhs.operand(), *rhs, index, lhs.column() );
1963template<
typename MT
1969inline bool tryBitandAssign(
const Column<MT,SO,SF,SF,CCAs...>& lhs,
1970 const Vector<VT,false>& rhs,
size_t index )
1975 return tryBitandAssign( lhs.operand(), *rhs, index, lhs.column() );
1996template<
typename MT
2002inline bool tryBitorAssign(
const Column<MT,SO,SF,SF,CCAs...>& lhs,
2003 const Vector<VT,false>& rhs,
size_t index )
2008 return tryBitorAssign( lhs.operand(), *rhs, index, lhs.column() );
2029template<
typename MT
2035inline bool tryBitxorAssign(
const Column<MT,SO,SF,SF,CCAs...>& lhs,
2036 const Vector<VT,false>& rhs,
size_t index )
2041 return tryBitxorAssign( lhs.operand(), *rhs, index, lhs.column() );
2062template<
typename MT
2067inline decltype(
auto) derestrict( Column<MT,SO,DF,SF,I>& c )
2069 return column<I>( derestrict( c.operand() ),
unchecked );
2090template<
typename MT
2095inline decltype(
auto) derestrict( Column<MT,SO,DF,SF,I>&& c )
2097 return column<I>( derestrict( c.operand() ),
unchecked );
2118template<
typename MT
2122inline decltype(
auto) derestrict( Column<MT,SO,DF,SF>& c )
2145template<
typename MT
2149inline decltype(
auto) derestrict( Column<MT,SO,DF,SF>&& c )
2170template<
typename MT
2175inline decltype(
auto) unview( Column<MT,SO,DF,SF,CCAs...>& c )
2196template<
typename MT
2201inline decltype(
auto) unview(
const Column<MT,SO,DF,SF,CCAs...>& c )
2219template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs >
2220struct Size< Column<MT,SO,DF,SF,CRAs...>, 0UL >
2221 :
public Size<MT,0UL>
2237template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs >
2238struct MaxSize< Column<MT,SO,DF,SF,CRAs...>, 0UL >
2239 :
public MaxSize<MT,0UL>
2255template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CCAs >
2256struct IsRestricted< Column<MT,SO,DF,SF,CCAs...> >
2257 :
public IsRestricted<MT>
2273template<
typename MT,
bool SO,
bool SF,
size_t... CCAs >
2274struct HasConstDataAccess< Column<MT,SO,true,SF,CCAs...> >
2275 :
public HasConstDataAccess<MT>
2291template<
typename MT,
bool SO,
bool SF,
size_t... CCAs >
2292struct HasMutableDataAccess< Column<MT,SO,true,SF,CCAs...> >
2293 :
public HasMutableDataAccess<MT>
2309template<
typename MT,
bool SO,
bool SF,
size_t... CCAs >
2310struct IsAligned< Column<MT,SO,true,SF,CCAs...> >
2311 :
public BoolConstant< IsAligned_v<MT> && ( IsColumnMajorMatrix_v<MT> || IsSymmetric_v<MT> ) >
2327template<
typename MT,
bool SF,
size_t... CCAs >
2328struct IsContiguous< Column<MT,true,true,SF,CCAs...> >
2329 :
public IsContiguous<MT>
2345template<
typename MT,
bool SO,
bool SF,
size_t... CCAs >
2346struct IsPadded< Column<MT,SO,true,SF,CCAs...> >
2347 :
BoolConstant< IsPadded_v<MT> && ( IsColumnMajorMatrix_v<MT> || IsSymmetric_v<MT> ) >
2363template<
typename MT,
bool DF,
size_t... CCAs >
2364struct IsOpposedView< Column<MT,false,DF,false,CCAs...> >
Header file for run time assertion macros.
Header file for the Bind2nd functor.
Header file for the blaze::checked and blaze::unchecked instances.
Header file for the implementation of the ColumnData class template.
Header file for the EnableIf class template.
Header file for the function trace functionality.
Header file for the HasConstDataAccess type trait.
Header file for the HasMutableDataAccess type trait.
Header file for the IntegralConstant class template.
Header file for the IsAligned type trait.
Header file for the IsColumnMajorMatrix type trait.
Header file for the IsContiguous type trait.
Header file for the isDefault shim.
Header file for the IsOpposedView type trait.
Header file for the IsPadded type trait.
Header file for the IsSymmetric type trait.
Header file for the MaxSize type trait.
Header file for the relaxation flag enumeration.
Base class for matrices.
Definition: Matrix.h:85
Header file for the DeclExpr base class.
Header file for the MatEvalExpr base class.
Header file for the MatMapExpr base class.
Header file for the MatMatAddExpr base class.
Header file for the MatMatKronExpr base class.
Header file for the MatMatMapExpr base class.
Header file for the MatMatMultExpr base class.
Header file for the MatMatSubExpr base class.
Header file for the MatNoAliasExpr base class.
Header file for the MatNoSIMDExpr base class.
Header file for the MatRepeatExpr base class.
Header file for the MatScalarDivExpr base class.
Header file for the MatScalarMultExpr base class.
Header file for the MatSerialExpr base class.
Header file for the MatTransExpr base class.
Header file for the Matrix base class.
Header file for the SchurExpr base class.
Header file for the VecExpandExpr base class.
Header file for the VecTVecMapExpr base class.
Header file for the VecTVecMultExpr base class.
decltype(auto) column(Matrix< MT, SO > &&matrix, size_t index, RCAs... args)
Creating a view on a specific column of the given temporary matrix.
Definition: Column.h:340
decltype(auto) noalias(const DenseMatrix< MT, SO > &dm)
Forces the non-aliased evaluation of the given dense matrix expression dm.
Definition: DMatNoAliasExpr.h:679
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:790
decltype(auto) repeat(const DenseMatrix< MT, SO > &dm, size_t m, size_t n)
Repeats the given dense matrix.
Definition: DMatRepeatExpr.h:543
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
decltype(auto) map(const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs, OP op)
Elementwise evaluation of the given binary operation on each single element of the dense matrices lhs...
Definition: DMatDMatMapExpr.h:1144
decltype(auto) nosimd(const DenseMatrix< MT, SO > &dm)
Disables the SIMD evaluation of the given dense matrix expression dm.
Definition: DMatNoSIMDExpr.h:717
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:812
decltype(auto) kron(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the Kronecker product of two dense matrices ( ).
Definition: DMatDMatKronExpr.h:957
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:207
bool isDefault(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the given diagonal matrix is in default state.
Definition: DiagonalMatrix.h:169
constexpr Bind2nd< OP, A2 > bind2nd(const OP &op, const A2 &a2)
Binds the given object/value to the 2nd parameter of the given operation.
Definition: Bind2nd.h:155
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition: RelaxationFlag.h:66
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:660
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:1424
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:676
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:158
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
BoolConstant< true > TrueType
Type traits base class.
Definition: IntegralConstant.h:132
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition: IntegralConstant.h:110
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition: FunctionTrace.h:94
constexpr bool isChecked(const Ts &... args)
Extracting blaze::Check arguments from a given list of arguments.
Definition: Check.h:225
constexpr Unchecked unchecked
Global Unchecked instance.
Definition: Check.h:146
Header file for the exception macros of the math module.
Header file for the Size type trait.
Header file for basic type definitions.
Header file for the implementation of the Column base template.
Column specialization for dense matrices.
Column specialization for sparse matrices.