35 #ifndef _BLAZE_MATH_ADAPTORS_DIAGONALMATRIX_H_ 36 #define _BLAZE_MATH_ADAPTORS_DIAGONALMATRIX_H_ 123 template<
typename MT,
bool SO,
bool DF >
124 void reset( DiagonalMatrix<MT,SO,DF>& m );
126 template<
typename MT,
bool SO,
bool DF >
127 void reset( DiagonalMatrix<MT,SO,DF>& m,
size_t i );
129 template<
typename MT,
bool SO,
bool DF >
130 void clear( DiagonalMatrix<MT,SO,DF>& m );
132 template<
bool RF,
typename MT,
bool SO,
bool DF >
133 bool isDefault(
const DiagonalMatrix<MT,SO,DF>& m );
135 template<
typename MT,
bool SO,
bool DF >
136 bool isIntact(
const DiagonalMatrix<MT,SO,DF>& m );
138 template<
typename MT,
bool SO,
bool DF >
139 void swap( DiagonalMatrix<MT,SO,DF>& a, DiagonalMatrix<MT,SO,DF>& b ) noexcept;
151 template<
typename MT
174 template<
typename MT
191 template<
typename MT
235 return isDefault<RF>( m.matrix_ );
261 template<
typename MT
279 template<
typename MT
315 inline void invert( DiagonalMatrix<MT,SO,true>& m )
324 invert<asDiagonal>( derestrict( m ) );
351 template<
typename MT1,
bool SO1,
typename MT2,
typename MT3,
typename MT4,
bool SO2 >
352 inline void lu(
const DiagonalMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
353 DenseMatrix<MT3,SO1>& U, Matrix<MT4,SO2>& P )
367 using ET3 = ElementType_t<MT3>;
368 using ET4 = ElementType_t<MT4>;
370 const size_t n( (~A).
rows() );
372 decltype(
auto) U2( derestrict( ~U ) );
382 for(
size_t i=0UL; i<n; ++i ) {
407 template<
typename MT
411 inline bool trySet(
const DiagonalMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
442 template<
typename MT
447 trySet(
const DiagonalMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
456 return ( m == 0UL ) ||
458 (
row ==
column && m == 1UL && n == 1UL ) ||
481 template<
typename MT
485 inline bool tryAdd(
const DiagonalMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
487 return trySet( mat, i, j, value );
511 template<
typename MT
516 tryAdd(
const DiagonalMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
518 return trySet( mat,
row,
column, m, n, value );
540 template<
typename MT
544 inline bool trySub(
const DiagonalMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
546 return trySet( mat, i, j, value );
570 template<
typename MT
575 trySub(
const DiagonalMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
577 return trySet( mat,
row,
column, m, n, value );
599 template<
typename MT
603 inline bool tryBitor(
const DiagonalMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
605 return trySet( mat, i, j, value );
629 template<
typename MT
634 tryBitor(
const DiagonalMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
636 return trySet( mat,
row,
column, m, n, value );
658 template<
typename MT
662 inline bool tryBitxor(
const DiagonalMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
664 return tryAdd( mat, i, j, value );
688 template<
typename MT
693 tryBitxor(
const DiagonalMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
695 return tryAdd( mat,
row,
column, m, n, value );
717 template<
typename MT
721 inline bool tryAssign(
const DiagonalMatrix<MT,SO,DF>& lhs,
722 const DenseVector<VT,false>& rhs,
size_t row,
size_t column )
734 for(
size_t i=0UL; i<index; ++i ) {
739 for(
size_t i=index+1UL; i<(~rhs).
size(); ++i ) {
766 template<
typename MT
770 inline bool tryAssign(
const DiagonalMatrix<MT,SO,DF>& lhs,
771 const DenseVector<VT,true>& rhs,
size_t row,
size_t column )
783 for(
size_t i=0UL; i<index; ++i ) {
788 for(
size_t i=index+1UL; i<(~rhs).
size(); ++i ) {
817 template<
typename MT
822 inline bool tryAssign(
const DiagonalMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
834 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
862 template<
typename MT
866 inline bool tryAssign(
const DiagonalMatrix<MT,SO,DF>& lhs,
867 const SparseVector<VT,false>& rhs,
size_t row,
size_t column )
879 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
880 if( element->index() != index && !
isDefault( element->value() ) )
906 template<
typename MT
910 inline bool tryAssign(
const DiagonalMatrix<MT,SO,DF>& lhs,
911 const SparseVector<VT,true>& rhs,
size_t row,
size_t column )
923 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
924 if( element->index() != index && !
isDefault( element->value() ) )
952 template<
typename MT
957 inline bool tryAssign(
const DiagonalMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
969 for(
const auto& element : ~rhs ) {
997 template<
typename MT1
1001 inline bool tryAssign(
const DiagonalMatrix<MT1,SO,DF>& lhs,
1002 const DenseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1013 const size_t M( (~rhs).
rows() );
1014 const size_t N( (~rhs).
columns() );
1016 for(
size_t i=0UL; i<M; ++i ) {
1017 for(
size_t j=0UL; j<N; ++j ) {
1045 template<
typename MT1
1049 inline bool tryAssign(
const DiagonalMatrix<MT1,SO,DF>& lhs,
1050 const DenseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1061 const size_t M( (~rhs).
rows() );
1062 const size_t N( (~rhs).
columns() );
1064 for(
size_t j=0UL; j<N; ++j ) {
1065 for(
size_t i=0UL; i<M; ++i ) {
1093 template<
typename MT1
1097 inline bool tryAssign(
const DiagonalMatrix<MT1,SO,DF>& lhs,
1098 const SparseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1109 const size_t M( (~rhs).
rows() );
1111 for(
size_t i=0UL; i<M; ++i ) {
1112 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element ) {
1140 template<
typename MT1
1144 inline bool tryAssign(
const DiagonalMatrix<MT1,SO,DF>& lhs,
1145 const SparseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1156 const size_t N( (~rhs).
columns() );
1158 for(
size_t j=0UL; j<N; ++j ) {
1159 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element ) {
1187 template<
typename MT
1192 inline bool tryAddAssign(
const DiagonalMatrix<MT,SO,DF>& lhs,
1193 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
1195 return tryAssign( lhs, ~rhs,
row,
column );
1219 template<
typename MT
1224 inline bool tryAddAssign(
const DiagonalMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
1249 template<
typename MT1
1254 inline bool tryAddAssign(
const DiagonalMatrix<MT1,SO1,DF>& lhs,
1255 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
1257 return tryAssign( lhs, ~rhs,
row,
column );
1280 template<
typename MT
1285 inline bool trySubAssign(
const DiagonalMatrix<MT,SO,DF>& lhs,
1286 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
1288 return tryAssign( lhs, ~rhs,
row,
column );
1312 template<
typename MT
1317 inline bool trySubAssign(
const DiagonalMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
1343 template<
typename MT1
1348 inline bool trySubAssign(
const DiagonalMatrix<MT1,SO1,DF>& lhs,
1349 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
1351 return tryAssign( lhs, ~rhs,
row,
column );
1374 template<
typename MT
1379 inline bool tryBitorAssign(
const DiagonalMatrix<MT,SO,DF>& lhs,
1380 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
1382 return tryAssign( lhs, ~rhs,
row,
column );
1405 template<
typename MT
1410 inline bool tryBitorAssign(
const DiagonalMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
1435 template<
typename MT1
1440 inline bool tryBitorAssign(
const DiagonalMatrix<MT1,SO1,DF>& lhs,
1441 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
1443 return tryAssign( lhs, ~rhs,
row,
column );
1466 template<
typename MT
1471 inline bool tryBitxorAssign(
const DiagonalMatrix<MT,SO,DF>& lhs,
1472 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
1474 return tryAssign( lhs, ~rhs,
row,
column );
1497 template<
typename MT
1502 inline bool tryBitxorAssign(
const DiagonalMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
1528 template<
typename MT1
1533 inline bool tryBitxorAssign(
const DiagonalMatrix<MT1,SO1,DF>& lhs,
1534 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
1536 return tryAssign( lhs, ~rhs,
row,
column );
1557 template<
typename MT
1560 inline MT& derestrict( DiagonalMatrix<MT,SO,DF>& m )
1578 template<
typename MT,
bool SO,
bool DF >
1579 struct Size< DiagonalMatrix<MT,SO,DF>, 0UL >
1580 :
public Size<MT,0UL>
1583 template<
typename MT,
bool SO,
bool DF >
1584 struct Size< DiagonalMatrix<MT,SO,DF>, 1UL >
1585 :
public Size<MT,1UL>
1601 template<
typename MT,
bool SO,
bool DF >
1602 struct MaxSize< DiagonalMatrix<MT,SO,DF>, 0UL >
1603 :
public MaxSize<MT,0UL>
1606 template<
typename MT,
bool SO,
bool DF >
1607 struct MaxSize< DiagonalMatrix<MT,SO,DF>, 1UL >
1608 :
public MaxSize<MT,1UL>
1624 template<
typename MT,
bool SO,
bool DF >
1625 struct IsSquare< DiagonalMatrix<MT,SO,DF> >
1642 template<
typename MT,
bool SO,
bool DF >
1643 struct IsUniform< DiagonalMatrix<MT,SO,DF> >
1644 :
public IsUniform<MT>
1660 template<
typename MT,
bool SO,
bool DF >
1661 struct IsSymmetric< DiagonalMatrix<MT,SO,DF> >
1678 template<
typename MT,
bool SO,
bool DF >
1679 struct IsHermitian< DiagonalMatrix<MT,SO,DF> >
1680 :
public IsBuiltin< ElementType_t<MT> >
1696 template<
typename MT,
bool SO,
bool DF >
1697 struct IsLower< DiagonalMatrix<MT,SO,DF> >
1714 template<
typename MT,
bool SO,
bool DF >
1715 struct IsStrictlyLower< DiagonalMatrix<MT,SO,DF> >
1732 template<
typename MT,
bool SO,
bool DF >
1733 struct IsUpper< DiagonalMatrix<MT,SO,DF> >
1750 template<
typename MT,
bool SO,
bool DF >
1751 struct IsStrictlyUpper< DiagonalMatrix<MT,SO,DF> >
1768 template<
typename MT,
bool SO,
bool DF >
1769 struct IsAdaptor< DiagonalMatrix<MT,SO,DF> >
1786 template<
typename MT,
bool SO,
bool DF >
1787 struct IsRestricted< DiagonalMatrix<MT,SO,DF> >
1804 template<
typename MT,
bool SO >
1805 struct HasConstDataAccess< DiagonalMatrix<MT,SO,true> >
1822 template<
typename MT,
bool SO,
bool DF >
1823 struct IsAligned< DiagonalMatrix<MT,SO,DF> >
1824 :
public IsAligned<MT>
1840 template<
typename MT,
bool SO,
bool DF >
1841 struct IsContiguous< DiagonalMatrix<MT,SO,DF> >
1842 :
public IsContiguous<MT>
1858 template<
typename MT,
bool SO,
bool DF >
1859 struct IsPadded< DiagonalMatrix<MT,SO,DF> >
1860 :
public IsPadded<MT>
1876 template<
typename MT,
bool SO,
bool DF >
1877 struct IsResizable< DiagonalMatrix<MT,SO,DF> >
1878 :
public IsResizable<MT>
1894 template<
typename MT,
bool SO,
bool DF >
1895 struct IsShrinkable< DiagonalMatrix<MT,SO,DF> >
1896 :
public IsShrinkable<MT>
1912 template<
typename MT,
bool SO,
bool DF >
1913 struct RemoveAdaptor< DiagonalMatrix<MT,SO,DF> >
1931 template<
typename T1,
typename T2 >
1932 struct AddTraitEval1< T1, T2
1935 IsDiagonal_v<T1> && IsDiagonal_v<T2> &&
1936 !( IsZero_v<T1> || IsZero_v<T2> ) > >
1938 using Type = DiagonalMatrix< typename AddTraitEval2<T1,T2>::Type >;
1954 template<
typename T1,
typename T2 >
1955 struct SubTraitEval1< T1, T2
1958 IsDiagonal_v<T1> && IsDiagonal_v<T2> &&
1959 !( IsZero_v<T1> || IsZero_v<T2> ) > >
1961 using Type = DiagonalMatrix< typename SubTraitEval2<T1,T2>::Type >;
1964 template<
typename T1,
typename T2 >
1965 struct SubTraitEval1< T1, T2
1968 IsZero_v<T1> && IsIdentity_v<T2> > >
1970 using Tmp = If_t< StorageOrder_v<T1> != StorageOrder_v<T2>, OppositeType_t<T1>, T1 >;
1971 using Type = DiagonalMatrix< typename SubTraitEval2<Tmp,T2>::Type >;
1987 template<
typename T1,
typename T2 >
1988 struct SchurTraitEval1< T1, T2
1991 ( IsDiagonal_v<T1> ||
1993 ( IsLower_v<T1> && IsUpper_v<T2> ) ||
1994 ( IsUpper_v<T1> && IsLower_v<T2> ) ) &&
1995 !( IsStrictlyLower_v<T1> && IsUpper_v<T2> ) &&
1996 !( IsStrictlyUpper_v<T1> && IsLower_v<T2> ) &&
1997 !( IsLower_v<T1> && IsStrictlyUpper_v<T2> ) &&
1998 !( IsUpper_v<T1> && IsStrictlyLower_v<T2> ) &&
1999 !( IsUniTriangular_v<T1> && IsUniTriangular_v<T2> ) &&
2000 !( IsZero_v<T1> || IsZero_v<T2> ) > >
2002 using Type = DiagonalMatrix< typename SchurTraitEval2<T1,T2>::Type >;
2018 template<
typename T1,
typename T2 >
2019 struct MultTraitEval1< T1, T2
2022 ( IsDiagonal_v<T1> && !IsUniform_v<T1> ) > >
2024 using Type = DiagonalMatrix< typename MultTraitEval2<T1,T2>::Type >;
2027 template<
typename T1,
typename T2 >
2028 struct MultTraitEval1< T1, T2
2031 ( IsDiagonal_v<T2> && !IsUniform_v<T2> ) > >
2033 using Type = DiagonalMatrix< typename MultTraitEval2<T1,T2>::Type >;
2036 template<
typename T1,
typename T2 >
2037 struct MultTraitEval1< T1, T2
2040 ( IsDiagonal_v<T1> && IsDiagonal_v<T2> ) &&
2041 !( IsIdentity_v<T1> || IsIdentity_v<T2> ) &&
2042 !( IsZero_v<T1> || IsZero_v<T2> ) > >
2044 using Type = DiagonalMatrix< typename MultTraitEval2<T1,T2>::Type >;
2060 template<
typename T1,
typename T2 >
2061 struct KronTraitEval1< T1, T2
2064 ( IsDiagonal_v<T1> && IsDiagonal_v<T2> ) &&
2065 !( IsIdentity_v<T1> && IsIdentity_v<T2> ) &&
2066 !( IsZero_v<T1> || IsZero_v<T2> ) > >
2068 using Type = DiagonalMatrix< typename KronTraitEval2<T1,T2>::Type >;
2084 template<
typename T1,
typename T2 >
2085 struct DivTraitEval1< T1, T2
2088 using Type = DiagonalMatrix< typename DivTraitEval2<T1,T2>::Type >;
2104 template<
typename T,
typename OP >
2105 struct UnaryMapTraitEval1< T, OP
2107 !YieldsIdentity_v<OP,T> &&
2108 !YieldsZero_v<OP,T> > >
2110 using Type = DiagonalMatrix< typename UnaryMapTraitEval2<T,OP>::Type, StorageOrder_v<T> >;
2118 template<
typename T1,
typename T2,
typename OP >
2119 struct BinaryMapTraitEval1< T1, T2, OP
2121 !YieldsIdentity_v<OP,T1,T2> &&
2122 !YieldsZero_v<OP,T1,T2> > >
2124 using Type = DiagonalMatrix< typename BinaryMapTraitEval2<T1,T2,OP>::Type >;
2140 template<
typename MT,
bool SO,
bool DF >
2141 struct DeclSymTrait< DiagonalMatrix<MT,SO,DF> >
2143 using Type = DiagonalMatrix<MT,SO,DF>;
2159 template<
typename MT,
bool SO,
bool DF >
2160 struct DeclHermTrait< DiagonalMatrix<MT,SO,DF> >
2162 using Type = HermitianMatrix<MT,SO,DF>;
2178 template<
typename MT,
bool SO,
bool DF >
2179 struct DeclLowTrait< DiagonalMatrix<MT,SO,DF> >
2181 using Type = DiagonalMatrix<MT,SO,DF>;
2197 template<
typename MT,
bool SO,
bool DF >
2198 struct DeclUppTrait< DiagonalMatrix<MT,SO,DF> >
2200 using Type = DiagonalMatrix<MT,SO,DF>;
2216 template<
typename MT,
bool SO,
bool DF >
2217 struct DeclDiagTrait< DiagonalMatrix<MT,SO,DF> >
2219 using Type = DiagonalMatrix<MT,SO,DF>;
2235 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
2236 struct HighType< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
2238 using Type = DiagonalMatrix< typename HighType<MT1,MT2>::Type >;
2254 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
2255 struct LowType< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
2257 using Type = DiagonalMatrix< typename LowType<MT1,MT2>::Type >;
2273 template<
typename MT,
size_t I,
size_t N >
2274 struct SubmatrixTraitEval1< MT, I, I, N, N
2276 !IsIdentity_v<MT> > >
2278 using Type = DiagonalMatrix< typename SubmatrixTraitEval2<MT,I,I,N,N>::Type >;
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
Header file for the decldiag trait.
Header file for the Schur product trait.
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.The IsMatrix_v variable template provides a c...
Definition: IsMatrix.h:138
Header file for the subtraction trait.
Header file for the row trait.
Header file for the declherm trait.
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
Flag for the inversion of a lower unitriangular matrix.
Definition: InversionFlag.h:112
Header file for the IsDiagonal type trait.
Header file for the YieldsZero type trait.
Header file for the dense matrix inversion flags.
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
Header file for the YieldsIdentity type trait.
constexpr bool YieldsDiagonal_v
Auxiliary variable template for the YieldsDiagonal type trait.The YieldsDiagonal_v variable template ...
Definition: YieldsDiagonal.h:126
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower or upper unitriangular matrix ty...
Definition: UniTriangular.h:81
Header file for the MAYBE_UNUSED function template.
Header file for the IsIdentity type trait.
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
Header file for all forward declarations of the math module.
Constraint on the data type.
Header file for the MaxSize type trait.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:2433
Constraint on the data type.
Header file for the IsMatrix type trait.
Header file for the IsSquare type trait.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:779
Constraint on the data type.
Header file for the LowType type trait.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
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
Header file for the If class template.
Header file for the IsShrinkable type trait.
Header file for the decllow trait.
void lu(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO1 > &L, DenseMatrix< MT3, SO1 > &U, Matrix< MT4, SO2 > &P)
LU decomposition of the given dense matrix.
Definition: LU.h:222
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
DiagonalMatrix specialization for dense matrices.
Header file for the IsLower type trait.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Header file for the IsAligned type trait.
Header file for the IsUniTriangular type trait.
Header file for the Kron product trait.
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type,...
Definition: Upper.h:81
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
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:438
Header file for the RemoveAdaptor type trait.
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
Header file for the IsPadded type trait.
Header file for the IsAdaptor type trait.
decltype(auto) band(Matrix< MT, SO > &matrix, RBAs... args)
Creating a view on a specific band of the given matrix.
Definition: Band.h:137
Constraint on the data type.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
Header file for the declupp trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type,...
Definition: Symmetric.h:79
Header file for run time assertion macros.
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
Constraint on the data type.
Header file for the IsContiguous type trait.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
Header file for the IsZero type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type,...
Definition: Lower.h:81
Header file for the declsym trait.
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:282
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
#define BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a BLAS compatible data type (i....
Definition: BLASCompatible.h:61
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
Header file for the implementation of the base template of the DiagonalMatrix.
Header file for the YieldsDiagonal type trait.
Header file for the IsBuiltin type trait.
Header file for the isDivisor shim.
Header file for the StorageOrder type trait.
Header file for the IntegralConstant class template.
Header file for the map trait.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type,...
Definition: Hermitian.h:79
Matrix adapter for diagonal matrices.
Definition: BaseTemplate.h:560
Header file for the IsUpper type trait.
constexpr bool IsDiagonal_v
Auxiliary variable template for the IsDiagonal type trait.The IsDiagonal_v variable template provides...
Definition: IsDiagonal.h:148
Header file for the IsHermitian type trait.
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Header file for the Size type trait.
InversionFlag
Inversion flag.The InversionFlag type enumeration represents the different types of matrix inversion ...
Definition: InversionFlag.h:101
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
DiagonalMatrix specialization for sparse matrices.
Header file for the HighType type trait.