35 #ifndef _BLAZE_MATH_VIEWS_ELEMENTS_SPARSE_H_ 36 #define _BLAZE_MATH_VIEWS_ELEMENTS_SPARSE_H_ 102 class Elements<VT,TF,false,CEAs...>
103 :
public View< SparseVector< Elements<VT,TF,false,CEAs...>, TF > >
104 ,
private ElementsData<CEAs...>
108 using DataType = ElementsData<CEAs...>;
109 using Operand = If_t< IsExpression_v<VT>, VT, VT& >;
119 using This = Elements<VT,TF,
false,CEAs...>;
121 using BaseType = SparseVector<This,TF>;
122 using ViewedType = VT;
139 template<
typename IteratorType >
140 class ElementsElement
141 :
private SparseElement
150 inline ElementsElement( IteratorType pos,
size_t index )
162 template<
typename T >
inline ElementsElement& operator=(
const T& v ) {
174 template<
typename T >
inline ElementsElement&
operator+=(
const T& v ) {
186 template<
typename T >
inline ElementsElement&
operator-=(
const T& v ) {
198 template<
typename T >
inline ElementsElement&
operator*=(
const T& v ) {
210 template<
typename T >
inline ElementsElement&
operator/=(
const T& v ) {
221 inline const ElementsElement* operator->()
const {
231 inline decltype(
auto) value()
const {
232 return pos_->value();
241 inline size_t index()
const {
257 template<
typename ET
258 ,
typename IteratorType >
259 class ElementsIterator
263 using IteratorCategory = std::forward_iterator_tag;
264 using ValueType = ElementsElement<IteratorType>;
265 using PointerType = ValueType;
266 using ReferenceType = ValueType;
267 using DifferenceType = ptrdiff_t;
270 using iterator_category = IteratorCategory;
271 using value_type = ValueType;
272 using pointer = PointerType;
273 using reference = ReferenceType;
274 using difference_type = DifferenceType;
280 inline ElementsIterator()
281 : elements_( nullptr )
293 inline ElementsIterator( ET*
elements,
size_t index )
298 for( ; index_<elements_->size(); ++index_ ) {
299 pos_ = elements_->operand().find( elements_->idx(index_) );
300 if( pos_ != elements_->operand().end() )
break;
312 inline ElementsIterator( ET*
elements,
size_t index, IteratorType pos )
324 template<
typename ET2,
typename IteratorType2 >
325 inline ElementsIterator(
const ElementsIterator<ET2,IteratorType2>& it )
326 : elements_( it.elements_ )
327 , index_ ( it.index_ )
337 inline ElementsIterator& operator++() {
339 for( ; index_<elements_->size(); ++index_ ) {
340 pos_ = elements_->operand().find( elements_->idx(index_) );
341 if( pos_ != elements_->operand().end() )
break;
352 inline const ElementsIterator operator++(
int ) {
353 const ElementsIterator tmp( *
this );
365 return ReferenceType( pos_, index_ );
374 inline PointerType operator->()
const {
375 return PointerType( pos_, index_ );
385 inline bool operator==(
const ElementsIterator& rhs )
const {
386 return index_ == rhs.index_;
396 inline bool operator!=(
const ElementsIterator& rhs )
const {
397 return index_ != rhs.index_;
407 inline DifferenceType
operator-(
const ElementsIterator& rhs )
const {
408 size_t counter( 0UL );
409 for(
size_t j=rhs.index_; j<index_; ++j ) {
410 if( elements_->find( j ) != elements_->end() )
425 template<
typename VT2,
bool TF2,
bool DF2,
typename... CEAs2 >
friend class Elements;
426 template<
typename ET2,
typename IteratorType2 >
friend class ElementsIterator;
433 using ConstIterator = ElementsIterator< const This, ConstIterator_t<VT> >;
447 template<
typename... REAs >
448 explicit inline Elements( VT& vector, REAs... args );
450 Elements(
const Elements& ) =
default;
451 Elements( Elements&& ) =
default;
458 ~Elements() =
default;
465 inline Reference operator[](
size_t index );
481 inline Elements& operator= ( initializer_list<ElementType> list );
482 inline Elements& operator= (
const Elements& rhs );
483 template<
typename VT2 >
inline Elements& operator= (
const Vector<VT2,TF>& rhs );
484 template<
typename VT2 >
inline Elements&
operator+=(
const Vector<VT2,TF>& rhs );
485 template<
typename VT2 >
inline Elements&
operator-=(
const Vector<VT2,TF>& rhs );
486 template<
typename VT2 >
inline Elements&
operator*=(
const Vector<VT2,TF>& rhs );
487 template<
typename VT2 >
inline Elements&
operator/=(
const DenseVector<VT2,TF>& rhs );
488 template<
typename VT2 >
inline Elements& operator%=(
const Vector<VT2,TF>& rhs );
495 using DataType::idces;
499 inline VT& operand() noexcept;
500 inline const VT& operand() const noexcept;
502 inline
size_t capacity() const noexcept;
505 inline
void reserve(
size_t n );
514 inline
void append(
size_t index, const
ElementType& value,
bool check=false );
521 inline
void erase(
size_t index );
526 inline
void erase( Pred predicate );
528 template< typename Pred >
536 inline
Iterator find (
size_t index );
538 inline
Iterator lowerBound(
size_t index );
540 inline
Iterator upperBound(
size_t index );
548 template< typename Other > inline Elements& scale( const Other& scalar );
555 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
556 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
558 inline
bool canSMPAssign() const noexcept;
560 template< typename VT2 > inline
void assign ( const DenseVector <VT2,TF>& rhs );
561 template< typename VT2 > inline
void assign ( const SparseVector<VT2,TF>& rhs );
562 template< typename VT2 > inline
void addAssign( const Vector<VT2,TF>& rhs );
563 template< typename VT2 > inline
void subAssign( const Vector<VT2,TF>& rhs );
608 template< typename VT
611 template< typename... REAs >
612 inline Elements<VT,TF,false,CEAs...>::Elements( VT& vector, REAs... args )
613 : DataType( args... )
617 for(
size_t i=0UL; i<
size(); ++i ) {
618 if( vector_.size() <= idx(i) ) {
646 template<
typename VT
649 inline typename Elements<VT,TF,
false,CEAs...>
::Reference 650 Elements<VT,TF,false,CEAs...>::operator[](
size_t index )
653 return vector_[idx(index)];
669 template<
typename VT
673 Elements<VT,TF,false,CEAs...>::operator[](
size_t index )
const 676 return const_cast<const VT&
>( vector_ )[idx(index)];
693 template<
typename VT
696 inline typename Elements<VT,TF,
false,CEAs...>
::Reference 697 Elements<VT,TF,false,CEAs...>::at(
size_t index )
699 if( index >=
size() ) {
702 return (*
this)[index];
719 template<
typename VT
723 Elements<VT,TF,false,CEAs...>::at(
size_t index )
const 725 if( index >=
size() ) {
728 return (*
this)[index];
742 template<
typename VT
745 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 762 template<
typename VT
782 template<
typename VT
802 template<
typename VT
805 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 822 template<
typename VT
842 template<
typename VT
878 template<
typename VT
881 inline Elements<VT,TF,
false,CEAs...>&
882 Elements<VT,TF,false,CEAs...>::operator=( initializer_list<ElementType> list )
886 if( list.size() >
size() ) {
890 const InitializerVector<ElementType,TF> tmp( list,
size() );
892 if( IsRestricted_v<VT> ) {
893 for(
size_t i=0UL; i<
size(); ++i ) {
894 if( !trySet( vector_, idx(i), tmp[i] ) ) {
900 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
924 template<
typename VT
927 inline Elements<VT,TF,
false,CEAs...>&
928 Elements<VT,TF,false,CEAs...>::operator=(
const Elements& rhs )
935 if( &rhs ==
this || ( &vector_ == &rhs.vector_ && compareIndices( *
this, rhs ) ) )
938 if(
size() != rhs.size() ) {
942 if( IsRestricted_v<VT> ) {
943 for(
size_t i=0UL; i<
size(); ++i ) {
944 if( !trySet( vector_, idx(i), rhs[i] ) ) {
950 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
952 if( rhs.canAlias( &vector_ ) ) {
980 template<
typename VT
983 template<
typename VT2 >
984 inline Elements<VT,TF,
false,CEAs...>&
985 Elements<VT,TF,false,CEAs...>::operator=(
const Vector<VT2,TF>& rhs )
996 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
999 if( IsRestricted_v<VT> ) {
1000 for(
size_t i=0UL; i<
size(); ++i ) {
1001 if( !trySet( vector_, idx(i), right[i] ) ) {
1007 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1009 if( IsReference_v<Right> || right.canAlias( &vector_ ) ) {
1010 const ResultType_t<VT2> tmp( right );
1011 assign( left, tmp );
1014 assign( left, right );
1037 template<
typename VT
1039 ,
typename... CEAs >
1040 template<
typename VT2 >
1041 inline Elements<VT,TF,
false,CEAs...>&
1044 using blaze::addAssign;
1053 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
1054 Right right( ~rhs );
1056 if( IsRestricted_v<VT> ) {
1057 for(
size_t i=0UL; i<
size(); ++i ) {
1058 if( !tryAdd( vector_, idx(i), right[i] ) ) {
1064 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1066 if( IsReference_v<Right> && right.canAlias( &vector_ ) ) {
1067 const ResultType_t<VT2> tmp( right );
1068 addAssign( left, tmp );
1071 addAssign( left, right );
1094 template<
typename VT
1096 ,
typename... CEAs >
1097 template<
typename VT2 >
1098 inline Elements<VT,TF,
false,CEAs...>&
1101 using blaze::subAssign;
1110 using Right = If_t< IsRestricted_v<VT>, CompositeType_t<VT2>,
const VT2& >;
1111 Right right( ~rhs );
1113 if( IsRestricted_v<VT> ) {
1114 for(
size_t i=0UL; i<
size(); ++i ) {
1115 if( !trySub( vector_, idx(i), right[i] ) ) {
1121 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1123 if( IsReference_v<Right> && right.canAlias( &vector_ ) ) {
1124 const ResultType_t<VT2> tmp( right );
1125 subAssign( left, tmp );
1128 subAssign( left, right );
1152 template<
typename VT
1154 ,
typename... CEAs >
1155 template<
typename VT2 >
1156 inline Elements<VT,TF,
false,CEAs...>&
1159 using blaze::assign;
1165 using MultType = MultTrait_t< ResultType, ResultType_t<VT2> >;
1174 const MultType tmp( *
this * (~rhs) );
1176 if( IsRestricted_v<VT> ) {
1177 for(
size_t i=0UL; i<
size(); ++i ) {
1178 if( !trySet( vector_, idx(i), tmp[i] ) ) {
1184 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1186 assign( left, tmp );
1208 template<
typename VT
1210 ,
typename... CEAs >
1211 template<
typename VT2 >
1212 inline Elements<VT,TF,
false,CEAs...>&
1215 using blaze::assign;
1222 using DivType = DivTrait_t< ResultType, ResultType_t<VT2> >;
1232 const DivType tmp( *
this / (~rhs) );
1234 if( IsRestricted_v<VT> ) {
1235 for(
size_t i=0UL; i<
size(); ++i ) {
1236 if( !trySet( vector_, idx(i), tmp[i] ) ) {
1242 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1244 assign( left, tmp );
1267 template<
typename VT
1269 ,
typename... CEAs >
1270 template<
typename VT2 >
1271 inline Elements<VT,TF,
false,CEAs...>&
1272 Elements<VT,TF,false,CEAs...>::operator%=(
const Vector<VT2,TF>& rhs )
1274 using blaze::assign;
1279 using CrossType = CrossTrait_t< ResultType, ResultType_t<VT2> >;
1285 if(
size() != 3UL || (~rhs).
size() != 3UL ) {
1289 const CrossType tmp( *
this % (~rhs) );
1291 if( IsRestricted_v<VT> ) {
1292 for(
size_t i=0UL; i<
size(); ++i ) {
1293 if( !trySet( vector_, idx(i), tmp[i] ) ) {
1299 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1301 assign( left, tmp );
1325 template<
typename VT
1327 ,
typename... CEAs >
1328 inline VT& Elements<VT,TF,false,CEAs...>::operand() noexcept
1342 template<
typename VT
1344 ,
typename... CEAs >
1345 inline const VT& Elements<VT,TF,false,CEAs...>::operand() const noexcept
1359 template<
typename VT
1361 ,
typename... CEAs >
1364 return nonZeros() + vector_.capacity() - vector_.nonZeros();
1379 template<
typename VT
1381 ,
typename... CEAs >
1384 size_t counter( 0UL );
1400 template<
typename VT
1402 ,
typename... CEAs >
1405 for(
size_t i=0UL; i<
size(); ++i )
1406 vector_.erase( idx(i) );
1422 template<
typename VT
1424 ,
typename... CEAs >
1425 void Elements<VT,TF,false,CEAs...>::reserve(
size_t n )
1427 const size_t current(
capacity() );
1430 vector_.reserve( vector_.capacity() + n - current );
1457 template<
typename VT
1459 ,
typename... CEAs >
1460 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 1463 return Iterator(
this, index, vector_.set( idx(index), value ) );
1482 template<
typename VT
1484 ,
typename... CEAs >
1485 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 1486 Elements<VT,TF,false,CEAs...>::insert(
size_t index,
const ElementType& value )
1488 return Iterator(
this, index, vector_.insert( idx(index), value ) );
1519 template<
typename VT
1521 ,
typename... CEAs >
1522 inline void Elements<VT,TF,false,CEAs...>::append(
size_t index,
const ElementType& value,
bool check )
1524 if( !check || !isDefault<strict>( value ) )
1525 vector_.insert( idx(index), value );
1548 template<
typename VT
1550 ,
typename... CEAs >
1551 inline void Elements<VT,TF,false,CEAs...>::erase(
size_t index )
1553 vector_.erase( idx(index) );
1568 template<
typename VT
1570 ,
typename... CEAs >
1571 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 1572 Elements<VT,TF,false,CEAs...>::erase(
Iterator pos )
1574 const size_t index( pos.index_ );
1576 if( index ==
size() )
1579 vector_.erase( pos.pos_ );
1580 return Iterator(
this, index+1UL );
1596 template<
typename VT
1598 ,
typename... CEAs >
1599 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 1602 for( ; first!=last; ++first ) {
1603 vector_.erase( first.pos_ );
1606 return Iterator(
this, last.index_ );
1635 template<
typename VT
1637 ,
typename... CEAs >
1638 template<
typename Pred
1640 inline void Elements<VT,TF,false,CEAs...>::erase( Pred predicate )
1642 erase(
begin(),
end(), predicate );
1674 template<
typename VT
1676 ,
typename... CEAs >
1677 template<
typename Pred >
1678 inline void Elements<VT,TF,false,CEAs...>::erase(
Iterator first,
Iterator last, Pred predicate )
1680 for( ; first!=last; ++first ) {
1681 if( predicate( first->value() ) )
1682 vector_.erase( first.pos_ );
1711 template<
typename VT
1713 ,
typename... CEAs >
1714 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 1715 Elements<VT,TF,false,CEAs...>::find(
size_t index )
1717 const Iterator_t<VT> pos( vector_.find( idx(index) ) );
1719 if( pos != vector_.end() )
1720 return Iterator(
this, index, pos );
1742 template<
typename VT
1744 ,
typename... CEAs >
1746 Elements<VT,TF,false,CEAs...>::find(
size_t index )
const 1748 const ConstIterator_t<VT> pos( vector_.find( idx(index) ) );
1750 if( pos != vector_.end() )
1772 template<
typename VT
1774 ,
typename... CEAs >
1775 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 1776 Elements<VT,TF,false,CEAs...>::lowerBound(
size_t index )
1778 for( ; index<
size(); ++index ) {
1779 const Iterator_t<VT> pos( vector_.find( idx(index) ) );
1780 if( pos != vector_.end() )
1781 return Iterator(
this, index, pos );
1802 template<
typename VT
1804 ,
typename... CEAs >
1806 Elements<VT,TF,false,CEAs...>::lowerBound(
size_t index )
const 1808 for( ; index<
size(); ++index ) {
1809 const ConstIterator_t<VT> pos( vector_.find( idx(index) ) );
1810 if( pos != vector_.end() )
1832 template<
typename VT
1834 ,
typename... CEAs >
1835 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 1836 Elements<VT,TF,false,CEAs...>::upperBound(
size_t index )
1838 while( (++index) <
size() ) {
1839 const Iterator_t<VT> pos( vector_.find( idx(index) ) );
1840 if( pos != vector_.end() )
1841 return Iterator(
this, index, pos );
1862 template<
typename VT
1864 ,
typename... CEAs >
1866 Elements<VT,TF,false,CEAs...>::upperBound(
size_t index )
const 1868 while( (++index) <
size() ) {
1869 const ConstIterator_t<VT> pos( vector_.find( idx(index) ) );
1870 if( pos != vector_.end() )
1898 template<
typename VT
1900 ,
typename... CEAs >
1901 template<
typename Other >
1902 inline Elements<VT,TF,
false,CEAs...>&
1903 Elements<VT,TF,false,CEAs...>::scale(
const Other& scalar )
1906 element->value() *= scalar;
1932 template<
typename VT
1934 ,
typename... CEAs >
1935 template<
typename Other >
1936 inline bool Elements<VT,TF,false,CEAs...>::canAlias(
const Other* alias )
const noexcept
1938 return vector_.isAliased( alias );
1955 template<
typename VT
1957 ,
typename... CEAs >
1958 template<
typename Other >
1959 inline bool Elements<VT,TF,false,CEAs...>::isAliased(
const Other* alias )
const noexcept
1961 return vector_.isAliased( alias );
1979 template<
typename VT
1981 ,
typename... CEAs >
1982 template<
typename VT2 >
1983 inline void Elements<VT,TF,false,CEAs...>::assign(
const DenseVector<VT2,TF>& rhs )
1987 using RT = If_t< IsComputation_v<VT2>, ElementType_t<VT>,
const ElementType_t<VT2>& >;
1989 reserve( (~rhs).
size() );
1991 for(
size_t i=0UL; i<
size(); ++i ) {
1992 RT value( (~rhs)[i] );
1993 if( !isDefault<strict>( value ) )
1994 vector_.set( idx(i), std::move( value ) );
1995 else vector_.erase( idx(i) );
2014 template<
typename VT
2016 ,
typename... CEAs >
2017 template<
typename VT2 >
2018 inline void Elements<VT,TF,false,CEAs...>::assign(
const SparseVector<VT2,TF>& rhs )
2022 using RT = If_t< IsComputation_v<VT2>, ElementType_t<VT>,
const ElementType_t<VT2>& >;
2026 for( ConstIterator_t<VT2> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
2027 for( ; i<element->index(); ++i )
2028 vector_.erase( idx(i) );
2029 RT value( element->value() );
2030 if( !isDefault<strict>( value ) )
2031 vector_.set( idx(i), std::move( value ) );
2032 else vector_.erase( idx(i) );
2035 for( ; i<
size(); ++i ) {
2036 vector_.erase( idx(i) );
2055 template<
typename VT
2057 ,
typename... CEAs >
2058 template<
typename VT2 >
2059 inline void Elements<VT,TF,false,CEAs...>::addAssign(
const Vector<VT2,TF>& rhs )
2061 using AddType = AddTrait_t< ResultType, ResultType_t<VT2> >;
2068 const AddType tmp(
serial( *
this + (~rhs) ) );
2087 template<
typename VT
2089 ,
typename... CEAs >
2090 template<
typename VT2 >
2091 inline void Elements<VT,TF,false,CEAs...>::subAssign(
const Vector<VT2,TF>& rhs )
2093 using SubType = SubTrait_t< ResultType, ResultType_t<VT2> >;
2100 const SubType tmp(
serial( *
this - (~rhs) ) );
#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.
Header file for the blaze::checked and blaze::unchecked instances.
#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
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:354
Header file for the subtraction 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
Header file for the SparseVector base class.
Header file for the View base class.
Header file for the serial shim.
#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
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3077
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
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
Header file for the IsIntegral type trait.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3079
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
Constraint on the data type.
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 decltype(auto) workaround.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a transposition expression (i...
Definition: TransExpr.h:81
Header file for the extended initializer_list functionality.
Header file for the elements trait.
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
Header file for the DisableIf class template.
Header file for the multiplication trait.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3083
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
Header file for the implementation of a vector representation of an initializer list.
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3080
#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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
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
constexpr bool Contains_v
Auxiliary variable template for the Contains type trait.The Contains_v variable template provides a c...
Definition: Contains.h:139
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ELEMENTS_TYPE(T)
Constraint on the data type.In case the given data type T is an element selection (i...
Definition: Elements.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional vector type...
Definition: SparseVector.h:61
Constraint on the data type.
Header file for the SparseElement base class.
Header file for the implementation of the Elements base template.
Constraint on the data type.
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:135
Constraint on the data type.
Header file for the exception macros of the math module.
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
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:8908
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
Constraint on the data type.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the IsConst type trait.
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Header file for the relaxation flag types.
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
Header file for the Unique class template.
Check< false > Unchecked
Type of the blaze::unchecked instance.blaze::Unchecked is the type of the blaze::unchecked instance...
Definition: Check.h:96
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
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
Header file for the IsReference type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:61
Header file for the IsComputation type trait class.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3082
auto operator*=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:290
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
Header file for the implementation of the ElementsData class template.
constexpr bool IsIntegral_v
Auxiliary variable template for the IsIntegral type trait.The IsIntegral_v variable template provides...
Definition: IsIntegral.h:95
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
Header file for the IsRestricted type trait.
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:63
#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
Header file for the IsExpression type trait class.