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_< IsExpression<VT>, VT, VT& >;
115 using This = Elements<VT,TF,
false,CEAs...>;
117 using BaseType = SparseVector<This,TF>;
118 using ViewedType = VT;
135 template<
typename IteratorType >
136 class ElementsElement
137 :
private SparseElement
146 inline ElementsElement( IteratorType pos,
size_t index )
158 template<
typename T >
inline ElementsElement& operator=(
const T& v ) {
170 template<
typename T >
inline ElementsElement&
operator+=(
const T& v ) {
182 template<
typename T >
inline ElementsElement&
operator-=(
const T& v ) {
194 template<
typename T >
inline ElementsElement&
operator*=(
const T& v ) {
206 template<
typename T >
inline ElementsElement&
operator/=(
const T& v ) {
217 inline const ElementsElement* operator->()
const {
227 inline decltype(
auto) value()
const {
228 return pos_->value();
237 inline size_t index()
const {
253 template<
typename ET
254 ,
typename IteratorType >
255 class ElementsIterator
259 using IteratorCategory = std::forward_iterator_tag;
260 using ValueType = ElementsElement<IteratorType>;
261 using PointerType = ValueType;
262 using ReferenceType = ValueType;
263 using DifferenceType = ptrdiff_t;
266 using iterator_category = IteratorCategory;
267 using value_type = ValueType;
268 using pointer = PointerType;
269 using reference = ReferenceType;
270 using difference_type = DifferenceType;
276 inline ElementsIterator()
277 : elements_( nullptr )
289 inline ElementsIterator( ET*
elements,
size_t index )
290 : elements_( elements )
294 for( ; index_<elements_->size(); ++index_ ) {
295 pos_ = elements_->operand().find( elements_->idx(index_) );
296 if( pos_ != elements_->operand().end() )
break;
308 inline ElementsIterator( ET* elements,
size_t index, IteratorType pos )
309 : elements_( elements )
320 template<
typename ET2,
typename IteratorType2 >
321 inline ElementsIterator(
const ElementsIterator<ET2,IteratorType2>& it )
322 : elements_( it.elements_ )
323 , index_ ( it.index_ )
333 inline ElementsIterator& operator++() {
335 for( ; index_<elements_->size(); ++index_ ) {
336 pos_ = elements_->operand().find( elements_->idx(index_) );
337 if( pos_ != elements_->operand().end() )
break;
348 inline const ElementsIterator operator++(
int ) {
349 const ElementsIterator tmp( *
this );
361 return ReferenceType( pos_, index_ );
370 inline PointerType operator->()
const {
371 return PointerType( pos_, index_ );
381 inline bool operator==(
const ElementsIterator& rhs )
const {
382 return index_ == rhs.index_;
392 inline bool operator!=(
const ElementsIterator& rhs )
const {
393 return index_ != rhs.index_;
403 inline DifferenceType
operator-(
const ElementsIterator& rhs )
const {
404 size_t counter( 0UL );
405 for(
size_t j=rhs.index_; j<index_; ++j ) {
406 if( elements_->find( j ) != elements_->end() )
421 template<
typename VT2,
bool TF2,
bool DF2,
size_t... CEAs2 >
friend class Elements;
422 template<
typename ET2,
typename IteratorType2 >
friend class ElementsIterator;
429 using ConstIterator = ElementsIterator< const This, ConstIterator_<VT> >;
437 enum :
bool { smpAssignable =
false };
443 template<
typename... REAs >
444 explicit inline Elements( VT& vector, REAs... args );
446 inline Elements(
const Elements& ) =
default;
447 inline Elements( Elements&& ) =
default;
458 inline Reference operator[](
size_t index );
459 inline ConstReference operator[](
size_t index )
const;
461 inline ConstReference at(
size_t index )
const;
463 inline ConstIterator
begin ()
const;
464 inline ConstIterator
cbegin()
const;
466 inline ConstIterator
end ()
const;
467 inline ConstIterator
cend ()
const;
474 inline Elements& operator= ( initializer_list<ElementType> list );
475 inline Elements& operator= (
const Elements& rhs );
476 template<
typename VT2 >
inline Elements& operator= (
const Vector<VT2,TF>& rhs );
477 template<
typename VT2 >
inline Elements&
operator+=(
const Vector<VT2,TF>& rhs );
478 template<
typename VT2 >
inline Elements&
operator-=(
const Vector<VT2,TF>& rhs );
479 template<
typename VT2 >
inline Elements&
operator*=(
const Vector<VT2,TF>& rhs );
480 template<
typename VT2 >
inline Elements&
operator/=(
const DenseVector<VT2,TF>& rhs );
481 template<
typename VT2 >
inline Elements& operator%=(
const Vector<VT2,TF>& rhs );
488 using DataType::idces;
492 inline VT& operand() noexcept;
493 inline const VT& operand() const noexcept;
495 inline
size_t capacity() const noexcept;
498 inline
void reserve(
size_t n );
507 inline
void append(
size_t index, const
ElementType& value,
bool check=false );
514 inline
void erase(
size_t index );
518 template< typename Pred, typename =
DisableIf_< IsIntegral<Pred> > >
519 inline
void erase( Pred predicate );
521 template< typename Pred >
529 inline
Iterator find (
size_t index );
530 inline ConstIterator find (
size_t index ) const;
531 inline
Iterator lowerBound(
size_t index );
532 inline ConstIterator lowerBound(
size_t index ) const;
533 inline
Iterator upperBound(
size_t index );
534 inline ConstIterator upperBound(
size_t index ) const;
541 template< typename Other > inline Elements& scale( const Other& scalar );
548 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
549 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
551 inline
bool canSMPAssign() const noexcept;
553 template< typename VT2 > inline
void assign ( const DenseVector <VT2,TF>& rhs );
554 template< typename VT2 > inline
void assign ( const SparseVector<VT2,TF>& rhs );
555 template< typename VT2 > inline
void addAssign( const Vector<VT2,TF>& rhs );
556 template< typename VT2 > inline
void subAssign( const Vector<VT2,TF>& rhs );
601 template< typename VT
604 template< typename... REAs >
605 inline Elements<VT,TF,false,CEAs...>::Elements( VT& vector, REAs... args )
606 : DataType( args... )
609 if( !Contains< TypeList<REAs...>,
Unchecked >::value ) {
610 for(
size_t i=0UL; i<
size(); ++i ) {
611 if( vector_.size() <= idx(i) ) {
639 template<
typename VT
642 inline typename Elements<VT,TF,
false,CEAs...>
::Reference 643 Elements<VT,TF,false,CEAs...>::operator[](
size_t index )
646 return vector_[idx(index)];
662 template<
typename VT
666 Elements<VT,TF,false,CEAs...>::operator[](
size_t index )
const 669 return const_cast<const VT&
>( vector_ )[idx(index)];
686 template<
typename VT
689 inline typename Elements<VT,TF,
false,CEAs...>
::Reference 690 Elements<VT,TF,false,CEAs...>::at(
size_t index )
692 if( index >=
size() ) {
695 return (*
this)[index];
712 template<
typename VT
716 Elements<VT,TF,false,CEAs...>::at(
size_t index )
const 718 if( index >=
size() ) {
721 return (*
this)[index];
735 template<
typename VT
738 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 755 template<
typename VT
775 template<
typename VT
795 template<
typename VT
798 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 815 template<
typename VT
835 template<
typename VT
871 template<
typename VT
874 inline Elements<VT,TF,
false,CEAs...>&
875 Elements<VT,TF,false,CEAs...>::operator=( initializer_list<ElementType> list )
879 if( list.size() >
size() ) {
883 const InitializerVector<ElementType,TF> tmp( list,
size() );
885 if( IsRestricted<VT>::value ) {
886 for(
size_t i=0UL; i<
size(); ++i ) {
887 if( !trySet( vector_, idx(i), tmp[i] ) ) {
893 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
917 template<
typename VT
920 inline Elements<VT,TF,
false,CEAs...>&
921 Elements<VT,TF,false,CEAs...>::operator=(
const Elements& rhs )
928 if( &rhs ==
this || ( &vector_ == &rhs.vector_ && idces() == rhs.idces() ) )
931 if(
size() != rhs.size() ) {
935 if( IsRestricted<VT>::value ) {
936 for(
size_t i=0UL; i<
size(); ++i ) {
937 if( !trySet( vector_, idx(i), rhs[i] ) ) {
943 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
945 if( rhs.canAlias( &vector_ ) ) {
973 template<
typename VT
976 template<
typename VT2 >
977 inline Elements<VT,TF,
false,CEAs...>&
978 Elements<VT,TF,false,CEAs...>::operator=(
const Vector<VT2,TF>& rhs )
989 using Right = If_< IsRestricted<VT>, CompositeType_<VT2>,
const VT2& >;
992 if( IsRestricted<VT>::value ) {
993 for(
size_t i=0UL; i<
size(); ++i ) {
994 if( !trySet( vector_, idx(i), right[i] ) ) {
1000 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1002 if( IsReference<Right>::value || right.canAlias( &vector_ ) ) {
1003 const ResultType_<VT2> tmp( right );
1004 assign( left, tmp );
1007 assign( left, right );
1030 template<
typename VT
1033 template<
typename VT2 >
1034 inline Elements<VT,TF,
false,CEAs...>&
1037 using blaze::addAssign;
1046 using Right = If_< IsRestricted<VT>, CompositeType_<VT2>,
const VT2& >;
1047 Right right( ~rhs );
1049 if( IsRestricted<VT>::value ) {
1050 for(
size_t i=0UL; i<
size(); ++i ) {
1051 if( !tryAdd( vector_, idx(i), right[i] ) ) {
1057 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1059 if( IsReference<Right>::value && right.canAlias( &vector_ ) ) {
1060 const ResultType_<VT2> tmp( right );
1061 addAssign( left, tmp );
1064 addAssign( left, right );
1087 template<
typename VT
1090 template<
typename VT2 >
1091 inline Elements<VT,TF,
false,CEAs...>&
1094 using blaze::subAssign;
1103 using Right = If_< IsRestricted<VT>, CompositeType_<VT2>,
const VT2& >;
1104 Right right( ~rhs );
1106 if( IsRestricted<VT>::value ) {
1107 for(
size_t i=0UL; i<
size(); ++i ) {
1108 if( !trySub( vector_, idx(i), right[i] ) ) {
1114 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1116 if( IsReference<Right>::value && right.canAlias( &vector_ ) ) {
1117 const ResultType_<VT2> tmp( right );
1118 subAssign( left, tmp );
1121 subAssign( left, right );
1145 template<
typename VT
1148 template<
typename VT2 >
1149 inline Elements<VT,TF,
false,CEAs...>&
1152 using blaze::assign;
1158 using MultType = MultTrait_< ResultType, ResultType_<VT2> >;
1167 const MultType tmp( *
this * (~rhs) );
1169 if( IsRestricted<VT>::value ) {
1170 for(
size_t i=0UL; i<
size(); ++i ) {
1171 if( !trySet( vector_, idx(i), tmp[i] ) ) {
1177 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1179 assign( left, tmp );
1201 template<
typename VT
1204 template<
typename VT2 >
1205 inline Elements<VT,TF,
false,CEAs...>&
1208 using blaze::assign;
1215 using DivType = DivTrait_< ResultType, ResultType_<VT2> >;
1225 const DivType tmp( *
this / (~rhs) );
1227 if( IsRestricted<VT>::value ) {
1228 for(
size_t i=0UL; i<
size(); ++i ) {
1229 if( !trySet( vector_, idx(i), tmp[i] ) ) {
1235 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1237 assign( left, tmp );
1260 template<
typename VT
1263 template<
typename VT2 >
1264 inline Elements<VT,TF,
false,CEAs...>&
1265 Elements<VT,TF,false,CEAs...>::operator%=(
const Vector<VT2,TF>& rhs )
1267 using blaze::assign;
1272 using CrossType = CrossTrait_< ResultType, ResultType_<VT2> >;
1278 if(
size() != 3UL || (~rhs).
size() != 3UL ) {
1282 const CrossType tmp( *
this % (~rhs) );
1284 if( IsRestricted<VT>::value ) {
1285 for(
size_t i=0UL; i<
size(); ++i ) {
1286 if( !trySet( vector_, idx(i), tmp[i] ) ) {
1292 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1294 assign( left, tmp );
1318 template<
typename VT
1321 inline VT& Elements<VT,TF,false,CEAs...>::operand() noexcept
1335 template<
typename VT
1338 inline const VT& Elements<VT,TF,false,CEAs...>::operand() const noexcept
1352 template<
typename VT
1357 return nonZeros() + vector_.capacity() - vector_.nonZeros();
1372 template<
typename VT
1377 size_t counter( 0UL );
1378 for( ConstIterator element=
begin(); element!=
end(); ++element ) {
1393 template<
typename VT
1398 for(
size_t i=0UL; i<
size(); ++i )
1399 vector_.erase( idx(i) );
1415 template<
typename VT
1418 void Elements<VT,TF,false,CEAs...>::reserve(
size_t n )
1420 const size_t current(
capacity() );
1423 vector_.reserve( vector_.capacity() + n - current );
1450 template<
typename VT
1453 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 1456 return Iterator(
this, index, vector_.set( idx(index), value ) );
1475 template<
typename VT
1478 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 1479 Elements<VT,TF,false,CEAs...>::insert(
size_t index,
const ElementType& value )
1481 return Iterator(
this, index, vector_.insert( idx(index), value ) );
1512 template<
typename VT
1515 inline void Elements<VT,TF,false,CEAs...>::append(
size_t index,
const ElementType& value,
bool check )
1517 if( !check || !isDefault<strict>( value ) )
1518 vector_.insert( idx(index), value );
1541 template<
typename VT
1544 inline void Elements<VT,TF,false,CEAs...>::erase(
size_t index )
1546 vector_.erase( idx(index) );
1561 template<
typename VT
1564 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 1565 Elements<VT,TF,false,CEAs...>::erase(
Iterator pos )
1567 const size_t index( pos.index_ );
1569 if( index ==
size() )
1572 vector_.erase( pos.pos_ );
1573 return Iterator(
this, index+1UL );
1589 template<
typename VT
1592 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 1595 for( ; first!=last; ++first ) {
1596 vector_.erase( first.pos_ );
1599 return Iterator(
this, last.index_ );
1628 template<
typename VT
1631 template<
typename Pred
1633 inline void Elements<VT,TF,false,CEAs...>::erase( Pred predicate )
1635 erase(
begin(),
end(), predicate );
1667 template<
typename VT
1670 template<
typename Pred >
1671 inline void Elements<VT,TF,false,CEAs...>::erase(
Iterator first,
Iterator last, Pred predicate )
1673 for( ; first!=last; ++first ) {
1674 if( predicate( first->value() ) )
1675 vector_.erase( first.pos_ );
1704 template<
typename VT
1707 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 1708 Elements<VT,TF,false,CEAs...>::find(
size_t index )
1710 const Iterator_<VT> pos( vector_.find( idx(index) ) );
1712 if( pos != vector_.end() )
1713 return Iterator(
this, index, pos );
1735 template<
typename VT
1739 Elements<VT,TF,false,CEAs...>::find(
size_t index )
const 1741 const ConstIterator_<VT> pos( vector_.find( idx(index) ) );
1743 if( pos != vector_.end() )
1765 template<
typename VT
1768 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 1769 Elements<VT,TF,false,CEAs...>::lowerBound(
size_t index )
1771 for( ; index<
size(); ++index ) {
1772 const Iterator_<VT> pos( vector_.find( idx(index) ) );
1773 if( pos != vector_.end() )
1774 return Iterator(
this, index, pos );
1795 template<
typename VT
1799 Elements<VT,TF,false,CEAs...>::lowerBound(
size_t index )
const 1801 for( ; index<
size(); ++index ) {
1802 const ConstIterator_<VT> pos( vector_.find( idx(index) ) );
1803 if( pos != vector_.end() )
1825 template<
typename VT
1828 inline typename Elements<VT,TF,
false,CEAs...>
::Iterator 1829 Elements<VT,TF,false,CEAs...>::upperBound(
size_t index )
1831 while( (++index) <
size() ) {
1832 const Iterator_<VT> pos( vector_.find( idx(index) ) );
1833 if( pos != vector_.end() )
1834 return Iterator(
this, index, pos );
1855 template<
typename VT
1859 Elements<VT,TF,false,CEAs...>::upperBound(
size_t index )
const 1861 while( (++index) <
size() ) {
1862 const ConstIterator_<VT> pos( vector_.find( idx(index) ) );
1863 if( pos != vector_.end() )
1891 template<
typename VT
1894 template<
typename Other >
1895 inline Elements<VT,TF,
false,CEAs...>&
1896 Elements<VT,TF,false,CEAs...>::scale(
const Other& scalar )
1899 element->value() *= scalar;
1925 template<
typename VT
1928 template<
typename Other >
1929 inline bool Elements<VT,TF,false,CEAs...>::canAlias(
const Other* alias )
const noexcept
1931 return vector_.isAliased( alias );
1948 template<
typename VT
1951 template<
typename Other >
1952 inline bool Elements<VT,TF,false,CEAs...>::isAliased(
const Other* alias )
const noexcept
1954 return vector_.isAliased( alias );
1972 template<
typename VT
1975 template<
typename VT2 >
1976 inline void Elements<VT,TF,false,CEAs...>::assign(
const DenseVector<VT2,TF>& rhs )
1980 using RT = If_< IsComputation<VT2>, ElementType_<VT>,
const ElementType_<VT2>& >;
1982 reserve( (~rhs).
size() );
1984 for(
size_t i=0UL; i<
size(); ++i ) {
1985 RT value( (~rhs)[i] );
1986 if( !isDefault<strict>( value ) )
1987 vector_.set( idx(i), std::move( value ) );
1988 else vector_.erase( idx(i) );
2007 template<
typename VT
2010 template<
typename VT2 >
2011 inline void Elements<VT,TF,false,CEAs...>::assign(
const SparseVector<VT2,TF>& rhs )
2015 using RT = If_< IsComputation<VT2>, ElementType_<VT>,
const ElementType_<VT2>& >;
2019 for( ConstIterator_<VT2> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
2020 for( ; i<element->index(); ++i )
2021 vector_.erase( idx(i) );
2022 RT value( element->value() );
2023 if( !isDefault<strict>( value ) )
2024 vector_.set( idx(i), std::move( value ) );
2025 else vector_.erase( idx(i) );
2028 for( ; i<
size(); ++i ) {
2029 vector_.erase( idx(i) );
2048 template<
typename VT
2051 template<
typename VT2 >
2052 inline void Elements<VT,TF,false,CEAs...>::addAssign(
const Vector<VT2,TF>& rhs )
2054 using AddType = AddTrait_< ResultType, ResultType_<VT2> >;
2061 const AddType tmp(
serial( *
this + (~rhs) ) );
2080 template<
typename VT
2083 template<
typename VT2 >
2084 inline void Elements<VT,TF,false,CEAs...>::subAssign(
const Vector<VT2,TF>& rhs )
2086 using SubType = SubTrait_< ResultType, ResultType_<VT2> >;
2093 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
Header file for the subtraction trait.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:522
Header file for basic type definitions.
Header file for the SparseVector base class.
Header file for the View base class.
Header file for the serial shim.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
#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:3076
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:364
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3074
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
Header file for the IsIntegral type trait.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3078
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3083
Constraint on the data type.
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:560
Header file for the decltype(auto) workaround.
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:733
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3084
typename ElementsTrait< VT, CEAs... >::Type ElementsTrait_
Auxiliary alias declaration for the ElementsTrait type trait.The ElementsTrait_ alias declaration pro...
Definition: ElementsTrait.h:144
#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.
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:474
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:408
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:3082
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:3075
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3079
#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:3085
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:250
#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:134
Constraint on the data type.
Header file for the exception macros of the math module.
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:430
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:8893
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
Constraint on the data type.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:76
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
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
#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:3080
#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
EnableIf_< IsNumeric< ST >, MT &> operator/=(DenseMatrix< MT, SO > &mat, ST scalar)
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:655
Header file for the IsComputation type trait class.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3081
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
Header file for the implementation of the ElementsData class template.
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
EnableIf_< IsNumeric< ST >, MT &> operator*=(DenseMatrix< MT, SO > &mat, ST scalar)
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:593
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.