35 #ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SPARSENUMERIC_H_
36 #define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SPARSENUMERIC_H_
101 class SymmetricMatrix<MT,SO,false,true>
102 :
public SparseMatrix< SymmetricMatrix<MT,SO,false,true>, SO >
113 typedef SymmetricMatrix<MT,SO,false,true>
This;
115 typedef SymmetricMatrix<OT,!SO,false,true>
OppositeType;
128 template<
typename ET >
131 typedef SymmetricMatrix< 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;
181 inline SymmetricValue& operator=(
const SymmetricValue& sv ) {
195 template<
typename T >
inline SymmetricValue& operator=(
const T& v ) {
209 template<
typename T >
inline SymmetricValue& operator+=(
const T& v ) {
223 template<
typename T >
inline SymmetricValue& operator-=(
const T& v ) {
237 template<
typename T >
inline SymmetricValue& operator*=(
const T& v ) {
251 template<
typename T >
inline SymmetricValue& operator/=(
const T& v ) {
277 inline ValueType
real()
const {
291 inline void real( ValueType value )
const {
306 inline ValueType imag()
const {
320 inline void imag( ValueType value )
const {
338 class SymmetricElement :
private SparseElement
347 typedef SymmetricValue ValueType;
348 typedef size_t IndexType;
351 typedef SymmetricElement* Pointer;
360 inline SymmetricElement( IteratorType e1, IteratorType e2 )
372 template<
typename T >
inline SymmetricElement& operator=(
const T& v ) {
386 template<
typename T >
inline SymmetricElement& operator+=(
const T& v ) {
400 template<
typename T >
inline SymmetricElement& operator-=(
const T& v ) {
414 template<
typename T >
inline SymmetricElement& operator*=(
const T& v ) {
428 template<
typename T >
inline SymmetricElement& operator/=(
const T& v ) {
441 inline Pointer operator->() {
452 return Reference( e1_->value(), e2_->value() );
461 inline IndexType index()
const {
483 typedef std::forward_iterator_tag IteratorCategory;
484 typedef SymmetricElement ValueType;
485 typedef ValueType PointerType;
486 typedef ValueType ReferenceType;
487 typedef ptrdiff_t DifferenceType;
490 typedef IteratorCategory iterator_category;
491 typedef ValueType value_type;
492 typedef PointerType pointer;
493 typedef ReferenceType reference;
494 typedef DifferenceType difference_type;
514 inline Iterator( IteratorType pos, MT& matrix,
size_t index )
537 inline const Iterator operator++(
int ) {
550 const IteratorType pos2( SO ? matrix_->find( index_, pos_->index() )
551 : matrix_->find( pos_->index(), index_ ) );
553 return ReferenceType( pos_, pos2 );
562 inline PointerType operator->()
const {
563 const IteratorType pos2( SO ? matrix_->find( index_, pos_->index() )
564 : matrix_->find( pos_->index(), index_ ) );
566 return PointerType( pos_, pos2 );
587 return pos_ == rhs.pos_;
598 return !( *
this == rhs );
609 return pos_ - rhs.pos_;
618 inline IteratorType base()
const {
634 enum { smpAssignable = 0 };
640 explicit inline SymmetricMatrix();
641 explicit inline SymmetricMatrix(
size_t n );
642 explicit inline SymmetricMatrix(
size_t n,
size_t nonzeros );
643 explicit inline SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
645 inline SymmetricMatrix(
const SymmetricMatrix& m );
646 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,SO>& m );
647 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,!SO>& m );
658 inline Reference operator()(
size_t i,
size_t j );
672 inline SymmetricMatrix& operator=(
const SymmetricMatrix& rhs );
674 template<
typename MT2 >
675 inline typename DisableIf< IsComputation<MT2>, SymmetricMatrix& >::Type
676 operator=(
const Matrix<MT2,SO>& rhs );
678 template<
typename MT2 >
679 inline typename EnableIf< IsComputation<MT2>, SymmetricMatrix& >::Type
680 operator=(
const Matrix<MT2,SO>& rhs );
682 template<
typename MT2 >
683 inline SymmetricMatrix& operator=(
const Matrix<MT2,!SO>& rhs );
685 template<
typename MT2 >
686 inline typename DisableIf< IsComputation<MT2>, SymmetricMatrix& >::Type
687 operator+=(
const Matrix<MT2,SO>& rhs );
689 template<
typename MT2 >
690 inline typename EnableIf< IsComputation<MT2>, SymmetricMatrix& >::Type
691 operator+=(
const Matrix<MT2,SO>& rhs );
693 template<
typename MT2 >
694 inline SymmetricMatrix& operator+=(
const Matrix<MT2,!SO>& rhs );
696 template<
typename MT2 >
697 inline typename DisableIf< IsComputation<MT2>, SymmetricMatrix& >::Type
698 operator-=(
const Matrix<MT2,SO>& rhs );
700 template<
typename MT2 >
701 inline typename EnableIf< IsComputation<MT2>, SymmetricMatrix& >::Type
702 operator-=(
const Matrix<MT2,SO>& rhs );
704 template<
typename MT2 >
705 inline SymmetricMatrix& operator-=(
const Matrix<MT2,!SO>& rhs );
707 template<
typename MT2,
bool SO2 >
708 inline SymmetricMatrix& operator*=(
const Matrix<MT2,SO2>& rhs );
710 template<
typename Other >
711 inline typename EnableIf< IsNumeric<Other>, SymmetricMatrix >::Type&
712 operator*=( Other rhs );
714 template<
typename Other >
715 inline typename EnableIf< IsNumeric<Other>, SymmetricMatrix >::Type&
716 operator/=( Other rhs );
723 inline size_t rows()
const;
726 inline size_t capacity(
size_t i )
const;
728 inline size_t nonZeros(
size_t i )
const;
730 inline void reset(
size_t i );
734 inline void erase(
size_t i,
size_t j );
737 inline void resize (
size_t n,
bool preserve=
true );
738 inline void reserve(
size_t nonzeros );
739 inline void reserve(
size_t i,
size_t nonzeros );
741 inline void trim(
size_t i );
742 inline SymmetricMatrix& transpose();
743 template<
typename Other >
inline SymmetricMatrix& scale(
const Other& scalar );
744 template<
typename Other >
inline SymmetricMatrix& scaleDiagonal( Other scale );
745 inline void swap( SymmetricMatrix& m ) ;
752 inline Iterator find (
size_t i,
size_t j );
754 inline Iterator lowerBound(
size_t i,
size_t j );
756 inline Iterator upperBound(
size_t i,
size_t j );
764 inline void append (
size_t i,
size_t j,
const ElementType& value,
bool check=
false );
765 inline void finalize(
size_t i );
772 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
773 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
775 inline bool canSMPAssign()
const;
788 template<
typename MT2,
bool SO2,
bool DF2,
bool NF2 >
789 friend bool isDefault(
const SymmetricMatrix<MT2,SO2,DF2,NF2>& m );
824 template<
typename MT
826 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix()
843 template<
typename MT
845 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n )
865 template<
typename MT
867 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
size_t nonzeros )
868 : matrix_( n, n, nonzeros )
887 template<
typename MT
889 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
890 : matrix_( n, n, nonzeros )
906 template<
typename MT
908 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const SymmetricMatrix& m )
909 : matrix_( m.matrix_ )
927 template<
typename MT
929 template<
typename MT2 >
930 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,SO>& m )
933 if( IsLower<MT2>::value || IsUpper<MT2>::value ||
934 ( !IsSymmetric<MT2>::value && !
isSymmetric( matrix_ ) ) )
935 throw std::invalid_argument(
"Invalid setup of symmetric matrix" );
953 template<
typename MT
955 template<
typename MT2 >
956 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,!SO>& m )
957 : matrix_(
trans( ~m ) )
959 if( IsLower<MT2>::value || IsUpper<MT2>::value ||
960 ( !IsSymmetric<MT2>::value && !
isSymmetric( matrix_ ) ) )
961 throw std::invalid_argument(
"Invalid setup of symmetric matrix" );
989 template<
typename MT
992 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
1015 template<
typename MT
1018 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
const
1023 return matrix_(i,j);
1041 template<
typename MT
1046 return Iterator( matrix_.begin(i), matrix_, i );
1064 template<
typename MT
1069 return matrix_.begin(i);
1087 template<
typename MT
1092 return matrix_.cbegin(i);
1110 template<
typename MT
1115 return Iterator( matrix_.end(i), matrix_, i );
1133 template<
typename MT
1138 return matrix_.end(i);
1156 template<
typename MT
1161 return matrix_.cend(i);
1185 template<
typename MT
1187 inline SymmetricMatrix<MT,SO,false,true>&
1188 SymmetricMatrix<MT,SO,false,true>::operator=(
const SymmetricMatrix& rhs )
1190 matrix_ = rhs.matrix_;
1211 template<
typename MT
1213 template<
typename MT2 >
1214 inline typename DisableIf< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >::Type
1215 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1217 if( IsLower<MT2>::value || IsUpper<MT2>::value ||
1218 ( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) )
1219 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1242 template<
typename MT
1244 template<
typename MT2 >
1245 inline typename EnableIf< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >::Type
1246 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1250 if( IsLower<MT2>::value || IsUpper<MT2>::value || !
isSquare( ~rhs ) )
1251 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1253 if( IsSymmetric<MT2>::value ) {
1260 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1262 move( matrix_, tmp );
1284 template<
typename MT
1286 template<
typename MT2 >
1287 inline SymmetricMatrix<MT,SO,false,true>&
1288 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,!SO>& rhs )
1290 return this->operator=(
trans( ~rhs ) );
1309 template<
typename MT
1311 template<
typename MT2 >
1312 inline typename DisableIf< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >::Type
1313 SymmetricMatrix<MT,SO,false,true>::operator+=(
const Matrix<MT2,SO>& rhs )
1315 if( IsLower<MT2>::value || IsUpper<MT2>::value ||
1316 ( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) )
1317 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1340 template<
typename MT
1342 template<
typename MT2 >
1343 inline typename EnableIf< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >::Type
1344 SymmetricMatrix<MT,SO,false,true>::operator+=(
const Matrix<MT2,SO>& rhs )
1346 if( IsLower<MT2>::value || IsUpper<MT2>::value || !
isSquare( ~rhs ) )
1347 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1349 if( IsSymmetric<MT2>::value ) {
1356 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1381 template<
typename MT
1383 template<
typename MT2 >
1384 inline SymmetricMatrix<MT,SO,false,true>&
1385 SymmetricMatrix<MT,SO,false,true>::operator+=(
const Matrix<MT2,!SO>& rhs )
1387 return this->operator+=(
trans( ~rhs ) );
1406 template<
typename MT
1408 template<
typename MT2 >
1409 inline typename DisableIf< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >::Type
1410 SymmetricMatrix<MT,SO,false,true>::operator-=(
const Matrix<MT2,SO>& rhs )
1412 if( IsLower<MT2>::value || IsUpper<MT2>::value ||
1413 ( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) )
1414 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1437 template<
typename MT
1439 template<
typename MT2 >
1440 inline typename EnableIf< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >::Type
1441 SymmetricMatrix<MT,SO,false,true>::operator-=(
const Matrix<MT2,SO>& rhs )
1443 if( IsLower<MT2>::value || IsUpper<MT2>::value || !
isSquare( ~rhs ) )
1444 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1446 if( IsSymmetric<MT2>::value ) {
1453 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1478 template<
typename MT
1480 template<
typename MT2 >
1481 inline SymmetricMatrix<MT,SO,false,true>&
1482 SymmetricMatrix<MT,SO,false,true>::operator-=(
const Matrix<MT2,!SO>& rhs )
1484 return this->operator-=(
trans( ~rhs ) );
1502 template<
typename MT
1504 template<
typename MT2
1506 inline SymmetricMatrix<MT,SO,false,true>&
1507 SymmetricMatrix<MT,SO,false,true>::operator*=(
const Matrix<MT2,SO2>& rhs )
1511 if( matrix_.rows() != (~rhs).
columns() )
1512 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1514 MT tmp( matrix_ * ~rhs );
1517 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1519 move( matrix_, tmp );
1535 template<
typename MT
1537 template<
typename Other >
1538 inline typename EnableIf< IsNumeric<Other>, SymmetricMatrix<MT,SO,false,true> >::Type&
1539 SymmetricMatrix<MT,SO,false,true>::operator*=( Other rhs )
1555 template<
typename MT
1557 template<
typename Other >
1558 inline typename EnableIf< IsNumeric<Other>, SymmetricMatrix<MT,SO,false,true> >::Type&
1559 SymmetricMatrix<MT,SO,false,true>::operator/=( Other rhs )
1584 template<
typename MT
1588 return matrix_.rows();
1600 template<
typename MT
1604 return matrix_.columns();
1616 template<
typename MT
1620 return matrix_.capacity();
1637 template<
typename MT
1641 return matrix_.capacity(i);
1653 template<
typename MT
1657 return matrix_.nonZeros();
1675 template<
typename MT
1679 return matrix_.nonZeros(i);
1691 template<
typename MT
1737 template<
typename MT
1741 for(
typename MT::Iterator it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1743 const size_t j( it->index() );
1749 const typename MT::Iterator pos( matrix_.find( i, j ) );
1751 matrix_.erase( j, pos );
1754 const typename MT::Iterator pos( matrix_.find( j, i ) );
1756 matrix_.erase( j, pos );
1774 template<
typename MT
1800 template<
typename MT
1806 matrix_.set( j, i, value );
1807 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
1828 template<
typename MT
1831 SymmetricMatrix<MT,SO,false,true>::insert(
size_t i,
size_t j,
const ElementType& value )
1834 matrix_.insert( j, i, value );
1835 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
1851 template<
typename MT
1853 inline void SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
size_t j )
1855 matrix_.erase( i, j );
1857 matrix_.erase( j, i );
1875 template<
typename MT
1878 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator pos )
1882 if( base == matrix_.end( i ) )
1885 const size_t j( base->index() );
1889 return Iterator( matrix_.erase( i, base ), matrix_, i );
1894 matrix_.erase( j, matrix_.find( i, j ) );
1895 return Iterator( matrix_.erase( i, base ), matrix_, i );
1899 matrix_.erase( j, matrix_.find( j, i ) );
1900 return Iterator( matrix_.erase( i, base ), matrix_, i );
1921 template<
typename MT
1924 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator first,
Iterator last )
1926 for(
typename MT::Iterator it=first.base(); it!=last.base(); ++it )
1928 const size_t j( it->index() );
1935 matrix_.erase( i, j );
1939 matrix_.erase( j, i );
1943 return Iterator( matrix_.erase( i, first.base(), last.base() ), matrix_, i );
1964 template<
typename MT
1974 matrix_.resize( n, n,
true );
1991 template<
typename MT
1993 inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t nonzeros )
1995 matrix_.reserve( nonzeros );
2015 template<
typename MT
2017 inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t i,
size_t nonzeros )
2019 matrix_.reserve( i, nonzeros );
2036 template<
typename MT
2038 inline void SymmetricMatrix<MT,SO,false,true>::trim()
2058 template<
typename MT
2060 inline void SymmetricMatrix<MT,SO,false,true>::trim(
size_t i )
2074 template<
typename MT
2076 inline SymmetricMatrix<MT,SO,false,true>& SymmetricMatrix<MT,SO,false,true>::transpose()
2091 template<
typename MT
2093 template<
typename Other >
2094 inline SymmetricMatrix<MT,SO,false,true>&
2095 SymmetricMatrix<MT,SO,false,true>::scale(
const Other& scalar )
2097 matrix_.scale( scalar );
2111 template<
typename MT
2113 template<
typename Other >
2114 inline SymmetricMatrix<MT,SO,false,true>&
2115 SymmetricMatrix<MT,SO,false,true>::scaleDiagonal( Other scalar )
2117 matrix_.scaleDiagonal( scalar );
2132 template<
typename MT
2138 swap( matrix_, m.matrix_ );
2168 template<
typename MT
2171 SymmetricMatrix<MT,SO,false,true>::find(
size_t i,
size_t j )
2173 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2195 template<
typename MT
2198 SymmetricMatrix<MT,SO,false,true>::find(
size_t i,
size_t j )
const
2200 return matrix_.find( i, j );
2222 template<
typename MT
2225 SymmetricMatrix<MT,SO,false,true>::lowerBound(
size_t i,
size_t j )
2227 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2249 template<
typename MT
2252 SymmetricMatrix<MT,SO,false,true>::lowerBound(
size_t i,
size_t j )
const
2254 return matrix_.lowerBound( i, j );
2276 template<
typename MT
2279 SymmetricMatrix<MT,SO,false,true>::upperBound(
size_t i,
size_t j )
2281 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2303 template<
typename MT
2306 SymmetricMatrix<MT,SO,false,true>::upperBound(
size_t i,
size_t j )
const
2308 return matrix_.upperBound( i, j );
2377 template<
typename MT
2379 inline void SymmetricMatrix<MT,SO,false,true>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2381 matrix_.append( i, j, value, check );
2382 if( i != j && ( !check || !
isDefault( value ) ) )
2383 matrix_.insert( j, i, value );
2403 template<
typename MT
2405 inline void SymmetricMatrix<MT,SO,false,true>::finalize(
size_t i )
2432 template<
typename MT
2434 template<
typename Other >
2435 inline bool SymmetricMatrix<MT,SO,false,true>::canAlias(
const Other* alias )
const
2437 return matrix_.canAlias( alias );
2454 template<
typename MT
2456 template<
typename Other >
2457 inline bool SymmetricMatrix<MT,SO,false,true>::isAliased(
const Other* alias )
const
2459 return matrix_.isAliased( alias );
2476 template<
typename MT
2478 inline bool SymmetricMatrix<MT,SO,false,true>::canSMPAssign()
const
2480 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
Constraint on the data type.
void swap(SymmetricMatrix< MT, SO, DF, NF > &a, SymmetricMatrix< MT, SO, DF, NF > &b)
Swapping the contents of two matrices.
Definition: SymmetricMatrix.h:195
#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 UNUSED_PARAMETER function template.
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:4838
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:4772
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
#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.
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:731
Constraint on the data type.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
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:4709
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2472
#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 NumericProxy class.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2474
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:4736
Header file for the DisableIf class template.
Header file for the IsSymmetric type trait.
Header file for the clear shim.
Header file for the If class template.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4754
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
#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
BLAZE_ALWAYS_INLINE void clear(const NonNumericProxy< MT > &proxy)
Clearing the represented element.
Definition: NonNumericProxy.h:854
Constraint on the data type.
Header file for the IsLower type trait.
Header file for the SparseElement base class.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2475
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:2476
Header file for all forward declarations for expression class templates.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2480
Header file for the EnableIf class template.
Header file for the IsNumeric type trait.
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T >, Set< T, sizeof(T)> >::Type::Type set(T value)
Sets all values in the vector to the given integral value.
Definition: Set.h:211
#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:2477
Header file for run time assertion macros.
Utility type for generic codes.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of the base template of the SymmetricMatrix.
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:2481
Header file for the isDefault shim.
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE void reset(const NonNumericProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: NonNumericProxy.h:833
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_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
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:932
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:2473
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
Header file for basic type definitions.
Header file for the IsComplex type trait.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2479
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