35 #ifndef _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_SPARSE_H_ 36 #define _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_SPARSE_H_ 110 template<
typename MT
112 class UniUpperMatrix<MT,SO,false>
113 :
public SparseMatrix< UniUpperMatrix<MT,SO,false>, SO >
117 using OT = OppositeType_t<MT>;
118 using TT = TransposeType_t<MT>;
119 using ET = ElementType_t<MT>;
124 using This = UniUpperMatrix<MT,SO,false>;
125 using BaseType = SparseMatrix<This,SO>;
126 using ResultType = This;
127 using OppositeType = UniUpperMatrix<OT,!SO,false>;
128 using TransposeType = UniLowerMatrix<TT,!SO,false>;
129 using ElementType = ET;
130 using ReturnType = ReturnType_t<MT>;
131 using CompositeType =
const This&;
132 using Reference = UniUpperProxy<MT>;
133 using ConstReference = ConstReference_t<MT>;
134 using ConstIterator = ConstIterator_t<MT>;
140 template<
typename NewType >
143 using Other = UniUpperMatrix< typename MT::template Rebind<NewType>::Other >;
150 template<
size_t NewM
154 using Other = UniUpperMatrix< typename MT::template Resize<NewM,NewN>::Other >;
165 using IteratorType = Iterator_t<MT>;
167 using IteratorCategory = std::forward_iterator_tag;
168 using ValueType = UniUpperElement<MT>;
169 using PointerType = ValueType;
170 using ReferenceType = ValueType;
171 using DifferenceType = ptrdiff_t;
174 using iterator_category = IteratorCategory;
175 using value_type = ValueType;
176 using pointer = PointerType;
177 using reference = ReferenceType;
178 using difference_type = DifferenceType;
196 inline Iterator( IteratorType pos,
size_t index )
207 inline Iterator& operator++() {
218 inline const Iterator operator++(
int ) {
219 const Iterator tmp( *
this );
231 return ReferenceType( pos_, pos_->index() == index_ );
240 inline PointerType operator->()
const {
241 return PointerType( pos_, pos_->index() == index_ );
250 inline operator ConstIterator()
const {
261 inline bool operator==(
const Iterator& rhs )
const {
262 return pos_ == rhs.pos_;
272 inline bool operator!=(
const Iterator& rhs )
const {
273 return !( *
this == rhs );
283 inline DifferenceType
operator-(
const Iterator& rhs )
const {
284 return pos_ - rhs.pos_;
293 inline IteratorType base()
const {
308 static constexpr
bool smpAssignable =
false;
314 explicit inline UniUpperMatrix();
315 explicit inline UniUpperMatrix(
size_t n );
316 explicit inline UniUpperMatrix(
size_t n,
size_t nonzeros );
317 explicit inline UniUpperMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
318 inline UniUpperMatrix( initializer_list< initializer_list<ElementType> > list );
320 inline UniUpperMatrix(
const UniUpperMatrix& m );
321 inline UniUpperMatrix( UniUpperMatrix&& m ) noexcept;
323 template<
typename MT2,
bool SO2 >
324 inline UniUpperMatrix(
const Matrix<MT2,SO2>& m );
331 ~UniUpperMatrix() =
default;
338 inline Reference operator()(
size_t i,
size_t j );
339 inline ConstReference operator()(
size_t i,
size_t j )
const;
340 inline Reference at(
size_t i,
size_t j );
341 inline ConstReference at(
size_t i,
size_t j )
const;
342 inline Iterator
begin (
size_t i );
343 inline ConstIterator
begin (
size_t i )
const;
344 inline ConstIterator
cbegin(
size_t i )
const;
345 inline Iterator
end (
size_t i );
346 inline ConstIterator
end (
size_t i )
const;
347 inline ConstIterator
cend (
size_t i )
const;
354 inline UniUpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
356 inline UniUpperMatrix& operator=(
const UniUpperMatrix& rhs );
357 inline UniUpperMatrix& operator=( UniUpperMatrix&& rhs ) noexcept;
359 template<
typename MT2,
bool SO2 >
360 inline auto operator=(
const Matrix<MT2,SO2>& rhs )
361 -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
363 template<
typename MT2,
bool SO2 >
364 inline auto operator=(
const Matrix<MT2,SO2>& rhs )
365 -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
367 template<
typename MT2,
bool SO2 >
368 inline auto operator+=(
const Matrix<MT2,SO2>& rhs )
369 -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
371 template<
typename MT2,
bool SO2 >
372 inline auto operator+=(
const Matrix<MT2,SO2>& rhs )
373 -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
375 template<
typename MT2,
bool SO2 >
376 inline auto operator-=(
const Matrix<MT2,SO2>& rhs )
377 -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
379 template<
typename MT2,
bool SO2 >
380 inline auto operator-=(
const Matrix<MT2,SO2>& rhs )
381 -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
383 template<
typename MT2,
bool SO2 >
384 inline auto operator%=(
const Matrix<MT2,SO2>& rhs ) -> UniUpperMatrix&;
391 inline size_t rows() const noexcept;
392 inline
size_t columns() const noexcept;
393 inline
size_t capacity() const noexcept;
394 inline
size_t capacity(
size_t i ) const noexcept;
396 inline
size_t nonZeros(
size_t i ) const;
398 inline
void reset(
size_t i );
400 inline
void resize (
size_t n,
bool preserve=true );
401 inline
void reserve(
size_t nonzeros );
402 inline
void reserve(
size_t i,
size_t nonzeros );
404 inline
void trim(
size_t i );
406 inline
void swap( UniUpperMatrix& m ) noexcept;
408 static inline constexpr
size_t maxNonZeros() noexcept;
409 static inline constexpr
size_t maxNonZeros(
size_t n ) noexcept;
416 inline Iterator
set (
size_t i,
size_t j, const ElementType& value );
417 inline Iterator insert (
size_t i,
size_t j, const ElementType& value );
418 inline
void append (
size_t i,
size_t j, const ElementType& value,
bool check=false );
419 inline
void finalize(
size_t i );
426 inline
void erase(
size_t i,
size_t j );
427 inline Iterator erase(
size_t i, Iterator pos );
428 inline Iterator erase(
size_t i, Iterator first, Iterator last );
430 template< typename Pred >
431 inline
void erase( Pred predicate );
433 template< typename Pred >
434 inline
void erase(
size_t i, Iterator first, Iterator last, Pred predicate );
441 inline Iterator find (
size_t i,
size_t j );
442 inline ConstIterator find (
size_t i,
size_t j ) const;
443 inline Iterator lowerBound(
size_t i,
size_t j );
444 inline ConstIterator lowerBound(
size_t i,
size_t j ) const;
445 inline Iterator upperBound(
size_t i,
size_t j );
446 inline ConstIterator upperBound(
size_t i,
size_t j ) const;
453 inline
bool isIntact() const noexcept;
460 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
461 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
463 inline
bool canSMPAssign() const noexcept;
471 inline
void resetLower();
483 template< typename MT2,
bool SO2,
bool DF2 >
484 friend MT2& derestrict( UniUpperMatrix<MT2,SO2,DF2>& m );
523 template< typename MT
525 inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix()
542 template<
typename MT
544 inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix(
size_t n )
549 for(
size_t i=0UL; i<n; ++i ) {
550 matrix_.append( i, i, ElementType(1) );
551 matrix_.finalize( i );
570 template<
typename MT
572 inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix(
size_t n,
size_t nonzeros )
573 : matrix_( n, n,
max( nonzeros, n ) )
577 for(
size_t i=0UL; i<n; ++i ) {
578 matrix_.append( i, i, ElementType(1) );
579 matrix_.finalize( i );
602 template<
typename MT
604 inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
605 : matrix_( n, n, nonzeros )
609 for(
size_t i=0UL; i<n; ++i )
611 if( nonzeros[i] == 0UL ) {
615 matrix_.append( i, i, ElementType(1) );
616 matrix_.finalize( i );
649 template<
typename MT
651 inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix( initializer_list< initializer_list<ElementType> > list )
670 template<
typename MT
672 inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix(
const UniUpperMatrix& m )
673 : matrix_( m.matrix_ )
688 template<
typename MT
690 inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix( UniUpperMatrix&& m ) noexcept
691 : matrix_( std::move( m.matrix_ ) )
710 template<
typename MT
712 template<
typename MT2
714 inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix(
const Matrix<MT2,SO2>& m )
717 if( !IsUniUpper_v<MT2> && !
isUniUpper( matrix_ ) ) {
721 if( !IsUniUpper_v<MT2> )
755 template<
typename MT
757 inline typename UniUpperMatrix<MT,SO,false>::Reference
758 UniUpperMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
763 return Reference( matrix_, i, j );
785 template<
typename MT
787 inline typename UniUpperMatrix<MT,SO,false>::ConstReference
788 UniUpperMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
const 816 template<
typename MT
818 inline typename UniUpperMatrix<MT,SO,false>::Reference
819 UniUpperMatrix<MT,SO,false>::at(
size_t i,
size_t j )
850 template<
typename MT
852 inline typename UniUpperMatrix<MT,SO,false>::ConstReference
853 UniUpperMatrix<MT,SO,false>::at(
size_t i,
size_t j )
const 879 template<
typename MT
881 inline typename UniUpperMatrix<MT,SO,false>::Iterator
884 return Iterator( matrix_.begin(i), i );
902 template<
typename MT
904 inline typename UniUpperMatrix<MT,SO,false>::ConstIterator
907 return matrix_.begin(i);
925 template<
typename MT
927 inline typename UniUpperMatrix<MT,SO,false>::ConstIterator
930 return matrix_.cbegin(i);
948 template<
typename MT
950 inline typename UniUpperMatrix<MT,SO,false>::Iterator
953 return Iterator( matrix_.end(i), i );
971 template<
typename MT
973 inline typename UniUpperMatrix<MT,SO,false>::ConstIterator
976 return matrix_.end(i);
994 template<
typename MT
996 inline typename UniUpperMatrix<MT,SO,false>::ConstIterator
999 return matrix_.cend(i);
1038 template<
typename MT
1040 inline UniUpperMatrix<MT,SO,false>&
1041 UniUpperMatrix<MT,SO,false>::operator=( initializer_list< initializer_list<ElementType> > list )
1043 const InitializerMatrix<ElementType> tmp( list, list.size() );
1070 template<
typename MT
1072 inline UniUpperMatrix<MT,SO,false>&
1073 UniUpperMatrix<MT,SO,false>::operator=(
const UniUpperMatrix& rhs )
1075 matrix_ = rhs.matrix_;
1093 template<
typename MT
1095 inline UniUpperMatrix<MT,SO,false>&
1096 UniUpperMatrix<MT,SO,false>::operator=( UniUpperMatrix&& rhs ) noexcept
1098 matrix_ = std::move( rhs.matrix_ );
1122 template<
typename MT
1124 template<
typename MT2
1126 inline auto UniUpperMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1127 -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1129 if( IsStrictlyTriangular_v<MT2> || ( !IsUniUpper_v<MT2> && !
isUniUpper( ~rhs ) ) ) {
1135 if( !IsUniUpper_v<MT2> )
1160 template<
typename MT
1162 template<
typename MT2
1164 inline auto UniUpperMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1165 -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1167 if( IsStrictlyTriangular_v<MT2> || ( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) ) {
1171 if( IsUniUpper_v<MT2> ) {
1181 matrix_ = std::move( tmp );
1184 if( !IsUniUpper_v<MT2> )
1209 template<
typename MT
1211 template<
typename MT2
1214 -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1216 if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1223 if( !IsStrictlyUpper_v<MT2> )
1248 template<
typename MT
1250 template<
typename MT2
1253 -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1255 if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1256 ( IsSquare_v<MT2> && !
isSquare( ~rhs ) ) ) {
1260 if( IsStrictlyUpper_v<MT2> ) {
1264 const ResultType_t<MT2> tmp( ~rhs );
1273 if( !IsStrictlyUpper_v<MT2> )
1298 template<
typename MT
1300 template<
typename MT2
1303 -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1305 if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1312 if( !IsStrictlyUpper_v<MT2> )
1337 template<
typename MT
1339 template<
typename MT2
1342 -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1344 if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1345 ( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) ) {
1349 if( IsStrictlyUpper_v<MT2> ) {
1353 const ResultType_t<MT2> tmp( ~rhs );
1362 if( !IsStrictlyUpper_v<MT2> )
1387 template<
typename MT
1389 template<
typename MT2
1391 inline auto UniUpperMatrix<MT,SO,false>::operator%=(
const Matrix<MT2,SO2>& rhs )
1394 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1398 If_t< IsComputation_v<MT2>, ResultType_t<MT2>,
const MT2& > tmp( ~rhs );
1400 for(
size_t i=0UL; i<(~rhs).
rows(); ++i ) {
1401 if( !
isOne( tmp(i,i) ) ) {
1408 if( !IsUniUpper_v<MT2> )
1434 template<
typename MT
1438 return matrix_.rows();
1450 template<
typename MT
1454 return matrix_.columns();
1466 template<
typename MT
1470 return matrix_.capacity();
1488 template<
typename MT
1492 return matrix_.capacity(i);
1504 template<
typename MT
1508 return matrix_.nonZeros();
1526 template<
typename MT
1530 return matrix_.nonZeros(i);
1542 template<
typename MT
1547 for(
size_t j=1UL; j<
columns(); ++j ) {
1548 matrix_.erase( j, matrix_.begin(j), matrix_.lowerBound(j,j) );
1552 for(
size_t i=0UL; i<
rows(); ++i ) {
1553 matrix_.erase( i, matrix_.lowerBound(i,i+1UL), matrix_.end(i) );
1574 template<
typename MT
1579 matrix_.erase( i, matrix_.begin(i), matrix_.lowerBound(i,i) );
1582 matrix_.erase( i, matrix_.lowerBound(i,i+1UL), matrix_.end(i) );
1597 template<
typename MT
1603 if( IsResizable_v<MT> ) {
1629 template<
typename MT
1637 const size_t oldsize( matrix_.rows() );
1639 matrix_.resize( n, n, preserve );
1642 for(
size_t i=oldsize; i<n; ++i )
1643 matrix_.insert( i, i, ElementType(1) );
1661 template<
typename MT
1663 inline void UniUpperMatrix<MT,SO,false>::reserve(
size_t nonzeros )
1665 matrix_.reserve( nonzeros );
1685 template<
typename MT
1687 inline void UniUpperMatrix<MT,SO,false>::reserve(
size_t i,
size_t nonzeros )
1689 matrix_.reserve( i, nonzeros );
1706 template<
typename MT
1708 inline void UniUpperMatrix<MT,SO,false>::trim()
1728 template<
typename MT
1730 inline void UniUpperMatrix<MT,SO,false>::trim(
size_t i )
1748 template<
typename MT
1752 matrix_.shrinkToFit();
1765 template<
typename MT
1771 swap( matrix_, m.matrix_ );
1788 template<
typename MT
1790 inline constexpr
size_t UniUpperMatrix<MT,SO,false>::maxNonZeros() noexcept
1794 return maxNonZeros( Size_v<MT,0UL> );
1810 template<
typename MT
1812 inline constexpr
size_t UniUpperMatrix<MT,SO,false>::maxNonZeros(
size_t n ) noexcept
1814 return ( ( n + 1UL ) * n ) / 2UL;
1826 template<
typename MT
1828 inline void UniUpperMatrix<MT,SO,false>::resetLower()
1831 for(
size_t j=0UL; j<
columns(); ++j )
1832 matrix_.erase( j, matrix_.upperBound( j, j ), matrix_.end( j ) );
1835 for(
size_t i=1UL; i<
rows(); ++i )
1836 matrix_.erase( i, matrix_.begin( i ), matrix_.lowerBound( i, i ) );
1867 template<
typename MT
1869 inline typename UniUpperMatrix<MT,SO,false>::Iterator
1876 return Iterator( matrix_.set( i, j, value ), ( SO ? j : i ) );
1899 template<
typename MT
1901 inline typename UniUpperMatrix<MT,SO,false>::Iterator
1902 UniUpperMatrix<MT,SO,false>::insert(
size_t i,
size_t j,
const ElementType& value )
1908 return Iterator( matrix_.insert( i, j, value ), ( SO ? j : i ) );
1964 template<
typename MT
1966 inline void UniUpperMatrix<MT,SO,false>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
1972 if( !check || !isDefault<strict>( value ) )
1973 matrix_.insert( i, j, value );
1993 template<
typename MT
1995 inline void UniUpperMatrix<MT,SO,false>::finalize(
size_t i )
2023 template<
typename MT
2025 inline void UniUpperMatrix<MT,SO,false>::erase(
size_t i,
size_t j )
2031 matrix_.erase( i, j );
2051 template<
typename MT
2053 inline typename UniUpperMatrix<MT,SO,false>::Iterator
2054 UniUpperMatrix<MT,SO,false>::erase(
size_t i, Iterator pos )
2056 if( pos != matrix_.end(i) && pos->index() == i ) {
2060 return Iterator( matrix_.erase( i, pos.base() ), i );
2081 template<
typename MT
2083 inline typename UniUpperMatrix<MT,SO,false>::Iterator
2084 UniUpperMatrix<MT,SO,false>::erase(
size_t i, Iterator first, Iterator last )
2089 if( ( !SO && first.base() == matrix_.begin(i) ) ||
2090 ( SO && last.base() == matrix_.end(i) ) ) {
2094 return Iterator( matrix_.erase( i, first.base(), last.base() ), i );
2122 template<
typename MT
2124 template<
typename Pred >
2125 inline void UniUpperMatrix<MT,SO,false>::erase( Pred predicate )
2128 for(
size_t j=1UL; j<
columns(); ++j ) {
2129 matrix_.erase( j, matrix_.begin(j), matrix_.find(j,j), predicate );
2133 for(
size_t i=0UL; (i+1UL) <
rows(); ++i ) {
2134 matrix_.erase( i, matrix_.lowerBound(i,i+1UL), matrix_.end(i), predicate );
2172 template<
typename MT
2174 template<
typename Pred >
2175 inline void UniUpperMatrix<MT,SO,false>::erase(
size_t i, Iterator first, Iterator last, Pred predicate )
2180 if( ( !SO && first.base() == matrix_.begin(i) && predicate( ElementType(1) ) ) ||
2181 ( SO && last.base() == matrix_.end(i) && predicate( ElementType(1) ) ) ) {
2185 matrix_.erase( i, first.base(), last.base(), predicate );
2217 template<
typename MT
2219 inline typename UniUpperMatrix<MT,SO,false>::Iterator
2220 UniUpperMatrix<MT,SO,false>::find(
size_t i,
size_t j )
2222 return Iterator( matrix_.find( i, j ), ( SO ? j : i ) );
2244 template<
typename MT
2246 inline typename UniUpperMatrix<MT,SO,false>::ConstIterator
2247 UniUpperMatrix<MT,SO,false>::find(
size_t i,
size_t j )
const 2249 return matrix_.find( i, j );
2271 template<
typename MT
2273 inline typename UniUpperMatrix<MT,SO,false>::Iterator
2274 UniUpperMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
2276 return Iterator( matrix_.lowerBound( i, j ), ( SO ? j : i ) );
2298 template<
typename MT
2300 inline typename UniUpperMatrix<MT,SO,false>::ConstIterator
2301 UniUpperMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
const 2303 return matrix_.lowerBound( i, j );
2325 template<
typename MT
2327 inline typename UniUpperMatrix<MT,SO,false>::Iterator
2328 UniUpperMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
2330 return Iterator( matrix_.upperBound( i, j ), ( SO ? j : i ) );
2352 template<
typename MT
2354 inline typename UniUpperMatrix<MT,SO,false>::ConstIterator
2355 UniUpperMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
const 2357 return matrix_.upperBound( i, j );
2381 template<
typename MT
2412 template<
typename MT
2414 template<
typename Other >
2415 inline bool UniUpperMatrix<MT,SO,false>::canAlias(
const Other* alias )
const noexcept
2417 return matrix_.canAlias( alias );
2434 template<
typename MT
2436 template<
typename Other >
2437 inline bool UniUpperMatrix<MT,SO,false>::isAliased(
const Other* alias )
const noexcept
2439 return matrix_.isAliased( alias );
2456 template<
typename MT
2458 inline bool UniUpperMatrix<MT,SO,false>::canSMPAssign() const noexcept
2460 return matrix_.canSMPAssign();
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE(T)
Constraint on the data type.In case the given data type T is a transformation expression (i....
Definition: Transformation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type,...
Definition: Const.h:79
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Constraint on the data type.
Header file for auxiliary alias declarations.
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:432
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.The Size_v variable template provides a convenien...
Definition: Size.h:176
Constraint on the data type.
Constraint on the data type.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression,...
Definition: Assert.h:117
Header file for the IsUniUpper type trait.
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
Header file for basic type definitions.
constexpr const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:750
#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:63
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i....
Definition: Computation.h:81
Constraint on the data type.
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
Header file for all adaptor forward declarations.
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1001
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type,...
Definition: Volatile.h:79
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
Header file for the extended initializer_list functionality.
Constraint on the data type.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
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:482
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:416
Constraint on the data type.
Constraint on the data type.
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.
Header file for the implementation of a matrix representation of an initializer list.
Headerfile for the generic max algorithm.
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_CONSTRAINT_MUST_BE_STATIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a static data type,...
Definition: Static.h:61
decltype(auto) operator *(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:9091
#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:79
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:370
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:253
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.
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
#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:81
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1198
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
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:438
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
Header file for the isOne shim.
Header file for the UniUpperValue class.
#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,...
Definition: Symmetric.h:79
bool isStrictlyUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly upper triangular matrix.
Definition: DenseMatrix.h:2235
Header file for run time assertion macros.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNIFORM_TYPE(T)
Constraint on the data type.In case the given data type T is a uniform vector or matrix type,...
Definition: Uniform.h:81
Constraint on the data type.
Constraint on the data type.
#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:61
#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:81
#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,...
Definition: Reference.h:79
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:697
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:282
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
Constraint on the data type.
Header file for the UniUpperElement class.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE(T)
Constraint on the data type.In case the given data type T is a view type (i.e. a subvector,...
Definition: View.h:81
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(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:61
Header file for the IsComputation type trait class.
bool isUniUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper unitriangular matrix.
Definition: DenseMatrix.h:2148
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type,...
Definition: Hermitian.h:79
#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:112
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
Header file for the IsResizable type trait.
Header file for the Size type trait.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
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:61
Header file for the implementation of the base template of the UniUpperMatrix.
Header file for the clear shim.