35 #ifndef _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_SPARSE_H_
36 #define _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_SPARSE_H_
101 class UniUpperMatrix<MT,SO,false>
102 :
public SparseMatrix< UniUpperMatrix<MT,SO,false>, SO >
113 typedef UniUpperMatrix<MT,SO,false>
This;
128 template<
typename ET >
131 typedef UniUpperMatrix< typename MT::template Rebind<ET>::Other > Other;
144 template<
typename T >
145 struct BuiltinType {
typedef INVALID_TYPE Type; };
151 template<
typename T >
152 struct ComplexType {
typedef typename T::value_type Type; };
158 typedef typename If< IsComplex<ElementType>
159 , ComplexType<ElementType>
160 , BuiltinType<ElementType> >::Type::Type ValueType;
162 typedef ValueType value_type;
171 inline UniUpperValue( ElementType& value,
bool diagonal )
173 , diagonal_( diagonal )
184 inline UniUpperValue& operator=(
const UniUpperValue& uv ) {
186 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
199 template<
typename T >
inline UniUpperValue& operator=(
const T& v ) {
201 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
214 template<
typename T >
inline UniUpperValue& operator+=(
const T& v ) {
216 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
229 template<
typename T >
inline UniUpperValue& operator-=(
const T& v ) {
231 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
244 template<
typename T >
inline UniUpperValue& operator*=(
const T& v ) {
246 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
259 template<
typename T >
inline UniUpperValue& operator/=(
const T& v ) {
261 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
285 inline ValueType
real()
const {
286 return value_->real();
300 inline void real( ValueType value )
const {
302 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
303 value_->real( value );
315 inline ValueType imag()
const {
316 return value_->imag();
330 inline void imag( ValueType value )
const {
332 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
333 value_->imag( value );
348 class UniUpperElement :
private SparseElement
357 typedef UniUpperValue ValueType;
358 typedef size_t IndexType;
361 typedef UniUpperElement* Pointer;
370 inline UniUpperElement( IteratorType pos,
bool diagonal )
372 , diagonal_( diagonal )
383 template<
typename T >
inline UniUpperElement& operator=(
const T& v ) {
385 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
398 template<
typename T >
inline UniUpperElement& operator+=(
const T& v ) {
400 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
413 template<
typename T >
inline UniUpperElement& operator-=(
const T& v ) {
415 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
428 template<
typename T >
inline UniUpperElement& operator*=(
const T& v ) {
430 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
443 template<
typename T >
inline UniUpperElement& operator/=(
const T& v ) {
445 throw std::invalid_argument(
"Invalid assignment to diagonal matrix element" );
456 inline Pointer operator->() {
466 inline Reference value()
const {
467 return Reference( pos_->value(), diagonal_ );
476 inline IndexType index()
const {
477 return pos_->index();
498 typedef std::forward_iterator_tag IteratorCategory;
499 typedef UniUpperElement ValueType;
500 typedef ValueType PointerType;
501 typedef ValueType ReferenceType;
502 typedef ptrdiff_t DifferenceType;
505 typedef IteratorCategory iterator_category;
506 typedef ValueType value_type;
507 typedef PointerType pointer;
508 typedef ReferenceType reference;
509 typedef DifferenceType difference_type;
527 inline Iterator( IteratorType pos,
size_t index )
549 inline const Iterator operator++(
int ) {
562 return ReferenceType( pos_, pos_->index() == index_ );
571 inline PointerType operator->()
const {
572 return PointerType( pos_, pos_->index() == index_ );
593 return pos_ == rhs.pos_;
604 return !( *
this == rhs );
615 return pos_ - rhs.pos_;
624 inline IteratorType base()
const {
639 enum { smpAssignable = 0 };
645 explicit inline UniUpperMatrix();
646 explicit inline UniUpperMatrix(
size_t n );
647 explicit inline UniUpperMatrix(
size_t n,
size_t nonzeros );
648 explicit inline UniUpperMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
650 inline UniUpperMatrix(
const UniUpperMatrix& m );
651 template<
typename MT2,
bool SO2 >
inline UniUpperMatrix(
const Matrix<MT2,SO2>& m );
662 inline Reference operator()(
size_t i,
size_t j );
663 inline ConstReference operator()(
size_t i,
size_t j )
const;
665 inline ConstIterator
begin (
size_t i )
const;
666 inline ConstIterator
cbegin(
size_t i )
const;
668 inline ConstIterator
end (
size_t i )
const;
669 inline ConstIterator
cend (
size_t i )
const;
676 inline UniUpperMatrix& operator=(
const UniUpperMatrix& rhs );
678 template<
typename MT2,
bool SO2 >
679 inline typename DisableIf< IsComputation<MT2>, UniUpperMatrix& >::Type
680 operator=(
const Matrix<MT2,SO2>& rhs );
682 template<
typename MT2,
bool SO2 >
683 inline typename EnableIf< IsComputation<MT2>, UniUpperMatrix& >::Type
684 operator=(
const Matrix<MT2,SO2>& rhs );
686 template<
typename MT2,
bool SO2 >
687 inline typename DisableIf< IsComputation<MT2>, UniUpperMatrix& >::Type
688 operator+=(
const Matrix<MT2,SO2>& rhs );
690 template<
typename MT2,
bool SO2 >
691 inline typename EnableIf< IsComputation<MT2>, UniUpperMatrix& >::Type
692 operator+=(
const Matrix<MT2,SO2>& rhs );
694 template<
typename MT2,
bool SO2 >
695 inline typename DisableIf< IsComputation<MT2>, UniUpperMatrix& >::Type
696 operator-=(
const Matrix<MT2,SO2>& rhs );
698 template<
typename MT2,
bool SO2 >
699 inline typename EnableIf< IsComputation<MT2>, UniUpperMatrix& >::Type
700 operator-=(
const Matrix<MT2,SO2>& rhs );
702 template<
typename MT2,
bool SO2 >
703 inline UniUpperMatrix& operator*=(
const Matrix<MT2,SO2>& rhs );
710 inline size_t rows()
const;
713 inline size_t capacity(
size_t i )
const;
715 inline size_t nonZeros(
size_t i )
const;
717 inline void reset(
size_t i );
719 inline Iterator set(
size_t i,
size_t j,
const ElementType& value );
720 inline Iterator insert(
size_t i,
size_t j,
const ElementType& value );
721 inline void erase(
size_t i,
size_t j );
724 inline void resize (
size_t n,
bool preserve=
true );
725 inline void reserve(
size_t nonzeros );
726 inline void reserve(
size_t i,
size_t nonzeros );
728 inline void trim(
size_t i );
729 inline void swap( UniUpperMatrix& m ) ;
731 static inline size_t maxNonZeros();
732 static inline size_t maxNonZeros(
size_t n );
739 inline Iterator find (
size_t i,
size_t j );
740 inline ConstIterator find (
size_t i,
size_t j )
const;
741 inline Iterator lowerBound(
size_t i,
size_t j );
742 inline ConstIterator lowerBound(
size_t i,
size_t j )
const;
743 inline Iterator upperBound(
size_t i,
size_t j );
744 inline ConstIterator upperBound(
size_t i,
size_t j )
const;
751 inline void append (
size_t i,
size_t j,
const ElementType& value,
bool check=
false );
752 inline void finalize(
size_t i );
759 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
760 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
762 inline bool canSMPAssign()
const;
770 inline void resetLower();
782 template<
typename MT2,
bool SO2,
bool DF2 >
783 friend MT2& derestrict( UniUpperMatrix<MT2,SO2,DF2>& m );
818 template<
typename MT
820 inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix()
837 template<
typename MT
839 inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix(
size_t n )
844 for(
size_t i=0UL; i<n; ++i ) {
846 matrix_.finalize( i );
865 template<
typename MT
867 inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix(
size_t n,
size_t nonzeros )
868 : matrix_( n, n,
max( nonzeros, n ) )
872 for(
size_t i=0UL; i<n; ++i ) {
874 matrix_.finalize( i );
897 template<
typename MT
899 inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
900 : matrix_( n, n, nonzeros )
904 for(
size_t i=0UL; i<n; ++i )
906 if( nonzeros[i] == 0UL )
907 throw std::invalid_argument(
"Invalid capacity specification" );
910 matrix_.finalize( i );
925 template<
typename MT
927 inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix(
const UniUpperMatrix& m )
928 : matrix_( m.matrix_ )
946 template<
typename MT
948 template<
typename MT2
950 inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix(
const Matrix<MT2,SO2>& m )
953 if( !IsUniUpper<MT2>::value && !
isUniUpper( matrix_ ) )
954 throw std::invalid_argument(
"Invalid setup of uniupper matrix" );
956 if( !IsUniUpper<MT2>::value )
985 template<
typename MT
988 UniUpperMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
1011 template<
typename MT
1014 UniUpperMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
const
1019 return matrix_(i,j);
1037 template<
typename MT
1042 return Iterator( matrix_.begin(i), i );
1060 template<
typename MT
1065 return matrix_.begin(i);
1083 template<
typename MT
1088 return matrix_.cbegin(i);
1106 template<
typename MT
1111 return Iterator( matrix_.end(i), i );
1129 template<
typename MT
1134 return matrix_.end(i);
1152 template<
typename MT
1157 return matrix_.cend(i);
1181 template<
typename MT
1183 inline UniUpperMatrix<MT,SO,false>&
1184 UniUpperMatrix<MT,SO,false>::operator=(
const UniUpperMatrix& rhs )
1186 matrix_ = rhs.matrix_;
1207 template<
typename MT
1209 template<
typename MT2
1211 inline typename DisableIf< IsComputation<MT2>, UniUpperMatrix<MT,SO,false>& >::Type
1212 UniUpperMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1214 if( IsStrictlyTriangular<MT2>::value || ( !IsUniUpper<MT2>::value && !
isUniUpper( ~rhs ) ) )
1215 throw std::invalid_argument(
"Invalid assignment to uniupper matrix" );
1219 if( !IsUniUpper<MT2>::value )
1241 template<
typename MT
1243 template<
typename MT2
1245 inline typename EnableIf< IsComputation<MT2>, UniUpperMatrix<MT,SO,false>& >::Type
1246 UniUpperMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1248 if( IsStrictlyTriangular<MT2>::value || ( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) )
1249 throw std::invalid_argument(
"Invalid assignment to uniupper matrix" );
1251 if( IsUniUpper<MT2>::value ) {
1258 throw std::invalid_argument(
"Invalid assignment to uniupper matrix" );
1260 move( matrix_, tmp );
1263 if( !IsUniUpper<MT2>::value )
1285 template<
typename MT
1287 template<
typename MT2
1289 inline typename DisableIf< IsComputation<MT2>, UniUpperMatrix<MT,SO,false>& >::Type
1290 UniUpperMatrix<MT,SO,false>::operator+=(
const Matrix<MT2,SO2>& rhs )
1292 if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1294 throw std::invalid_argument(
"Invalid assignment to uniupper matrix" );
1298 if( !IsStrictlyUpper<MT2>::value )
1320 template<
typename MT
1322 template<
typename MT2
1324 inline typename EnableIf< IsComputation<MT2>, UniUpperMatrix<MT,SO,false>& >::Type
1325 UniUpperMatrix<MT,SO,false>::operator+=(
const Matrix<MT2,SO2>& rhs )
1327 if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1328 ( IsSquare<MT2>::value && !
isSquare( ~rhs ) ) )
1329 throw std::invalid_argument(
"Invalid assignment to uniupper matrix" );
1331 if( IsStrictlyUpper<MT2>::value ) {
1338 throw std::invalid_argument(
"Invalid assignment to uniupper matrix" );
1343 if( !IsStrictlyUpper<MT2>::value )
1365 template<
typename MT
1367 template<
typename MT2
1369 inline typename DisableIf< IsComputation<MT2>, UniUpperMatrix<MT,SO,false>& >::Type
1370 UniUpperMatrix<MT,SO,false>::operator-=(
const Matrix<MT2,SO2>& rhs )
1372 if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1374 throw std::invalid_argument(
"Invalid assignment to uniupper matrix" );
1378 if( !IsStrictlyUpper<MT2>::value )
1400 template<
typename MT
1402 template<
typename MT2
1404 inline typename EnableIf< IsComputation<MT2>, UniUpperMatrix<MT,SO,false>& >::Type
1405 UniUpperMatrix<MT,SO,false>::operator-=(
const Matrix<MT2,SO2>& rhs )
1407 if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1408 ( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) )
1409 throw std::invalid_argument(
"Invalid assignment to uniupper matrix" );
1411 if( IsStrictlyUpper<MT2>::value ) {
1418 throw std::invalid_argument(
"Invalid assignment to uniupper matrix" );
1423 if( !IsStrictlyUpper<MT2>::value )
1444 template<
typename MT
1446 template<
typename MT2
1448 inline UniUpperMatrix<MT,SO,false>&
1449 UniUpperMatrix<MT,SO,false>::operator*=(
const Matrix<MT2,SO2>& rhs )
1451 if( matrix_.rows() != (~rhs).
columns() )
1452 throw std::invalid_argument(
"Invalid assignment to uniupper matrix" );
1454 MT tmp( matrix_ * ~rhs );
1457 throw std::invalid_argument(
"Invalid assignment to uniupper matrix" );
1459 move( matrix_, tmp );
1461 if( !IsUniUpper<MT2>::value )
1484 template<
typename MT
1488 return matrix_.rows();
1500 template<
typename MT
1504 return matrix_.columns();
1516 template<
typename MT
1520 return matrix_.capacity();
1538 template<
typename MT
1542 return matrix_.capacity(i);
1554 template<
typename MT
1558 return matrix_.nonZeros();
1576 template<
typename MT
1580 return matrix_.nonZeros(i);
1592 template<
typename MT
1597 for(
size_t j=1UL; j<
columns(); ++j ) {
1598 matrix_.erase( j, matrix_.begin(j), matrix_.lowerBound(j,j) );
1602 for(
size_t i=0UL; i<
rows(); ++i ) {
1603 matrix_.erase( i, matrix_.lowerBound(i,i+1UL), matrix_.end(i) );
1624 template<
typename MT
1629 matrix_.erase( i, matrix_.begin(i), matrix_.lowerBound(i,i) );
1632 matrix_.erase( i, matrix_.lowerBound(i,i+1UL), matrix_.end(i) );
1647 template<
typename MT
1653 if( IsResizable<MT>::value ) {
1680 template<
typename MT
1686 throw std::invalid_argument(
"Invalid access to diagonal or lower matrix element" );
1688 return Iterator( matrix_.set( i, j, value ), ( SO ? j : i ) );
1711 template<
typename MT
1714 UniUpperMatrix<MT,SO,false>::insert(
size_t i,
size_t j,
const ElementType& value )
1717 throw std::invalid_argument(
"Invalid access to diagonal or lower matrix element" );
1719 return Iterator( matrix_.insert( i, j, value ), ( SO ? j : i ) );
1737 template<
typename MT
1739 inline void UniUpperMatrix<MT,SO,false>::erase(
size_t i,
size_t j )
1742 throw std::invalid_argument(
"Invalid access to diagonal matrix element" );
1744 matrix_.erase( i, j );
1764 template<
typename MT
1767 UniUpperMatrix<MT,SO,false>::erase(
size_t i,
Iterator pos )
1769 if( pos != matrix_.end(i) && pos->index() == i )
1770 throw std::invalid_argument(
"Invalid access to diagonal matrix element" );
1772 return Iterator( matrix_.erase( i, pos.base() ), i );
1793 template<
typename MT
1796 UniUpperMatrix<MT,SO,false>::erase(
size_t i,
Iterator first,
Iterator last )
1798 for(
Iterator element=first; element!=last; ++element ) {
1799 if( element->index() == i ) {
1800 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 UniUpperMatrix<MT,SO,false>::reserve(
size_t nonzeros )
1861 matrix_.reserve( nonzeros );
1881 template<
typename MT
1883 inline void UniUpperMatrix<MT,SO,false>::reserve(
size_t i,
size_t nonzeros )
1885 matrix_.reserve( i, nonzeros );
1902 template<
typename MT
1904 inline void UniUpperMatrix<MT,SO,false>::trim()
1924 template<
typename MT
1926 inline void UniUpperMatrix<MT,SO,false>::trim(
size_t i )
1942 template<
typename MT
1948 swap( matrix_, m.matrix_ );
1965 template<
typename MT
1967 inline size_t UniUpperMatrix<MT,SO,false>::maxNonZeros()
1971 return maxNonZeros( Rows<MT>::value );
1987 template<
typename MT
1989 inline size_t UniUpperMatrix<MT,SO,false>::maxNonZeros(
size_t n )
1991 return ( ( n + 1UL ) * n ) / 2UL;
2003 template<
typename MT
2005 inline void UniUpperMatrix<MT,SO,false>::resetLower()
2008 for(
size_t j=0UL; j<
columns(); ++j )
2009 matrix_.erase( j, matrix_.upperBound( j, j ), matrix_.end( j ) );
2012 for(
size_t i=1UL; i<
rows(); ++i )
2013 matrix_.erase( i, matrix_.begin( i ), matrix_.lowerBound( i, i ) );
2044 template<
typename MT
2047 UniUpperMatrix<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 UniUpperMatrix<MT,SO,false>::find(
size_t i,
size_t j )
const
2076 return matrix_.find( i, j );
2098 template<
typename MT
2101 UniUpperMatrix<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 UniUpperMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
const
2130 return matrix_.lowerBound( i, j );
2152 template<
typename MT
2155 UniUpperMatrix<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 UniUpperMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
const
2184 return matrix_.upperBound( i, j );
2248 template<
typename MT
2250 inline void UniUpperMatrix<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 lower matrix element" );
2256 matrix_.insert( i, j, value );
2276 template<
typename MT
2278 inline void UniUpperMatrix<MT,SO,false>::finalize(
size_t i )
2305 template<
typename MT
2307 template<
typename Other >
2308 inline bool UniUpperMatrix<MT,SO,false>::canAlias(
const Other* alias )
const
2310 return matrix_.canAlias( alias );
2327 template<
typename MT
2329 template<
typename Other >
2330 inline bool UniUpperMatrix<MT,SO,false>::isAliased(
const Other* alias )
const
2332 return matrix_.isAliased( alias );
2349 template<
typename MT
2351 inline bool UniUpperMatrix<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.
Header file for the IsUniUpper 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 isStrictlyUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly upper triangular matrix.
Definition: DenseMatrix.h:1354
#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
Header file for the implementation of the base template of the UniUpperMatrix.
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.
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 IsStrictlyUpper type trait.
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 IsLower type trait.
Header file for the UniUpperProxy 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
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.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:841
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
bool isUniUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper unitriangular matrix.
Definition: DenseMatrix.h:1274
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2508
#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