35#ifndef _BLAZE_MATH_ADAPTORS_DIAGONALMATRIX_SPARSE_H_
36#define _BLAZE_MATH_ADAPTORS_DIAGONALMATRIX_SPARSE_H_
101 using OT = OppositeType_t<MT>;
102 using TT = TransposeType_t<MT>;
103 using ET = ElementType_t<MT>;
108 using This = DiagonalMatrix<MT,SO,false>;
109 using BaseType = SparseMatrix<This,SO>;
110 using ResultType = This;
111 using OppositeType = DiagonalMatrix<OT,!SO,false>;
112 using TransposeType = DiagonalMatrix<TT,!SO,false>;
113 using ElementType = ET;
114 using TagType = TagType_t<MT>;
115 using ReturnType = ReturnType_t<MT>;
116 using CompositeType =
const This&;
117 using Reference = DiagonalProxy<MT>;
118 using ConstReference = ConstReference_t<MT>;
119 using Iterator = Iterator_t<MT>;
120 using ConstIterator = ConstIterator_t<MT>;
126 template<
typename NewType >
129 using Other = DiagonalMatrix< typename MT::template Rebind<NewType>::Other >;
136 template<
size_t NewM
140 using Other = DiagonalMatrix< typename MT::template Resize<NewM,NewN>::Other >;
146 static constexpr bool smpAssignable =
false;
152 inline DiagonalMatrix();
153 explicit inline DiagonalMatrix(
size_t n );
154 inline DiagonalMatrix(
size_t n,
size_t nonzeros );
155 inline DiagonalMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
156 inline DiagonalMatrix( initializer_list< initializer_list<ElementType> > list );
158 inline DiagonalMatrix(
const DiagonalMatrix& m );
159 inline DiagonalMatrix( DiagonalMatrix&& m )
noexcept;
161 template<
typename MT2,
bool SO2 >
162 inline DiagonalMatrix(
const Matrix<MT2,SO2>& m );
169 ~DiagonalMatrix() =
default;
176 inline Reference operator()(
size_t i,
size_t j );
177 inline ConstReference operator()(
size_t i,
size_t j )
const;
178 inline Reference at(
size_t i,
size_t j );
179 inline ConstReference at(
size_t i,
size_t j )
const;
180 inline Iterator
begin (
size_t i );
181 inline ConstIterator
begin (
size_t i )
const;
182 inline ConstIterator
cbegin(
size_t i )
const;
183 inline Iterator
end (
size_t i );
184 inline ConstIterator
end (
size_t i )
const;
185 inline ConstIterator
cend (
size_t i )
const;
192 inline DiagonalMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
194 inline DiagonalMatrix& operator=(
const DiagonalMatrix& rhs );
195 inline DiagonalMatrix& operator=( DiagonalMatrix&& rhs )
noexcept;
197 template<
typename MT2,
bool SO2 >
198 inline auto operator=(
const Matrix<MT2,SO2>& rhs )
201 template<
typename MT2,
bool SO2 >
202 inline auto operator=(
const Matrix<MT2,SO2>& rhs )
205 template<
typename MT2,
bool SO2 >
206 inline auto operator+=(
const Matrix<MT2,SO2>& rhs )
209 template<
typename MT2,
bool SO2 >
210 inline auto operator+=(
const Matrix<MT2,SO2>& rhs )
213 template<
typename MT2,
bool SO2 >
214 inline auto operator-=(
const Matrix<MT2,SO2>& rhs )
217 template<
typename MT2,
bool SO2 >
218 inline auto operator-=(
const Matrix<MT2,SO2>& rhs )
221 template<
typename MT2,
bool SO2 >
222 inline auto operator%=(
const Matrix<MT2,SO2>& rhs ) -> DiagonalMatrix&;
229 inline size_t rows() const noexcept;
230 inline
size_t columns() const noexcept;
231 inline
size_t capacity() const noexcept;
232 inline
size_t capacity(
size_t i ) const noexcept;
234 inline
size_t nonZeros(
size_t i ) const;
236 inline
void reset(
size_t i );
238 inline
void resize (
size_t n,
bool preserve=true );
239 inline
void reserve(
size_t nonzeros );
240 inline
void reserve(
size_t i,
size_t nonzeros );
242 inline
void trim(
size_t i );
244 inline
void swap( DiagonalMatrix& m ) noexcept;
251 inline Iterator
set (
size_t i,
size_t j, const ElementType& value );
252 inline Iterator insert (
size_t i,
size_t j, const ElementType& value );
253 inline
void append (
size_t i,
size_t j, const ElementType& value,
bool check=false );
254 inline
void finalize(
size_t i );
261 inline
void erase(
size_t i,
size_t j );
262 inline Iterator erase(
size_t i, Iterator pos );
263 inline Iterator erase(
size_t i, Iterator first, Iterator last );
265 template< typename Pred >
266 inline
void erase( Pred predicate );
268 template< typename Pred >
269 inline
void erase(
size_t i, Iterator first, Iterator last, Pred predicate );
276 inline Iterator
find (
size_t i,
size_t j );
277 inline ConstIterator
find (
size_t i,
size_t j ) const;
278 inline Iterator
lowerBound(
size_t i,
size_t j );
279 inline ConstIterator
lowerBound(
size_t i,
size_t j ) const;
280 inline Iterator
upperBound(
size_t i,
size_t j );
281 inline ConstIterator
upperBound(
size_t i,
size_t j ) const;
288 template< typename Other > inline DiagonalMatrix& scale( const Other& scalar );
295 inline
bool isIntact() const noexcept;
302 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
303 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
305 inline
bool canSMPAssign() const noexcept;
313 inline
void resetNonDiagonal();
325 template< typename MT2,
bool SO2,
bool DF2 >
326 friend MT2& derestrict( DiagonalMatrix<MT2,SO2,DF2>& m );
365inline DiagonalMatrix<MT,SO,false>::DiagonalMatrix()
384inline DiagonalMatrix<MT,SO,false>::DiagonalMatrix(
size_t n )
406inline DiagonalMatrix<MT,SO,false>::DiagonalMatrix(
size_t n,
size_t nonzeros )
407 : matrix_( n, n, nonzeros )
430inline DiagonalMatrix<MT,SO,false>::DiagonalMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
431 : matrix_( n, n, nonzeros )
488inline DiagonalMatrix<MT,SO,false>::DiagonalMatrix(
const DiagonalMatrix& m )
489 : matrix_( m.matrix_ )
506inline DiagonalMatrix<MT,SO,false>::DiagonalMatrix( DiagonalMatrix&& m ) noexcept
507 : matrix_( std::move( m.matrix_ ) )
528template<
typename MT2
530inline DiagonalMatrix<MT,SO,false>::DiagonalMatrix(
const Matrix<MT2,SO2>& m )
533 if( !IsDiagonal_v<MT2> && !
isDiagonal( matrix_ ) ) {
537 if( !IsDiagonal_v<MT2> )
573inline typename DiagonalMatrix<MT,SO,false>::Reference
574 DiagonalMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
579 return Reference( matrix_, i, j );
603inline typename DiagonalMatrix<MT,SO,false>::ConstReference
604 DiagonalMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
const
634inline typename DiagonalMatrix<MT,SO,false>::Reference
635 DiagonalMatrix<MT,SO,false>::at(
size_t i,
size_t j )
668inline typename DiagonalMatrix<MT,SO,false>::ConstReference
669 DiagonalMatrix<MT,SO,false>::at(
size_t i,
size_t j )
const
697inline typename DiagonalMatrix<MT,SO,false>::Iterator
698 DiagonalMatrix<MT,SO,false>::begin(
size_t i )
700 return matrix_.begin(i);
720inline typename DiagonalMatrix<MT,SO,false>::ConstIterator
721 DiagonalMatrix<MT,SO,false>::begin(
size_t i )
const
723 return matrix_.begin(i);
743inline typename DiagonalMatrix<MT,SO,false>::ConstIterator
744 DiagonalMatrix<MT,SO,false>::cbegin(
size_t i )
const
746 return matrix_.cbegin(i);
766inline typename DiagonalMatrix<MT,SO,false>::Iterator
767 DiagonalMatrix<MT,SO,false>::end(
size_t i )
769 return matrix_.end(i);
789inline typename DiagonalMatrix<MT,SO,false>::ConstIterator
790 DiagonalMatrix<MT,SO,false>::end(
size_t i )
const
792 return matrix_.end(i);
812inline typename DiagonalMatrix<MT,SO,false>::ConstIterator
813 DiagonalMatrix<MT,SO,false>::cend(
size_t i )
const
815 return matrix_.cend(i);
856inline DiagonalMatrix<MT,SO,false>&
859 const InitializerMatrix<ElementType> tmp( list, list.size() );
888inline DiagonalMatrix<MT,SO,false>&
889 DiagonalMatrix<MT,SO,false>::operator=(
const DiagonalMatrix& rhs )
891 matrix_ = rhs.matrix_;
911inline DiagonalMatrix<MT,SO,false>&
912 DiagonalMatrix<MT,SO,false>::operator=( DiagonalMatrix&& rhs )
noexcept
914 matrix_ = std::move( rhs.matrix_ );
940template<
typename MT2
942inline auto DiagonalMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
943 -> DisableIf_t< IsComputation_v<MT2>, DiagonalMatrix& >
945 if( !IsDiagonal_v<MT2> && !
isDiagonal( *rhs ) ) {
951 if( !IsDiagonal_v<MT2> )
978template<
typename MT2
980inline auto DiagonalMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
981 -> EnableIf_t< IsComputation_v<MT2>, DiagonalMatrix& >
983 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
987 if( IsDiagonal_v<MT2> ) {
997 matrix_ = std::move( tmp );
1000 if( !IsDiagonal_v<MT2> )
1025template<
typename MT
1027template<
typename MT2
1029inline auto DiagonalMatrix<MT,SO,false>::operator+=(
const Matrix<MT2,SO2>& rhs )
1030 -> DisableIf_t< IsComputation_v<MT2>, DiagonalMatrix& >
1032 if( !IsDiagonal_v<MT2> && !
isDiagonal( *rhs ) ) {
1038 if( !IsDiagonal_v<MT2> )
1063template<
typename MT
1065template<
typename MT2
1067inline auto DiagonalMatrix<MT,SO,false>::operator+=(
const Matrix<MT2,SO2>& rhs )
1068 -> EnableIf_t< IsComputation_v<MT2>, DiagonalMatrix& >
1070 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1074 if( IsDiagonal_v<MT2> ) {
1078 const ResultType_t<MT2> tmp( *rhs );
1087 if( !IsDiagonal_v<MT2> )
1112template<
typename MT
1114template<
typename MT2
1116inline auto DiagonalMatrix<MT,SO,false>::operator-=(
const Matrix<MT2,SO2>& rhs )
1117 -> DisableIf_t< IsComputation_v<MT2>, DiagonalMatrix& >
1119 if( !IsDiagonal_v<MT2> && !
isDiagonal( *rhs ) ) {
1125 if( !IsDiagonal_v<MT2> )
1150template<
typename MT
1152template<
typename MT2
1154inline auto DiagonalMatrix<MT,SO,false>::operator-=(
const Matrix<MT2,SO2>& rhs )
1155 -> EnableIf_t< IsComputation_v<MT2>, DiagonalMatrix& >
1157 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1161 if( IsDiagonal_v<MT2> ) {
1165 const ResultType_t<MT2> tmp( *rhs );
1174 if( !IsDiagonal_v<MT2> )
1197template<
typename MT
1199template<
typename MT2
1201inline auto DiagonalMatrix<MT,SO,false>::operator%=(
const Matrix<MT2,SO2>& rhs )
1204 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1210 if( !IsDiagonal_v<MT2> )
1236template<
typename MT
1238inline size_t DiagonalMatrix<MT,SO,false>::rows() const noexcept
1240 return matrix_.rows();
1252template<
typename MT
1254inline size_t DiagonalMatrix<MT,SO,false>::columns() const noexcept
1256 return matrix_.columns();
1268template<
typename MT
1270inline size_t DiagonalMatrix<MT,SO,false>::capacity() const noexcept
1272 return matrix_.capacity();
1290template<
typename MT
1292inline size_t DiagonalMatrix<MT,SO,false>::capacity(
size_t i )
const noexcept
1294 return matrix_.capacity(i);
1306template<
typename MT
1308inline size_t DiagonalMatrix<MT,SO,false>::nonZeros()
const
1310 return matrix_.nonZeros();
1328template<
typename MT
1330inline size_t DiagonalMatrix<MT,SO,false>::nonZeros(
size_t i )
const
1332 return matrix_.nonZeros(i);
1344template<
typename MT
1346inline void DiagonalMatrix<MT,SO,false>::reset()
1367template<
typename MT
1369inline void DiagonalMatrix<MT,SO,false>::reset(
size_t i )
1385template<
typename MT
1387inline void DiagonalMatrix<MT,SO,false>::clear()
1413template<
typename MT
1415void DiagonalMatrix<MT,SO,false>::resize(
size_t n,
bool preserve )
1421 matrix_.resize( n, n, preserve );
1438template<
typename MT
1440inline void DiagonalMatrix<MT,SO,false>::reserve(
size_t nonzeros )
1442 matrix_.reserve( nonzeros );
1462template<
typename MT
1464inline void DiagonalMatrix<MT,SO,false>::reserve(
size_t i,
size_t nonzeros )
1466 matrix_.reserve( i, nonzeros );
1483template<
typename MT
1485inline void DiagonalMatrix<MT,SO,false>::trim()
1505template<
typename MT
1507inline void DiagonalMatrix<MT,SO,false>::trim(
size_t i )
1525template<
typename MT
1527inline void DiagonalMatrix<MT,SO,false>::shrinkToFit()
1529 matrix_.shrinkToFit();
1542template<
typename MT
1544inline void DiagonalMatrix<MT,SO,false>::swap( DiagonalMatrix& m )
noexcept
1548 swap( matrix_, m.matrix_ );
1560template<
typename MT
1562inline void DiagonalMatrix<MT,SO,false>::resetNonDiagonal()
1566 for(
size_t i=0UL; i<
rows(); ++i ) {
1567 erase( matrix_, i, matrix_.begin( i ), matrix_.lowerBound( i, i ) );
1568 erase( matrix_, i, matrix_.upperBound( i, i ), matrix_.end( i ) );
1599template<
typename MT
1601inline typename DiagonalMatrix<MT,SO,false>::Iterator
1602 DiagonalMatrix<MT,SO,false>::set(
size_t i,
size_t j,
const ElementType& value )
1608 return matrix_.set( i, j, value );
1631template<
typename MT
1633inline typename DiagonalMatrix<MT,SO,false>::Iterator
1634 DiagonalMatrix<MT,SO,false>::insert(
size_t i,
size_t j,
const ElementType& value )
1640 return matrix_.insert( i, j, value );
1696template<
typename MT
1698inline void DiagonalMatrix<MT,SO,false>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
1704 matrix_.append( i, j, value, check );
1724template<
typename MT
1726inline void DiagonalMatrix<MT,SO,false>::finalize(
size_t i )
1728 matrix_.finalize( i );
1752template<
typename MT
1754inline void DiagonalMatrix<MT,SO,false>::erase(
size_t i,
size_t j )
1758 erase( matrix_, i, j );
1776template<
typename MT
1778inline typename DiagonalMatrix<MT,SO,false>::Iterator
1779 DiagonalMatrix<MT,SO,false>::erase(
size_t i, Iterator pos )
1783 return erase( matrix_, i, pos );
1803template<
typename MT
1805inline typename DiagonalMatrix<MT,SO,false>::Iterator
1806 DiagonalMatrix<MT,SO,false>::erase(
size_t i, Iterator first, Iterator last )
1810 return erase( matrix_, i, first, last );
1838template<
typename MT
1840template<
typename Pred >
1841inline void DiagonalMatrix<MT,SO,false>::erase( Pred predicate )
1845 erase( matrix_, predicate );
1881template<
typename MT
1883template<
typename Pred >
1884inline void DiagonalMatrix<MT,SO,false>::erase(
size_t i, Iterator first, Iterator last, Pred predicate )
1888 erase( matrix_, i, first, last, predicate );
1920template<
typename MT
1922inline typename DiagonalMatrix<MT,SO,false>::Iterator
1923 DiagonalMatrix<MT,SO,false>::find(
size_t i,
size_t j )
1925 return matrix_.find( i, j );
1947template<
typename MT
1949inline typename DiagonalMatrix<MT,SO,false>::ConstIterator
1950 DiagonalMatrix<MT,SO,false>::find(
size_t i,
size_t j )
const
1952 return matrix_.find( i, j );
1974template<
typename MT
1976inline typename DiagonalMatrix<MT,SO,false>::Iterator
1977 DiagonalMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
1979 return matrix_.lowerBound( i, j );
2001template<
typename MT
2003inline typename DiagonalMatrix<MT,SO,false>::ConstIterator
2004 DiagonalMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
const
2006 return matrix_.lowerBound( i, j );
2028template<
typename MT
2030inline typename DiagonalMatrix<MT,SO,false>::Iterator
2031 DiagonalMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
2033 return matrix_.upperBound( i, j );
2055template<
typename MT
2057inline typename DiagonalMatrix<MT,SO,false>::ConstIterator
2058 DiagonalMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
const
2060 return matrix_.upperBound( i, j );
2092template<
typename MT
2094template<
typename Other >
2095inline DiagonalMatrix<MT,SO,false>&
2096 DiagonalMatrix<MT,SO,false>::scale(
const Other& scalar )
2098 matrix_.scale( scalar );
2123template<
typename MT
2125inline bool DiagonalMatrix<MT,SO,false>::isIntact() const noexcept
2154template<
typename MT
2156template<
typename Other >
2157inline bool DiagonalMatrix<MT,SO,false>::canAlias(
const Other* alias )
const noexcept
2159 return matrix_.canAlias( alias );
2176template<
typename MT
2178template<
typename Other >
2179inline bool DiagonalMatrix<MT,SO,false>::isAliased(
const Other* alias )
const noexcept
2181 return matrix_.isAliased( alias );
2198template<
typename MT
2200inline bool DiagonalMatrix<MT,SO,false>::canSMPAssign() const noexcept
2202 return matrix_.canSMPAssign();
Header file for auxiliary alias declarations.
Header file for run time assertion macros.
Constraint on the data type.
Header file for the DiagonalProxy class.
Header file for the EnableIf class template.
Constraint on the data type.
Header file for the IsComputation type trait class.
Header file for the isDefault shim.
Header file for the IsDiagonal type trait.
Header file for the IsSquare type trait.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of the base template of the DiagonalMatrix.
Matrix adapter for diagonal matrices.
Definition BaseTemplate.h:565
Base class for sparse matrices.
Definition SparseMatrix.h:77
Initializer list type of the Blaze library.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
Header file for the SparseMatrix base class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.
Definition Volatile.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.
Definition Pointer.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.
Definition Const.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.
Definition Reference.h:79
decltype(auto) decldiag(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as diagonal.
Definition DMatDeclDiagExpr.h:978
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition DenseMatrix.h:386
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition DenseMatrix.h:448
bool isDiagonal(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is diagonal.
Definition DenseMatrix.h:2456
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
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE(T)
Constraint on the data type.
Definition View.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_COMPUTATION_TYPE(T)
Constraint on the data type.
Definition Computation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition SparseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.
Definition Lower.h:81
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.
Definition Resizable.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE(T)
Constraint on the data type.
Definition Transformation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition StorageOrder.h:63
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.
Definition Size.h:176
constexpr void clear(Matrix< MT, SO > &matrix)
Clearing the given matrix.
Definition Matrix.h:960
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:628
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition Matrix.h:644
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition Matrix.h:730
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:562
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition Matrix.h:692
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition Matrix.h:806
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition Matrix.h:660
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
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:584
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition Matrix.h:518
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition Matrix.h:1169
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition Matrix.h:1383
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition Assert.h:101
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition Assert.h:117
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition Set.h:75
MT::Iterator upperBound(SparseMatrix< MT, SO > &sm, size_t i, size_t j)
Returns an iterator to the first index greater than the given index.
Definition SparseMatrix.h:244
MT::Iterator lowerBound(SparseMatrix< MT, SO > &sm, size_t i, size_t j)
Returns an iterator to the first index not less than the given index.
Definition SparseMatrix.h:194
MT::Iterator find(SparseMatrix< MT, SO > &sm, size_t i, size_t j)
Searches for a specific matrix element.
Definition SparseMatrix.h:144
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition StaticAssert.h:112
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:138
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition Exception.h:235
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:175
Header file for the exception macros of the math module.
Header file for the extended initializer_list functionality.
Constraints on the storage order of matrix types.
Header file for the Size type trait.
Header file for utility functions for sparse matrices.
Header file for basic type definitions.