35#ifndef _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_H_
36#define _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_H_
117template< RelaxationFlag RF,
typename MT,
bool SO,
bool DF >
120template<
typename MT,
bool SO,
bool DF >
123template<
typename MT,
bool SO,
bool DF >
162 return m.rows() == 0UL;
283template<
typename MT1,
bool SO1,
typename MT2,
typename MT3,
typename MT4,
bool SO2 >
302 const size_t n( (*A).rows() );
304 decltype(
auto) U2( derestrict( *U ) );
314 for(
size_t i=0UL; i<n; ++i ) {
351 ( i == j &&
isOne( value ) ) ||
390 return ( m == 0UL ) ||
465 return ( m == 0UL ) ||
496 return tryAdd( mat, i, j, value );
527 return tryAdd( mat,
row,
column, m, n, value );
560 return ( i != j ||
isOne( value ) );
598 return ( m == 0UL ) ||
630 return tryMult( mat, i, j, value );
661 return tryMult( mat,
row,
column, m, n, value );
730 return ( m == 0UL ) ||
805 return ( m == 0UL ) ||
837 return trySet( mat, i, j, value );
868 return trySet( mat,
row,
column, m, n, value );
896 return tryAdd( mat, i, j, value );
927 return tryAdd( mat,
row,
column, m, n, value );
967 const bool containsDiagonal(
column <
row + (*rhs).size() );
968 const size_t iend(
min(
column -
row, (*rhs).size() ) );
970 for(
size_t i=0UL; i<iend; ++i ) {
975 if( containsDiagonal && !
isOne( (*rhs)[iend] ) )
1000template<
typename MT
1018 const bool containsDiagonal(
row >=
column );
1019 const size_t ibegin( ( !containsDiagonal )?( 0UL ):(
row -
column + 1UL ) );
1024 for(
size_t i=ibegin; i<(*rhs).size(); ++i ) {
1053template<
typename MT
1071 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
1072 if( !
isOne( (*rhs)[i] ) )
1076 else if(
band > 0L ) {
1077 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
1105template<
typename MT
1123 const bool containsDiagonal(
column <
row + (*rhs).size() );
1125 const auto last( (*rhs).lowerBound( index ) );
1127 if( containsDiagonal ) {
1128 if( last == (*rhs).end() || last->index() != index || !
isOne( last->value() ) )
1132 for(
auto element=(*rhs).begin(); element!=last; ++element ) {
1159template<
typename MT
1177 const bool containsDiagonal(
row >=
column );
1178 const size_t index( ( containsDiagonal )?(
row -
column ):( 0UL ) );
1179 const auto last( (*rhs).end() );
1180 auto element( (*rhs).lowerBound( index ) );
1182 if( containsDiagonal ) {
1183 if( element == last || element->index() != index || !
isOne( element->value() ) )
1188 for( ; element!=last; ++element ) {
1217template<
typename MT
1235 if( (*rhs).nonZeros() != (*rhs).size() )
1237 for(
const auto& element : *rhs ) {
1238 if( !
isOne( element.value() ) )
1242 else if(
band > 0L ) {
1243 for(
const auto& element : *rhs ) {
1271template<
typename MT1
1287 const size_t M( (*rhs).rows() );
1288 const size_t N( (*rhs).columns() );
1295 for(
size_t i=0UL; i<iend; ++i )
1297 const bool containsDiagonal(
row + i >=
column );
1302 const size_t jbegin( ( containsDiagonal )?(
row + i -
column + 1UL ):( 0UL ) );
1304 for(
size_t j=jbegin; j<N; ++j ) {
1332template<
typename MT1
1348 const size_t M( (*rhs).rows() );
1349 const size_t N( (*rhs).columns() );
1356 for(
size_t j=jbegin; j<N; ++j )
1360 for(
size_t i=0UL; i<iend; ++i ) {
1365 const bool containsDiagonal(
column + j <
row + M );
1367 if( containsDiagonal && !
isOne( (*rhs)(iend,j) ) )
1393template<
typename MT1
1409 const size_t M( (*rhs).rows() );
1410 const size_t N( (*rhs).columns() );
1417 for(
size_t i=0UL; i<iend; ++i )
1419 const bool containsDiagonal(
row + i >=
column );
1420 const size_t index( ( containsDiagonal )?(
row + i -
column ):( 0UL ) );
1422 const auto last( (*rhs).end(i) );
1423 auto element( (*rhs).lowerBound( i, index ) );
1425 if( containsDiagonal ) {
1426 if( element == last || ( element->index() != index ) || !
isOne( element->value() ) )
1431 for( ; element!=last; ++element ) {
1459template<
typename MT1
1475 const size_t M( (*rhs).rows() );
1476 const size_t N( (*rhs).columns() );
1483 for(
size_t j=jbegin; j<N; ++j )
1485 const bool containsDiagonal(
column + j <
row + M );
1488 const auto last( (*rhs).lowerBound(
min( index, M ), j ) );
1490 if( containsDiagonal ) {
1491 if( last == (*rhs).end(j) || ( last->index() != index ) || !
isOne( last->value() ) )
1495 for(
auto element=(*rhs).begin(j); element!=last; ++element ) {
1524template<
typename MT
1542 const size_t iend(
min(
column -
row + 1UL, (*rhs).size() ) );
1544 for(
size_t i=0UL; i<iend; ++i ) {
1572template<
typename MT
1589 for(
size_t i=ibegin; i<(*rhs).size(); ++i ) {
1617template<
typename MT
1635 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
1664template<
typename MT
1682 const auto last( (*rhs).lowerBound(
column -
row + 1UL ) );
1684 for(
auto element=(*rhs).begin(); element!=last; ++element ) {
1712template<
typename MT
1727 const auto last( (*rhs).end() );
1730 for( ; element!=last; ++element ) {
1758template<
typename MT
1776 for(
const auto& element : *rhs ) {
1805template<
typename MT1
1821 const size_t M( (*rhs).rows() );
1822 const size_t N( (*rhs).columns() );
1829 for(
size_t i=0UL; i<iend; ++i )
1831 const bool containsDiagonal(
row + i >=
column );
1832 const size_t jbegin( ( containsDiagonal )?(
row + i -
column ):( 0UL ) );
1834 for(
size_t j=jbegin; j<N; ++j ) {
1863template<
typename MT1
1879 const size_t M( (*rhs).rows() );
1880 const size_t N( (*rhs).columns() );
1887 for(
size_t j=jbegin; j<N; ++j )
1891 for(
size_t i=0UL; i<iend; ++i ) {
1920template<
typename MT1
1936 const size_t M( (*rhs).rows() );
1937 const size_t N( (*rhs).columns() );
1944 for(
size_t i=0UL; i<iend; ++i )
1946 const bool containsDiagonal(
row + i >=
column );
1947 const size_t index( ( containsDiagonal )?(
row + i -
column ):( 0UL ) );
1949 const auto last( (*rhs).end(i) );
1950 auto element( (*rhs).lowerBound( i, index ) );
1952 for( ; element!=last; ++element ) {
1981template<
typename MT1
1997 const size_t M( (*rhs).rows() );
1998 const size_t N( (*rhs).columns() );
2005 for(
size_t j=jbegin; j<N; ++j )
2007 const size_t index(
column + j -
row + 1UL );
2008 const auto last( (*rhs).lowerBound(
min( index, M ), j ) );
2010 for(
auto element=(*rhs).begin(j); element!=last; ++element ) {
2039template<
typename MT
2047 return tryAddAssign( lhs, *rhs,
row,
column );
2071template<
typename MT
2102template<
typename MT1
2110 return tryAddAssign( lhs, *rhs,
row,
column );
2133template<
typename MT
2173template<
typename MT
2213template<
typename MT
2231 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
2232 if( !
isOne( (*rhs)[i] ) )
2260template<
typename MT
2278 if( (*rhs).nonZeros() != (*rhs).size() )
2280 for(
const auto& element : *rhs ) {
2281 if( !
isOne( element.value() ) )
2309template<
typename MT1
2326 const size_t M( (*rhs).rows() );
2327 const size_t N( (*rhs).columns() );
2335 for( ; i<M && j<N; ++i, ++j )
2337 if( !
isOne( (*rhs)(i,j) ) )
2363template<
typename MT
2371 return tryMultAssign( lhs, *rhs,
row,
column );
2394template<
typename MT
2424template<
typename MT
2463template<
typename MT
2503template<
typename MT
2521 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
2550template<
typename MT
2568 if( (*rhs).nonZeros() != (*rhs).size() )
2570 for(
const auto& element : *rhs ) {
2598template<
typename MT1
2615 const size_t M( (*rhs).rows() );
2616 const size_t N( (*rhs).columns() );
2624 for( ; i<M && j<N; ++i, ++j )
2653template<
typename MT
2693template<
typename MT
2733template<
typename MT
2751 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
2780template<
typename MT
2798 if( (*rhs).nonZeros() != (*rhs).size() )
2800 for(
const auto& element : *rhs ) {
2829template<
typename MT1
2846 const size_t M( (*rhs).rows() );
2847 const size_t N( (*rhs).columns() );
2855 for( ; i<M && j<N; ++i, ++j )
2884template<
typename MT
2892 return tryAssign( lhs, *rhs,
row,
column );
2915template<
typename MT
2946template<
typename MT1
2954 return tryAssign( lhs, *rhs,
row,
column );
2977template<
typename MT
2985 return tryAddAssign( lhs, *rhs,
row,
column );
3008template<
typename MT
3039template<
typename MT1
3047 return tryAddAssign( lhs, *rhs,
row,
column );
3067template<
typename MT
3088template<
typename MT,
bool SO,
bool DF >
3090 :
public Size<MT,0UL>
3093template<
typename MT,
bool SO,
bool DF >
3095 :
public Size<MT,1UL>
3111template<
typename MT,
bool SO,
bool DF >
3116template<
typename MT,
bool SO,
bool DF >
3134template<
typename MT,
bool SO,
bool DF >
3152template<
typename MT,
bool SO,
bool DF >
3170template<
typename MT,
bool SO,
bool DF >
3188template<
typename MT,
bool SO,
bool DF >
3206template<
typename MT,
bool SO >
3224template<
typename MT,
bool SO,
bool DF >
3242template<
typename MT,
bool SO,
bool DF >
3260template<
typename MT,
bool SO,
bool DF >
3278template<
typename MT,
bool SO,
bool DF >
3297template<
typename T1,
typename T2 >
3298struct AddTraitEval1< T1, T2
3323template<
typename T1,
typename T2 >
3324struct SubTraitEval1< T1, T2
3347template<
typename T1,
typename T2 >
3348struct SchurTraitEval1< T1, T2
3371template<
typename T1,
typename T2 >
3372struct MultTraitEval1< T1, T2
3394template<
typename T1,
typename T2 >
3395struct KronTraitEval1< T1, T2
3418template<
typename T,
typename OP >
3419struct UnaryMapTraitEval1< T, OP
3431template<
typename T1,
typename T2,
typename OP >
3432struct BinaryMapTraitEval1< T1, T2, OP
3452template<
typename MT,
bool SO,
bool DF >
3455 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3471template<
typename MT,
bool SO,
bool DF >
3474 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3490template<
typename MT,
bool SO,
bool DF >
3493 using Type = UniLowerMatrix<MT,SO,DF>;
3509template<
typename MT,
bool SO,
bool DF >
3512 using Type = UniLowerMatrix<MT,SO,DF>;
3528template<
typename MT,
bool SO,
bool DF >
3531 using Type = INVALID_TYPE;
3547template<
typename MT,
bool SO,
bool DF >
3550 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3566template<
typename MT,
bool SO,
bool DF >
3569 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3585template<
typename MT,
bool SO,
bool DF >
3588 using Type = INVALID_TYPE;
3604template<
typename MT,
bool SO,
bool DF >
3607 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3623template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
3626 using Type = UniLowerMatrix< typename HighType<MT1,MT2>::Type >;
3642template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
3645 using Type = UniLowerMatrix< typename LowType<MT1,MT2>::Type >;
3661template<
typename MT,
size_t I,
size_t N >
3662struct 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 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.
Utility type for generic codes.
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 IsIdentity type trait.
Header file for the IsMatrix type trait.
Header file for the isOne shim.
Header file for the IsPadded type trait.
Header file for the IsRestricted 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 IsUniLower type trait.
Header file for the IsUniUpper 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 YieldsIdentity type trait.
Header file for the YieldsUniLower type trait.
Header file for the implementation of the base template of the UniLowerMatrix.
UniLowerMatrix specialization for dense matrices.
UniLowerMatrix 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 lower unitriangular matrices.
Definition BaseTemplate.h:582
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
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 YieldsIdentity_v
Auxiliary variable template for the YieldsIdentity type trait.
Definition YieldsIdentity.h:126
constexpr bool YieldsUniLower_v
Auxiliary variable template for the YieldsUniLower type trait.
Definition YieldsUniLower.h:124
constexpr bool IsUniUpper_v
Auxiliary variable template for the IsUniUpper type trait.
Definition IsUniUpper.h:173
constexpr bool IsStrictlyLower_v
Auxiliary variable template for the IsStrictlyLower type trait.
Definition IsStrictlyLower.h:173
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 IsUniLower_v
Auxiliary variable template for the IsUniLower type trait.
Definition IsUniLower.h:173
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition RelaxationFlag.h:66
constexpr Infinity inf
Global Infinity instance.
Definition Infinity.h:1080
bool isOne(const Proxy< PT, RT > &proxy)
Returns whether the represented element is 1.
Definition Proxy.h:2337
InversionFlag
Inversion flag.
Definition InversionFlag.h:102
@ asUniLower
Flag for the inversion of a lower unitriangular matrix.
Definition InversionFlag.h:112
@ asLower
Flag for the inversion of a lower triangular matrix.
Definition InversionFlag.h:111
@ 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 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 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 lower unitriangular matrices.
Definition IsUniLower.h:116
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.