35 #ifndef _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_SPARSE_H_
36 #define _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_SPARSE_H_
100 template<
typename MT
102 class UniLowerMatrix<MT,SO,false>
103 :
public SparseMatrix< UniLowerMatrix<MT,SO,false>, SO >
114 typedef UniLowerMatrix<MT,SO,false>
This;
129 template<
typename ET >
132 typedef UniLowerMatrix< typename MT::template Rebind<ET>::Other > Other;
145 template<
typename T >
146 struct BuiltinType {
typedef INVALID_TYPE Type; };
152 template<
typename T >
153 struct ComplexType {
typedef typename T::value_type Type; };
159 typedef typename If< IsComplex<ElementType>
160 , ComplexType<ElementType>
161 , BuiltinType<ElementType> >::Type::Type ValueType;
163 typedef ValueType value_type;
172 inline UniLowerValue( ElementType& value,
bool diagonal )
174 , diagonal_( diagonal )
185 inline UniLowerValue& operator=(
const UniLowerValue& uv ) {
187 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
200 template<
typename T >
inline UniLowerValue& operator=(
const T& v ) {
202 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
215 template<
typename T >
inline UniLowerValue& operator+=(
const T& v ) {
217 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
230 template<
typename T >
inline UniLowerValue& operator-=(
const T& v ) {
232 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
245 template<
typename T >
inline UniLowerValue& operator*=(
const T& v ) {
247 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
260 template<
typename T >
inline UniLowerValue& operator/=(
const T& v ) {
262 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
286 inline ValueType
real()
const {
287 return value_->real();
301 inline void real( ValueType value )
const {
303 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
304 value_->real( value );
316 inline ValueType imag()
const {
317 return value_->imag();
331 inline void imag( ValueType value )
const {
333 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
334 value_->imag( value );
349 class UniLowerElement :
private SparseElement
358 typedef UniLowerValue ValueType;
359 typedef size_t IndexType;
362 typedef UniLowerElement* Pointer;
371 inline UniLowerElement( IteratorType pos,
bool diagonal )
373 , diagonal_( diagonal )
384 template<
typename T >
inline UniLowerElement& operator=(
const T& v ) {
386 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
399 template<
typename T >
inline UniLowerElement& operator+=(
const T& v ) {
401 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
414 template<
typename T >
inline UniLowerElement& operator-=(
const T& v ) {
416 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
429 template<
typename T >
inline UniLowerElement& operator*=(
const T& v ) {
431 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
444 template<
typename T >
inline UniLowerElement& operator/=(
const T& v ) {
446 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
457 inline Pointer operator->() {
467 inline Reference value()
const {
468 return Reference( pos_->value(), diagonal_ );
477 inline IndexType index()
const {
478 return pos_->index();
499 typedef std::forward_iterator_tag IteratorCategory;
500 typedef UniLowerElement ValueType;
501 typedef ValueType PointerType;
502 typedef ValueType ReferenceType;
503 typedef ptrdiff_t DifferenceType;
506 typedef IteratorCategory iterator_category;
507 typedef ValueType value_type;
508 typedef PointerType pointer;
509 typedef ReferenceType reference;
510 typedef DifferenceType difference_type;
528 inline Iterator( IteratorType pos,
size_t index )
550 inline const Iterator operator++(
int ) {
563 return ReferenceType( pos_, pos_->index() == index_ );
572 inline PointerType operator->()
const {
573 return PointerType( pos_, pos_->index() == index_ );
594 return pos_ == rhs.pos_;
605 return !( *
this == rhs );
616 return pos_ - rhs.pos_;
625 inline IteratorType base()
const {
640 enum { smpAssignable = 0 };
646 explicit inline UniLowerMatrix();
647 explicit inline UniLowerMatrix(
size_t n );
648 explicit inline UniLowerMatrix(
size_t n,
size_t nonzeros );
649 explicit inline UniLowerMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
651 inline UniLowerMatrix(
const UniLowerMatrix& m );
652 template<
typename MT2,
bool SO2 >
inline UniLowerMatrix(
const Matrix<MT2,SO2>& m );
663 inline Reference operator()(
size_t i,
size_t j );
664 inline ConstReference operator()(
size_t i,
size_t j )
const;
666 inline ConstIterator
begin (
size_t i )
const;
667 inline ConstIterator
cbegin(
size_t i )
const;
669 inline ConstIterator
end (
size_t i )
const;
670 inline ConstIterator
cend (
size_t i )
const;
677 inline UniLowerMatrix& operator=(
const UniLowerMatrix& rhs );
679 template<
typename MT2,
bool SO2 >
680 inline typename DisableIf< IsComputation<MT2>, UniLowerMatrix& >::Type
681 operator=(
const Matrix<MT2,SO2>& rhs );
683 template<
typename MT2,
bool SO2 >
684 inline typename EnableIf< IsComputation<MT2>, UniLowerMatrix& >::Type
685 operator=(
const Matrix<MT2,SO2>& rhs );
687 template<
typename MT2,
bool SO2 >
688 inline typename DisableIf< IsComputation<MT2>, UniLowerMatrix& >::Type
689 operator+=(
const Matrix<MT2,SO2>& rhs );
691 template<
typename MT2,
bool SO2 >
692 inline typename EnableIf< IsComputation<MT2>, UniLowerMatrix& >::Type
693 operator+=(
const Matrix<MT2,SO2>& rhs );
695 template<
typename MT2,
bool SO2 >
696 inline typename DisableIf< IsComputation<MT2>, UniLowerMatrix& >::Type
697 operator-=(
const Matrix<MT2,SO2>& rhs );
699 template<
typename MT2,
bool SO2 >
700 inline typename EnableIf< IsComputation<MT2>, UniLowerMatrix& >::Type
701 operator-=(
const Matrix<MT2,SO2>& rhs );
703 template<
typename MT2,
bool SO2 >
704 inline UniLowerMatrix& operator*=(
const Matrix<MT2,SO2>& rhs );
711 inline size_t rows()
const;
714 inline size_t capacity(
size_t i )
const;
716 inline size_t nonZeros(
size_t i )
const;
718 inline void reset(
size_t i );
720 inline Iterator set(
size_t i,
size_t j,
const ElementType& value );
721 inline Iterator insert(
size_t i,
size_t j,
const ElementType& value );
722 inline void erase(
size_t i,
size_t j );
725 inline void resize (
size_t n,
bool preserve=
true );
726 inline void reserve(
size_t nonzeros );
727 inline void reserve(
size_t i,
size_t nonzeros );
729 inline void trim(
size_t i );
730 inline void swap( UniLowerMatrix& m ) ;
732 static inline size_t maxNonZeros();
733 static inline size_t maxNonZeros(
size_t n );
740 inline Iterator find (
size_t i,
size_t j );
741 inline ConstIterator find (
size_t i,
size_t j )
const;
742 inline Iterator lowerBound(
size_t i,
size_t j );
743 inline ConstIterator lowerBound(
size_t i,
size_t j )
const;
744 inline Iterator upperBound(
size_t i,
size_t j );
745 inline ConstIterator upperBound(
size_t i,
size_t j )
const;
752 inline void append (
size_t i,
size_t j,
const ElementType& value,
bool check=
false );
753 inline void finalize(
size_t i );
760 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
761 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
763 inline bool canSMPAssign()
const;
771 inline void resetUpper();
783 template<
typename MT2,
bool SO2,
bool DF2 >
784 friend MT2& derestrict( UniLowerMatrix<MT2,SO2,DF2>& m );
819 template<
typename MT
821 inline UniLowerMatrix<MT,SO,false>::UniLowerMatrix()
838 template<
typename MT
840 inline UniLowerMatrix<MT,SO,false>::UniLowerMatrix(
size_t n )
845 for(
size_t i=0UL; i<n; ++i ) {
847 matrix_.finalize( i );
866 template<
typename MT
868 inline UniLowerMatrix<MT,SO,false>::UniLowerMatrix(
size_t n,
size_t nonzeros )
869 : matrix_( n, n,
max( nonzeros, n ) )
873 for(
size_t i=0UL; i<n; ++i ) {
875 matrix_.finalize( i );
898 template<
typename MT
900 inline UniLowerMatrix<MT,SO,false>::UniLowerMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
901 : matrix_( n, n, nonzeros )
905 for(
size_t i=0UL; i<n; ++i )
907 if( nonzeros[i] == 0UL )
908 throw std::invalid_argument(
"Invalid capacity specification" );
911 matrix_.finalize( i );
926 template<
typename MT
928 inline UniLowerMatrix<MT,SO,false>::UniLowerMatrix(
const UniLowerMatrix& m )
929 : matrix_( m.matrix_ )
947 template<
typename MT
949 template<
typename MT2
951 inline UniLowerMatrix<MT,SO,false>::UniLowerMatrix(
const Matrix<MT2,SO2>& m )
954 if( !IsUniLower<MT2>::value && !
isUniLower( matrix_ ) )
955 throw std::invalid_argument(
"Invalid setup of unilower matrix" );
957 if( !IsUniLower<MT2>::value )
986 template<
typename MT
989 UniLowerMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
1012 template<
typename MT
1015 UniLowerMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
const
1020 return matrix_(i,j);
1038 template<
typename MT
1043 return Iterator( matrix_.begin(i), i );
1061 template<
typename MT
1066 return matrix_.begin(i);
1084 template<
typename MT
1089 return matrix_.cbegin(i);
1107 template<
typename MT
1112 return Iterator( matrix_.end(i), i );
1130 template<
typename MT
1135 return matrix_.end(i);
1153 template<
typename MT
1158 return matrix_.cend(i);
1182 template<
typename MT
1184 inline UniLowerMatrix<MT,SO,false>&
1185 UniLowerMatrix<MT,SO,false>::operator=(
const UniLowerMatrix& rhs )
1187 matrix_ = rhs.matrix_;
1208 template<
typename MT
1210 template<
typename MT2
1212 inline typename DisableIf< IsComputation<MT2>, UniLowerMatrix<MT,SO,false>& >::Type
1213 UniLowerMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1215 if( IsStrictlyTriangular<MT2>::value || ( !IsUniLower<MT2>::value && !
isUniLower( ~rhs ) ) )
1216 throw std::invalid_argument(
"Invalid assignment to unilower matrix" );
1220 if( !IsUniLower<MT2>::value )
1242 template<
typename MT
1244 template<
typename MT2
1246 inline typename EnableIf< IsComputation<MT2>, UniLowerMatrix<MT,SO,false>& >::Type
1247 UniLowerMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1249 if( IsStrictlyTriangular<MT2>::value || ( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) )
1250 throw std::invalid_argument(
"Invalid assignment to unilower matrix" );
1252 if( IsUniLower<MT2>::value ) {
1259 throw std::invalid_argument(
"Invalid assignment to unilower matrix" );
1261 move( matrix_, tmp );
1264 if( !IsUniLower<MT2>::value )
1286 template<
typename MT
1288 template<
typename MT2
1290 inline typename DisableIf< IsComputation<MT2>, UniLowerMatrix<MT,SO,false>& >::Type
1291 UniLowerMatrix<MT,SO,false>::operator+=(
const Matrix<MT2,SO2>& rhs )
1293 if( IsUpper<MT2>::value || IsUniTriangular<MT2>::value ||
1295 throw std::invalid_argument(
"Invalid assignment to unilower matrix" );
1299 if( !IsStrictlyLower<MT2>::value )
1321 template<
typename MT
1323 template<
typename MT2
1325 inline typename EnableIf< IsComputation<MT2>, UniLowerMatrix<MT,SO,false>& >::Type
1326 UniLowerMatrix<MT,SO,false>::operator+=(
const Matrix<MT2,SO2>& rhs )
1328 if( IsUpper<MT2>::value || IsUniTriangular<MT2>::value ||
1329 ( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) )
1330 throw std::invalid_argument(
"Invalid assignment to unilower matrix" );
1332 if( IsStrictlyLower<MT2>::value ) {
1339 throw std::invalid_argument(
"Invalid assignment to unilower matrix" );
1344 if( !IsStrictlyLower<MT2>::value )
1366 template<
typename MT
1368 template<
typename MT2
1370 inline typename DisableIf< IsComputation<MT2>, UniLowerMatrix<MT,SO,false>& >::Type
1371 UniLowerMatrix<MT,SO,false>::operator-=(
const Matrix<MT2,SO2>& rhs )
1373 if( IsUpper<MT2>::value || IsUniTriangular<MT2>::value ||
1375 throw std::invalid_argument(
"Invalid assignment to unilower matrix" );
1379 if( !IsStrictlyLower<MT2>::value )
1401 template<
typename MT
1403 template<
typename MT2
1405 inline typename EnableIf< IsComputation<MT2>, UniLowerMatrix<MT,SO,false>& >::Type
1406 UniLowerMatrix<MT,SO,false>::operator-=(
const Matrix<MT2,SO2>& rhs )
1408 if( IsUpper<MT2>::value || IsUniTriangular<MT2>::value ||
1409 ( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) )
1410 throw std::invalid_argument(
"Invalid assignment to unilower matrix" );
1412 if( IsStrictlyLower<MT2>::value ) {
1419 throw std::invalid_argument(
"Invalid assignment to unilower matrix" );
1424 if( !IsStrictlyLower<MT2>::value )
1445 template<
typename MT
1447 template<
typename MT2
1449 inline UniLowerMatrix<MT,SO,false>&
1450 UniLowerMatrix<MT,SO,false>::operator*=(
const Matrix<MT2,SO2>& rhs )
1452 if( matrix_.rows() != (~rhs).
columns() )
1453 throw std::invalid_argument(
"Invalid assignment to unilower matrix" );
1455 MT tmp( matrix_ * ~rhs );
1458 throw std::invalid_argument(
"Invalid assignment to unilower matrix" );
1460 move( matrix_, tmp );
1462 if( !IsUniLower<MT2>::value )
1485 template<
typename MT
1489 return matrix_.rows();
1501 template<
typename MT
1505 return matrix_.columns();
1517 template<
typename MT
1521 return matrix_.capacity();
1539 template<
typename MT
1543 return matrix_.capacity(i);
1555 template<
typename MT
1559 return matrix_.nonZeros();
1577 template<
typename MT
1581 return matrix_.nonZeros(i);
1593 template<
typename MT
1598 for(
size_t j=0UL; j<
columns(); ++j ) {
1599 matrix_.erase( j, matrix_.lowerBound(j+1UL,j), matrix_.end(j) );
1603 for(
size_t i=1UL; i<
rows(); ++i ) {
1604 matrix_.erase( i, matrix_.begin(i), matrix_.lowerBound(i,i) );
1625 template<
typename MT
1630 matrix_.erase( i, matrix_.lowerBound(i+1UL,i), matrix_.end(i) );
1633 matrix_.erase( i, matrix_.begin(i), matrix_.lowerBound(i,i) );
1648 template<
typename MT
1654 if( IsResizable<MT>::value ) {
1681 template<
typename MT
1687 throw std::invalid_argument(
"Invalid access to diagonal or upper matrix element" );
1689 return Iterator( matrix_.set( i, j, value ), ( SO ? j : i ) );
1712 template<
typename MT
1715 UniLowerMatrix<MT,SO,false>::insert(
size_t i,
size_t j,
const ElementType& value )
1718 throw std::invalid_argument(
"Invalid access to diagonal or upper matrix element" );
1720 return Iterator( matrix_.insert( i, j, value ), ( SO ? j : i ) );
1738 template<
typename MT
1740 inline void UniLowerMatrix<MT,SO,false>::erase(
size_t i,
size_t j )
1743 throw std::invalid_argument(
"Invalid access to diagonal matrix element" );
1745 matrix_.erase( i, j );
1765 template<
typename MT
1768 UniLowerMatrix<MT,SO,false>::erase(
size_t i,
Iterator pos )
1770 if( pos != matrix_.end(i) && pos->index() == i )
1771 throw std::invalid_argument(
"Invalid access to diagonal matrix element" );
1773 return Iterator( matrix_.erase( i, pos.base() ), i );
1794 template<
typename MT
1797 UniLowerMatrix<MT,SO,false>::erase(
size_t i,
Iterator first,
Iterator last )
1799 for(
Iterator element=first; element!=last; ++element ) {
1800 if( element->index() == i )
1801 throw std::invalid_argument(
"Invalid access to diagonal matrix element" );
1804 return Iterator( matrix_.erase( i, first.base(), last.base() ), i );
1825 template<
typename MT
1833 const size_t oldsize( matrix_.rows() );
1835 matrix_.resize( n, n, preserve );
1838 for(
size_t i=oldsize; i<n; ++i )
1839 matrix_.insert( i, i, ElementType(1) );
1857 template<
typename MT
1859 inline void UniLowerMatrix<MT,SO,false>::reserve(
size_t nonzeros )
1861 matrix_.reserve( nonzeros );
1881 template<
typename MT
1883 inline void UniLowerMatrix<MT,SO,false>::reserve(
size_t i,
size_t nonzeros )
1885 matrix_.reserve( i, nonzeros );
1902 template<
typename MT
1904 inline void UniLowerMatrix<MT,SO,false>::trim()
1924 template<
typename MT
1926 inline void UniLowerMatrix<MT,SO,false>::trim(
size_t i )
1942 template<
typename MT
1948 swap( matrix_, m.matrix_ );
1965 template<
typename MT
1967 inline size_t UniLowerMatrix<MT,SO,false>::maxNonZeros()
1971 return maxNonZeros( Rows<MT>::value );
1987 template<
typename MT
1989 inline size_t UniLowerMatrix<MT,SO,false>::maxNonZeros(
size_t n )
1991 return ( ( n + 1UL ) * n ) / 2UL;
2003 template<
typename MT
2005 inline void UniLowerMatrix<MT,SO,false>::resetUpper()
2008 for(
size_t j=1UL; j<
columns(); ++j )
2009 matrix_.erase( j, matrix_.begin( j ), matrix_.lowerBound( j, j ) );
2012 for(
size_t i=0UL; i<
rows(); ++i )
2013 matrix_.erase( i, matrix_.upperBound( i, i ), matrix_.end( i ) );
2044 template<
typename MT
2047 UniLowerMatrix<MT,SO,false>::find(
size_t i,
size_t j )
2049 return Iterator( matrix_.find( i, j ), ( SO ? j : i ) );
2071 template<
typename MT
2074 UniLowerMatrix<MT,SO,false>::find(
size_t i,
size_t j )
const
2076 return matrix_.find( i, j );
2098 template<
typename MT
2101 UniLowerMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
2103 return Iterator( matrix_.lowerBound( i, j ), ( SO ? j : i ) );
2125 template<
typename MT
2128 UniLowerMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
const
2130 return matrix_.lowerBound( i, j );
2152 template<
typename MT
2155 UniLowerMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
2157 return Iterator( matrix_.upperBound( i, j ), ( SO ? j : i ) );
2179 template<
typename MT
2182 UniLowerMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
const
2184 return matrix_.upperBound( i, j );
2248 template<
typename MT
2250 inline void UniLowerMatrix<MT,SO,false>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2253 throw std::invalid_argument(
"Invalid access to diagonal or upper matrix element" );
2256 matrix_.insert( i, j, value );
2276 template<
typename MT
2278 inline void UniLowerMatrix<MT,SO,false>::finalize(
size_t i )
2305 template<
typename MT
2307 template<
typename Other >
2308 inline bool UniLowerMatrix<MT,SO,false>::canAlias(
const Other* alias )
const
2310 return matrix_.canAlias( alias );
2327 template<
typename MT
2329 template<
typename Other >
2330 inline bool UniLowerMatrix<MT,SO,false>::isAliased(
const Other* alias )
const
2332 return matrix_.isAliased( alias );
2349 template<
typename MT
2351 inline bool UniLowerMatrix<MT,SO,false>::canSMPAssign()
const
2353 return matrix_.canSMPAssign();
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:116
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1649
Constraint on the data type.
Header file for mathematical functions.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the Rows type trait.
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8247
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix)
Checks if the given matrix is a square matrix.
Definition: Matrix.h:902
BLAZE_ALWAYS_INLINE MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:237
void move(CompressedMatrix< Type, SO > &dst, CompressedMatrix< Type, SO > &src)
Moving the contents of one compressed matrix to another.
Definition: CompressedMatrix.h:4825
BLAZE_ALWAYS_INLINE MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:300
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:258
bool isStrictlyLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly lower triangular matrix.
Definition: DenseMatrix.h:1121
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:242
Constraint on the data type.
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:821
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix)
Returns the maximum capacity of the matrix.
Definition: Matrix.h:348
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:4762
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2501
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:116
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:386
Constraint on the data type.
Header file for the IsUniLower type trait.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2503
Constraint on the data type.
Header file for the SparseMatrix base class.
Header file for utility functions for sparse matrices.
Header file for the IsSquare type trait.
Constraint on the data type.
bool isDefault(const CompressedMatrix< Type, SO > &m)
Returns whether the given compressed matrix is in default state.
Definition: CompressedMatrix.h:4789
Header file for the DisableIf class template.
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4807
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:116
Constraint on the data type.
Header file for the SparseElement base class.
Header file for the IsUniTriangular type trait.
Header file for the IsStrictlyTriangular type trait.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2504
Constraints on the storage order of matrix types.
#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:118
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:195
bool isUniLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a lower unitriangular matrix.
Definition: DenseMatrix.h:1041
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:535
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2509
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:841
Header file for the UniLowerProxy class.
Header file for the IsNumeric type trait.
Header file for all adaptor forward declarations.
#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, a compilation error is created.
Definition: Symmetric.h:116
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2506
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:79
#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:118
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:116
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2510
Header file for the isDefault shim.
Constraint on the data type.
Constraint on the data type.
double real
Floating point data type of the Blaze library.This type definition offers the possibility to switch t...
Definition: Precision.h:47
#define BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE(T)
Constraint on the data type.In case the given data type T is resizable, i.e. has a 'resize' member fu...
Definition: Resizable.h:118
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:200
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, sse_int16_t >::Type set(T value)
Sets all values in the vector to the given 2-byte integral value.
Definition: Set.h:73
Header file for the move shim.
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE(T)
Constraint on the data type.In case the given data type T is not resizable, i.e. does not have a 'res...
Definition: Resizable.h:79
Header file for the IsComputation type trait class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_EXPRESSION_TYPE(T)
Constraint on the data type.In case the given data type T is an expression (i.e. a type derived from ...
Definition: Expression.h:118
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2502
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:332
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2508
Header file for the IsUpper type trait.
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:143
Header file for the IsResizable type trait.
#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
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
Header file for the implementation of the base template of the UniLowerMatrix.