35#ifndef _BLAZE_MATH_ADAPTORS_UPPERMATRIX_H_
36#define _BLAZE_MATH_ADAPTORS_UPPERMATRIX_H_
125template< RelaxationFlag RF,
typename MT,
bool SO,
bool DF >
128template<
typename MT,
bool SO,
bool DF >
131template<
typename MT,
bool SO,
bool DF >
172 return m.rows() == 0UL;
295template<
typename MT1,
bool SO1,
typename MT2,
typename MT3,
typename MT4,
bool SO2 >
314 const size_t n( (*A).rows() );
316 decltype(
auto) L2( derestrict( *L ) );
326 for(
size_t i=0UL; i<n; ++i ) {
400 return ( m == 0UL ) ||
431 return trySet( mat, i, j, value );
462 return trySet( mat,
row,
column, m, n, value );
490 return trySet( mat, i, j, value );
521 return trySet( mat,
row,
column, m, n, value );
549 return trySet( mat, i, j, value );
580 return trySet( mat,
row,
column, m, n, value );
608 return tryAdd( mat, i, j, value );
639 return tryAdd( mat,
row,
column, m, n, value );
678 for(
size_t i=ibegin; i<(*rhs).size(); ++i ) {
723 const size_t iend(
min(
row -
column, (*rhs).size() ) );
725 for(
size_t i=0UL; i<iend; ++i ) {
772 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
815 const auto last( (*rhs).end() );
818 for( ; element!=last; ++element ) {
863 const auto last( (*rhs).lowerBound(
row -
column ) );
865 for(
auto element=(*rhs).begin(); element!=last; ++element ) {
912 for(
const auto& element : *rhs ) {
940template<
typename MT1
956 const size_t M( (*rhs).rows() );
957 const size_t N( (*rhs).columns() );
964 for(
size_t i=ibegin; i<M; ++i )
968 for(
size_t j=0UL; j<jend; ++j ) {
996template<
typename MT1
1012 const size_t M( (*rhs).rows() );
1013 const size_t N( (*rhs).columns() );
1020 for(
size_t j=0UL; j<jend; ++j )
1022 const bool containsDiagonal(
column + j >=
row );
1023 const size_t ibegin( ( containsDiagonal )?(
column + j -
row + 1UL ):( 0UL ) );
1025 for(
size_t i=ibegin; i<M; ++i ) {
1053template<
typename MT1
1069 const size_t M( (*rhs).rows() );
1070 const size_t N( (*rhs).columns() );
1077 for(
size_t i=ibegin; i<M; ++i )
1080 const auto last( (*rhs).lowerBound( i,
min( index, N ) ) );
1082 for(
auto element=(*rhs).begin(i); element!=last; ++element ) {
1110template<
typename MT1
1126 const size_t M( (*rhs).rows() );
1127 const size_t N( (*rhs).columns() );
1134 for(
size_t j=0UL; j<jend; ++j )
1136 const bool containsDiagonal(
column + j >=
row );
1137 const size_t index( ( containsDiagonal )?(
column + j -
row + 1UL ):( 0UL ) );
1139 const auto last( (*rhs).end(j) );
1140 auto element( (*rhs).lowerBound( index, j ) );
1142 for( ; element!=last; ++element ) {
1170template<
typename MT
1178 return tryAssign( lhs, *rhs,
row,
column );
1202template<
typename MT
1232template<
typename MT1
1240 return tryAssign( lhs, *rhs,
row,
column );
1262template<
typename MT
1270 return tryAssign( lhs, *rhs,
row,
column );
1294template<
typename MT
1324template<
typename MT1
1332 return tryAssign( lhs, *rhs,
row,
column );
1354template<
typename MT
1362 return tryAssign( lhs, *rhs,
row,
column );
1385template<
typename MT
1415template<
typename MT1
1423 return tryAssign( lhs, *rhs,
row,
column );
1445template<
typename MT
1453 return tryAssign( lhs, *rhs,
row,
column );
1476template<
typename MT
1506template<
typename MT1
1514 return tryAssign( lhs, *rhs,
row,
column );
1534template<
typename MT
1555template<
typename MT,
bool SO,
bool DF >
1557 :
public Size<MT,0UL>
1560template<
typename MT,
bool SO,
bool DF >
1562 :
public Size<MT,1UL>
1578template<
typename MT,
bool SO,
bool DF >
1583template<
typename MT,
bool SO,
bool DF >
1601template<
typename MT,
bool SO,
bool DF >
1619template<
typename MT,
bool SO,
bool DF >
1637template<
typename MT,
bool SO,
bool DF >
1655template<
typename MT,
bool SO,
bool DF >
1673template<
typename MT,
bool SO,
bool DF >
1691template<
typename MT,
bool SO,
bool DF >
1709template<
typename MT,
bool SO,
bool DF >
1727template<
typename MT,
bool SO,
bool DF >
1745template<
typename MT,
bool SO,
bool DF >
1763template<
typename MT,
bool SO >
1781template<
typename MT,
bool SO,
bool DF >
1799template<
typename MT,
bool SO,
bool DF >
1817template<
typename MT,
bool SO,
bool DF >
1835template<
typename MT,
bool SO,
bool DF >
1854template<
typename T1,
typename T2 >
1855struct AddTraitEval1< T1, T2
1883template<
typename T1,
typename T2 >
1884struct SubTraitEval1< T1, T2
1912template<
typename T1,
typename T2 >
1913struct SchurTraitEval1< T1, T2
1939template<
typename T1,
typename T2 >
1940struct MultTraitEval1< T1, T2
1949template<
typename T1,
typename T2 >
1950struct MultTraitEval1< T1, T2
1959template<
typename T1,
typename T2 >
1960struct MultTraitEval1< T1, T2
1987template<
typename T1,
typename T2 >
1988struct KronTraitEval1< T1, T2
2013template<
typename T1,
typename T2 >
2014struct DivTraitEval1< T1, T2
2036template<
typename T,
typename OP >
2037struct UnaryMapTraitEval1< T, OP
2051template<
typename T1,
typename T2,
typename OP >
2052struct BinaryMapTraitEval1< T1, T2, OP
2074template<
typename MT,
bool SO,
bool DF >
2077 using Type = DiagonalMatrix<MT,SO,DF>;
2093template<
typename MT,
bool SO,
bool DF >
2096 using Type = HermitianMatrix<MT,SO,DF>;
2112template<
typename MT,
bool SO,
bool DF >
2115 using Type = DiagonalMatrix<MT,SO,DF>;
2131template<
typename MT,
bool SO,
bool DF >
2134 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
2150template<
typename MT,
bool SO,
bool DF >
2153 using Type = ZeroMatrix< ElementType_t<MT>, SO >;
2169template<
typename MT,
bool SO,
bool DF >
2172 using Type = UpperMatrix<MT,SO,DF>;
2188template<
typename MT,
bool SO,
bool DF >
2191 using Type = UniUpperMatrix<MT,SO,DF>;
2207template<
typename MT,
bool SO,
bool DF >
2210 using Type = StrictlyUpperMatrix<MT,SO,DF>;
2226template<
typename MT,
bool SO,
bool DF >
2229 using Type = DiagonalMatrix<MT,SO,DF>;
2245template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
2248 using Type = UpperMatrix< typename HighType<MT1,MT2>::Type >;
2264template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
2267 using Type = UpperMatrix< typename LowType<MT1,MT2>::Type >;
2283template<
typename MT,
size_t I,
size_t N >
2284struct SubmatrixTraitEval1< MT, I, I, N, N
Header file for the addition trait.
Header file for auxiliary alias declarations.
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition Aliases.h:190
Header file for run time assertion macros.
Constraint on the data type.
Header file for the decldiag trait.
Header file for the declherm trait.
Header file for the decllow trait.
Header file for the declstrlow trait.
Header file for the declstrupp trait.
Header file for the declsym trait.
Header file for the declunilow trait.
Header file for the decluniupp trait.
Header file for the declupp trait.
Header file for the division trait.
Header file for the EnableIf class template.
Header file for the HasConstDataAccess type trait.
Constraint on the data type.
Header file for the HighType type trait.
Header file for the IntegralConstant class template.
Header file for the dense matrix inversion flags.
Header file for the IsAdaptor type trait.
Header file for the IsAligned type trait.
Header file for the IsContiguous type trait.
Header file for the isDefault shim.
Header file for the IsDiagonal type trait.
Header file for the isDivisor shim.
Header file for the IsHermitian type trait.
Header file for the IsIdentity type trait.
Header file for the IsLower type trait.
Header file for the IsMatrix type trait.
Header file for the IsPadded type trait.
Header file for the IsRestricted type trait.
Header file for the IsScalar type trait.
Header file for the IsSquare type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Header file for the IsUniUpper type trait.
Header file for the IsUpper type trait.
Header file for the Kron product trait.
Header file for the LowType type trait.
Constraint on the data type.
Header file for the map trait.
Header file for the MaxSize type trait.
Header file for the MAYBE_UNUSED function template.
Header file for the multiplication trait.
Header file for the relaxation flag enumeration.
Header file for the RemoveAdaptor type trait.
Header file for the Schur product trait.
Header file for the subtraction trait.
Header file for the submatrix trait.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the YieldsDiagonal type trait.
Header file for the YieldsStrictlyUpper type trait.
Header file for the YieldsUniUpper type trait.
Header file for the YieldsUpper type trait.
Header file for the implementation of the base template of the UpperMatrix.
UpperMatrix specialization for dense matrices.
UpperMatrix specialization for sparse matrices.
Base class for dense matrices.
Definition DenseMatrix.h:82
Base class for N-dimensional dense vectors.
Definition DenseVector.h:77
Base class for matrices.
Definition Matrix.h:85
Base class for sparse matrices.
Definition SparseMatrix.h:77
Base class for sparse vectors.
Definition SparseVector.h:72
Matrix adapter for upper triangular matrices.
Definition BaseTemplate.h:558
Base class for N-dimensional vectors.
Definition Vector.h:82
Constraint on the data type.
decltype(auto) band(Matrix< MT, SO > &matrix, RBAs... args)
Creating a view on a specific band of the given matrix.
Definition Band.h:140
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition Column.h:137
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
bool isStrictlyLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly lower triangular matrix.
Definition DenseMatrix.h:2096
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition DMatDMatMapExpr.h:1339
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an identity matrix.
Definition DenseMatrix.h:2561
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition DiagonalMatrix.h:207
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition DiagonalMatrix.h:225
bool isDefault(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the given diagonal matrix is in default state.
Definition DiagonalMatrix.h:169
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition HermitianProxy.h:693
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE(T)
Constraint on the data type.
Definition BLASCompatible.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.
Definition Hermitian.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.
Definition Upper.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.
Definition Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.
Definition UniTriangular.h:81
constexpr bool IsStrictlyUpper_v
Auxiliary variable template for the IsStrictlyUpper type trait.
Definition IsStrictlyUpper.h:173
constexpr bool YieldsUpper_v
Auxiliary variable template for the YieldsUpper type trait.
Definition YieldsUpper.h:126
constexpr bool IsScalar_v
Auxiliary variable template for the IsScalar type trait.
Definition IsScalar.h:104
constexpr bool IsUniUpper_v
Auxiliary variable template for the IsUniUpper type trait.
Definition IsUniUpper.h:173
constexpr bool IsUniform_v
Auxiliary variable template for the IsUniform type trait.
Definition IsUniform.h:164
constexpr bool IsUpper_v
Auxiliary variable template for the IsUpper type trait.
Definition IsUpper.h:175
constexpr bool YieldsDiagonal_v
Auxiliary variable template for the YieldsDiagonal type trait.
Definition YieldsDiagonal.h:126
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.
Definition Size.h:176
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition Size.h:72
constexpr bool IsDiagonal_v
Auxiliary variable template for the IsDiagonal type trait.
Definition IsDiagonal.h:148
constexpr bool StorageOrder_v
Auxiliary variable template for the StorageOrder type trait.
Definition StorageOrder.h:93
constexpr bool IsZero_v
Auxiliary variable template for the IsZero type trait.
Definition IsZero.h:166
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.
Definition IsMatrix.h:124
constexpr bool IsIdentity_v
Auxiliary variable template for the IsIdentity type trait.
Definition IsIdentity.h:137
constexpr bool YieldsStrictlyUpper_v
Auxiliary variable template for the YieldsStrictlyUpper type trait.
Definition YieldsStrictlyUpper.h:124
constexpr bool YieldsUniUpper_v
Auxiliary variable template for the YieldsUniUpper type trait.
Definition YieldsUniUpper.h:124
constexpr bool IsLower_v
Auxiliary variable template for the IsLower type trait.
Definition IsLower.h:175
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition RelaxationFlag.h:66
constexpr Infinity inf
Global Infinity instance.
Definition Infinity.h:1080
InversionFlag
Inversion flag.
Definition InversionFlag.h:102
@ asUniLower
Flag for the inversion of a lower unitriangular matrix.
Definition InversionFlag.h:112
@ asUpper
Flag for the inversion of a upper triangular matrix.
Definition InversionFlag.h:113
@ asUniUpper
Flag for the inversion of a upper unitriangular matrix.
Definition InversionFlag.h:114
@ asDiagonal
Flag for the inversion of a diagonal matrix.
Definition InversionFlag.h:115
@ byLU
Flag for the LU-based matrix inversion.
Definition InversionFlag.h:103
@ asGeneral
Flag for the inversion of a general matrix (same as byLU).
Definition InversionFlag.h:108
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition Matrix.h:806
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition Matrix.h:1108
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition Row.h:137
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition Assert.h:101
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition Inline.h:85
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition MaybeUnused.h:81
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:138
BoolConstant< true > TrueType
Type traits base class.
Definition IntegralConstant.h:132
Header file for the exception macros of the math module.
Header file for all forward declarations of the math module.
Header file for the Size type trait.
Header file for the StorageOrder type trait.
Base template for the DeclDiagTrait class.
Definition DeclDiagTrait.h:127
Base template for the DeclHermTrait class.
Definition DeclHermTrait.h:126
Base template for the DeclLowTrait class.
Definition DeclLowTrait.h:126
Base template for the DeclStrLowTrait class.
Definition DeclStrLowTrait.h:128
Base template for the DeclStrUppTrait class.
Definition DeclStrUppTrait.h:128
Base template for the DeclSymTrait class.
Definition DeclSymTrait.h:126
Base template for the DeclUniLowTrait class.
Definition DeclUniLowTrait.h:128
Base template for the DeclUniUppTrait class.
Definition DeclUniUppTrait.h:128
Base template for the DeclUppTrait class.
Definition DeclUppTrait.h:126
Compile time check for low-level access to constant data.
Definition HasConstDataAccess.h:76
Base template for the HighType type trait.
Definition HighType.h:322
Compile time check for adaptors.
Definition IsAdaptor.h:89
Compile time check for the alignment of data types.
Definition IsAligned.h:88
Compile time check for the memory layout of data types.
Definition IsContiguous.h:87
Compile time check for Hermitian matrices.
Definition IsHermitian.h:115
Compile time check for data types with padding.
Definition IsPadded.h:77
Compile time check for data types with restricted data access.
Definition IsRestricted.h:83
Compile time check for square matrices.
Definition IsSquare.h:89
Compile time check for strictly lower triangular matrices.
Definition IsStrictlyLower.h:116
Compile time check for strictly upper triangular matrices.
Definition IsStrictlyUpper.h:116
Compile time check for symmetric matrices.
Definition IsSymmetric.h:115
Compile time check for upper triangular matrices.
Definition IsUpper.h:118
Compile time check for zero vectors or matrices.
Definition IsZero.h:109
Base template for the LowType type trait.
Definition LowType.h:322
Compile time evaluation of the maximum size of vectors and matrices.
Definition MaxSize.h:118
Removal of top level adaptor types.
Definition RemoveAdaptor.h:77
Compile time evaluation of the size of vectors and matrices.
Definition Size.h:119
Header file for the IsZero type trait.
Header file for the generic min algorithm.