35 #ifndef _BLAZE_MATH_SPARSE_COMPRESSEDVECTOR_H_ 36 #define _BLAZE_MATH_SPARSE_COMPRESSEDVECTOR_H_ 204 template<
typename Type
205 ,
bool TF = defaultTransposeFlag >
226 explicit Element() =
default;
227 Element(
const Element& rhs ) =
default;
228 Element( Element&& rhs ) =
default;
232 inline Element&
operator=(
const Element& rhs )
234 this->value_ = rhs.value_;
238 inline Element&
operator=( Element&& rhs )
240 this->value_ = std::move( rhs.value_ );
244 template<
typename Other >
245 inline auto operator=(
const Other& rhs )
248 this->value_ = rhs.value();
252 template<
typename Other >
255 IsRValueReference_v<Other&&>, Element& >
257 this->value_ = std::move( rhs.value() );
261 template<
typename Other >
269 template<
typename Other >
272 IsRValueReference_v<Other&&>, Element& >
274 this->value_ = std::move( v );
304 template<
typename NewType >
313 template<
size_t NewN >
353 inline
Reference operator[](
size_t index ) noexcept;
387 inline
size_t size() const noexcept;
388 inline
size_t capacity() const noexcept;
392 inline
void resize(
size_t n,
bool preserve=true );
402 inline
Iterator set (
size_t index, const Type& value );
404 inline
void append(
size_t index, const Type& value,
bool check=false );
411 inline
void erase(
size_t index );
416 inline
void erase( Pred predicate );
418 template< typename Pred >
438 template< typename Other > inline
CompressedVector& scale( const Other& scalar );
445 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
446 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
511 template< typename Type
527 template<
typename Type
543 template<
typename Type
560 template<
typename Type
586 template<
typename Type
593 for(
const Type& element : list ) {
594 if( !isDefault<strict>( element ) )
610 template<
typename Type
626 template<
typename Type
647 template<
typename Type
649 template<
typename VT >
665 template<
typename Type
667 template<
typename VT >
689 template<
typename Type
717 template<
typename Type
735 template<
typename Type
744 if( pos ==
end_ || pos->index_ != index )
764 template<
typename Type
769 if( index >= size_ ) {
772 return (*
this)[index];
787 template<
typename Type
792 if( index >= size_ ) {
795 return (*
this)[index];
805 template<
typename Type
819 template<
typename Type
834 template<
typename Type
849 template<
typename Type
863 template<
typename Type
878 template<
typename Type
912 template<
typename Type
919 resize( list.size(), false );
924 for(
const Type& element : list ) {
925 if( !isDefault<strict>( element ) )
926 append( i, element );
944 template<
typename Type
951 if( &rhs ==
this )
return *
this;
953 const size_t nonzeros( rhs.
nonZeros() );
956 Iterator newBegin( allocate<Element>( nonzeros ) );
957 end_ = castDown( std::copy( rhs.
begin_, rhs.
end_, castUp( newBegin ) ) );
980 template<
typename Type
994 rhs.begin_ =
nullptr;
1011 template<
typename Type
1013 template<
typename VT >
1017 using blaze::assign;
1019 if( (~rhs).canAlias(
this ) ) {
1024 size_ = (~rhs).
size();
1026 assign( *
this, ~rhs );
1043 template<
typename Type
1045 template<
typename VT >
1049 using blaze::assign;
1056 size_ = (~rhs).
size();
1058 assign( *
this, ~rhs );
1076 template<
typename Type
1078 template<
typename VT >
1081 using blaze::addAssign;
1083 if( (~rhs).
size() != size_ ) {
1087 addAssign( *
this, ~rhs );
1104 template<
typename Type
1106 template<
typename VT >
1109 using blaze::subAssign;
1111 if( (~rhs).
size() != size_ ) {
1115 subAssign( *
this, ~rhs );
1133 template<
typename Type
1135 template<
typename VT >
1139 using blaze::multAssign;
1141 if( (~rhs).
size() != size_ ) {
1145 if( (~rhs).canAlias(
this ) ) {
1151 multAssign( *
this, tmp );
1170 template<
typename Type
1172 template<
typename VT >
1176 if( (~rhs).
size() != size_ ) {
1198 template<
typename Type
1200 template<
typename VT >
1203 using blaze::divAssign;
1205 if( (~rhs).
size() != size_ ) {
1209 if( (~rhs).canAlias(
this ) ) {
1215 divAssign( *
this, tmp );
1234 template<
typename Type
1236 template<
typename VT >
1239 using blaze::assign;
1250 if( size_ != 3UL || (~rhs).
size() != 3UL ) {
1254 const CrossType tmp( *
this % (~rhs) );
1256 assign( *
this, tmp );
1276 template<
typename Type
1290 template<
typename Type
1307 template<
typename Type
1321 template<
typename Type
1337 template<
typename Type
1361 template<
typename Type
1366 end_ = lowerBound( n );
1386 template<
typename Type
1393 const size_t newCapacity( n );
1396 Iterator newBegin = allocate<Element>( newCapacity );
1417 template<
typename Type
1434 template<
typename Type
1440 swap( size_, sv.size_ );
1456 template<
typename Type
1464 nonzeros =
max( nonzeros, 7UL );
1465 nonzeros =
min( nonzeros, size_ );
1482 template<
typename Type
1487 return static_cast<Iterator>( it );
1500 template<
typename Type
1529 template<
typename Type
1536 const Iterator pos( lowerBound( index ) );
1538 if( pos !=
end_ && pos->index_ == index ) {
1539 pos->value() = value;
1542 else return insert( pos, index, value );
1559 template<
typename Type
1566 const Iterator pos( lowerBound( index ) );
1568 if( pos !=
end_ && pos->index_ == index ) {
1572 return insert( pos, index, value );
1586 template<
typename Type
1594 std::move_backward( pos,
end_, castUp(
end_+1 ) );
1595 pos->value_ = value;
1596 pos->index_ = index;
1602 size_t newCapacity( extendCapacity() );
1604 Iterator newBegin = allocate<Element>( newCapacity );
1605 Iterator tmp = castDown( std::move(
begin_, pos, castUp( newBegin ) ) );
1606 tmp->value_ = value;
1607 tmp->index_ = index;
1608 end_ = castDown( std::move( pos,
end_, castUp( tmp+1 ) ) );
1644 template<
typename Type
1652 end_->value_ = value;
1654 if( !check || !isDefault<strict>(
end_->value_ ) ) {
1655 end_->index_ = index;
1678 template<
typename Type
1684 const Iterator pos( find( index ) );
1686 end_ = castDown( std::move( pos+1,
end_, castUp( pos ) ) );
1699 template<
typename Type
1707 end_ = castDown( std::move( pos+1,
end_, castUp( pos ) ) );
1722 template<
typename Type
1732 end_ = castDown( std::move( last,
end_, castUp( first ) ) );
1759 template<
typename Type
1761 template<
typename Pred
1765 end_ = castDown( std::remove_if( castUp(
begin_ ), castUp(
end_ ),
1766 [predicate=predicate](
const ElementBase& element ) {
1767 return predicate( element.
value() );
1796 template<
typename Type
1798 template<
typename Pred >
1805 const auto pos = std::remove_if( castUp( first ), castUp( last ),
1806 [predicate=predicate](
const ElementBase& element ) {
1807 return predicate( element.
value() );
1810 end_ = castDown( std::move( last,
end_, pos ) );
1836 template<
typename Type
1840 return const_cast<Iterator>(
const_cast<const This&
>( *this ).
find( index ) );
1858 template<
typename Type
1863 if( pos !=
end_ && pos->index_ == index )
1882 template<
typename Type
1904 template<
typename Type
1909 return std::lower_bound(
begin_,
end_, index,
1910 [](
const Element& element,
size_t i )
1912 return element.index() < i;
1930 template<
typename Type
1952 template<
typename Type
1957 return std::upper_bound(
begin_,
end_, index,
1958 [](
size_t i,
const Element& element )
1960 return i < element.index();
1991 template<
typename Type
1993 template<
typename Other >
1996 for(
auto element=
begin_; element!=
end_; ++element )
1997 element->value_ *= scalar;
2021 template<
typename Type
2023 template<
typename Other >
2026 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2041 template<
typename Type
2043 template<
typename Other >
2046 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2061 template<
typename Type
2081 template<
typename Type
2083 template<
typename VT >
2089 size_t nonzeros( 0UL );
2091 for(
size_t i=0UL; i<size_; ++i )
2094 reserve( extendCapacity() );
2096 end_->value_ = (~rhs)[i];
2098 if( !isDefault<strict>(
end_->value_ ) ) {
2119 template<
typename Type
2121 template<
typename VT >
2133 for(
auto element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2134 append( element->index(), element->value() );
2150 template<
typename Type
2152 template<
typename VT >
2163 const AddType tmp(
serial( *
this + (~rhs) ) );
2181 template<
typename Type
2183 template<
typename VT >
2205 template<
typename Type
2207 template<
typename VT >
2218 const SubType tmp(
serial( *
this - (~rhs) ) );
2236 template<
typename Type
2238 template<
typename VT >
2260 template<
typename Type
2262 template<
typename VT >
2269 for(
auto element=
begin_; element!=
end_; ++element ) {
2270 element->value_ *= (~rhs)[element->index_];
2287 template<
typename Type
2289 template<
typename VT >
2296 for(
auto element=
begin_; element!=
end_; ++element ) {
2297 element->value_ /= (~rhs)[element->index_];
2314 template<
typename Type,
bool TF >
2317 template<
typename Type,
bool TF >
2320 template<
bool RF,
typename Type,
bool TF >
2323 template<
typename Type,
bool TF >
2326 template<
typename Type,
bool TF >
2339 template<
typename Type
2355 template<
typename Type
2393 return ( v.
size() == 0UL );
2416 template<
typename Type
2420 return ( v.nonZeros() <= v.capacity() );
2433 template<
typename Type
2452 template<
typename T,
bool TF >
2453 struct IsResizable< CompressedVector<T,TF> >
2470 template<
typename T,
bool TF >
2471 struct IsShrinkable< CompressedVector<T,TF> >
2488 template<
typename T1,
typename T2 >
2489 struct AddTraitEval2< T1, T2
2492 using ET1 = ElementType_t<T1>;
2493 using ET2 = ElementType_t<T2>;
2495 using Type = CompressedVector< AddTrait_t<ET1,ET2>, TransposeFlag_v<T1> >;
2511 template<
typename T1,
typename T2 >
2512 struct SubTraitEval2< T1, T2
2515 using ET1 = ElementType_t<T1>;
2516 using ET2 = ElementType_t<T2>;
2518 using Type = CompressedVector< SubTrait_t<ET1,ET2>, TransposeFlag_v<T1> >;
2534 template<
typename T1,
typename T2 >
2535 struct MultTraitEval2< T1, T2
2538 using ET1 = ElementType_t<T1>;
2540 using Type = CompressedVector< MultTrait_t<ET1,T2>, TransposeFlag_v<T1> >;
2543 template<
typename T1,
typename T2 >
2544 struct MultTraitEval2< T1, T2
2547 using ET2 = ElementType_t<T2>;
2549 using Type = CompressedVector< MultTrait_t<T1,ET2>, TransposeFlag_v<T2> >;
2552 template<
typename T1,
typename T2 >
2553 struct MultTraitEval2< T1, T2
2555 ( IsColumnVector_v<T1> && IsColumnVector_v<T2> ) ) &&
2556 ( IsSparseVector_v<T1> || IsSparseVector_v<T2> ) > >
2558 using ET1 = ElementType_t<T1>;
2559 using ET2 = ElementType_t<T2>;
2561 using Type = CompressedVector< MultTrait_t<ET1,ET2>, TransposeFlag_v<T1> >;
2564 template<
typename T1,
typename T2 >
2565 struct MultTraitEval2< T1, T2
2567 IsSparseVector_v<T2> &&
2568 IsColumnVector_v<T2> > >
2570 using ET1 = ElementType_t<T1>;
2571 using ET2 = ElementType_t<T2>;
2573 using Type = CompressedVector< MultTrait_t<ET1,ET2>,
false >;
2576 template<
typename T1,
typename T2 >
2577 struct MultTraitEval2< T1, T2
2579 IsRowVector_v<T1> &&
2580 IsSparseMatrix_v<T2> > >
2582 using ET1 = ElementType_t<T1>;
2583 using ET2 = ElementType_t<T2>;
2585 using Type = CompressedVector< MultTrait_t<ET1,ET2>,
true >;
2601 template<
typename T1,
typename T2 >
2602 struct DivTraitEval2< T1, T2
2605 using ET1 = ElementType_t<T1>;
2607 using Type = CompressedVector< DivTrait_t<ET1,T2>, TransposeFlag_v<T1> >;
2610 template<
typename T1,
typename T2 >
2611 struct DivTraitEval2< T1, T2
2614 using ET1 = ElementType_t<T1>;
2615 using ET2 = ElementType_t<T2>;
2617 using Type = CompressedVector< DivTrait_t<ET1,ET2>, TransposeFlag_v<T1> >;
2633 template<
typename T,
typename OP >
2634 struct UnaryMapTraitEval2< T, OP
2637 using ET = ElementType_t<T>;
2639 using Type = CompressedVector< MapTrait_t<ET,OP>, TransposeFlag_v<T> >;
2655 template<
typename T1,
bool TF,
typename T2 >
2656 struct HighType< CompressedVector<T1,TF>, CompressedVector<T2,TF> >
2658 using Type = CompressedVector< typename HighType<T1,T2>::Type, TF >;
2674 template<
typename T1,
bool TF,
typename T2 >
2675 struct LowType< CompressedVector<T1,TF>, CompressedVector<T2,TF> >
2677 using Type = CompressedVector< typename LowType<T1,T2>::Type, TF >;
2693 template<
typename VT,
size_t I,
size_t N >
2694 struct SubvectorTraitEval2< VT, I, N
2697 using Type = CompressedVector< RemoveConst_t< ElementType_t<VT> >, TransposeFlag_v<VT> >;
2713 template<
typename VT,
size_t N >
2714 struct ElementsTraitEval2< VT, N
2717 using Type = CompressedVector< RemoveConst_t< ElementType_t<VT> >, TransposeFlag_v<VT> >;
2733 template<
typename MT,
size_t I >
2734 struct RowTraitEval2< MT, I
2737 using Type = CompressedVector< RemoveConst_t< ElementType_t<MT> >,
true >;
2753 template<
typename MT,
size_t I >
2754 struct ColumnTraitEval2< MT, I
2757 using Type = CompressedVector< RemoveConst_t< ElementType_t<MT> >,
false >;
2773 template<
typename MT, ptrdiff_t I >
2774 struct BandTraitEval2< MT, I
2777 using Type = CompressedVector< RemoveConst_t< ElementType_t<MT> >, defaultTransposeFlag >;
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h: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
Header file for auxiliary alias declarations.
Headerfile for the generic min algorithm.
#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
typename SubTrait< T1, T2 >::Type SubTrait_t
Auxiliary alias declaration for the SubTrait class template.The SubTrait_t alias declaration provides...
Definition: SubTrait.h:238
constexpr bool IsSparseMatrix_v
Auxiliary variable template for the IsSparseMatrix type trait.The IsSparseMatrix_v variable template ...
Definition: IsSparseMatrix.h:139
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.
Header file for the SparseVector base class.
Header file for the row trait.
void assign(const DenseVector< VT, TF > &rhs)
Default implementation of the assignment of a dense vector.
Definition: CompressedVector.h:2084
Iterator upperBound(size_t index)
Returns an iterator to the first index greater then the given index.
Definition: CompressedVector.h:1933
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
Resize mechanism to obtain a CompressedVector with a different fixed number of elements.
Definition: CompressedVector.h:314
Header file for the IsSparseMatrix type trait.
Header file for the serial shim.
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
Access proxy for sparse, N-dimensional vectors.The VectorAccessProxy provides safe access to the elem...
Definition: VectorAccessProxy.h:101
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
Header file for the IsRowVector type trait.
Header file for the IsIntegral type trait.
IteratorBase castUp(Iterator it) const noexcept
Performs an up-cast of the given iterator.
Definition: CompressedVector.h:1503
Header file for the DenseVector base class.
void addAssign(const DenseVector< VT, TF > &rhs)
Default implementation of the addition assignment of a dense vector.
Definition: CompressedVector.h:2153
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
void clear()
Clearing the compressed vector.
Definition: CompressedVector.h:1339
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
Header file for memory allocation and deallocation functionality.
Header file for the extended initializer_list functionality.
size_t size_
The current size/dimension of the compressed vector.
Definition: CompressedVector.h:481
Header file for the elements trait.
Reference operator[](size_t index) noexcept
Subscript operator for the direct access to the compressed vector elements.
Definition: CompressedVector.h:720
Header file for the band trait.
Constraint on the data type.
size_t capacity_
The current capacity of the pointer array.
Definition: CompressedMatrix.h:3291
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Type ElementType
Type of the compressed vector elements.
Definition: CompressedVector.h:292
Headerfile for the generic max algorithm.
Header file for the ValueIndexPair class.
Rebind mechanism to obtain a CompressedVector with different data/element type.
Definition: CompressedVector.h:305
CompressedVector() noexcept
The default constructor for CompressedVector.
Definition: CompressedVector.h:529
Header file for the DisableIf class template.
Iterator set(size_t index, const Type &value)
Setting an element of the compressed vector.
Definition: CompressedVector.h:1532
Header file for the LowType type trait.
void subAssign(const DenseVector< VT, TF > &rhs)
Default implementation of the subtraction assignment of a dense vector.
Definition: CompressedVector.h:2208
void append(size_t index, const Type &value, bool check=false)
Appending an element to the compressed vector.
Definition: CompressedVector.h:1646
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
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5907
Header file for the IsFloatingPoint type trait.
Header file for the IsShrinkable type trait.
Header file for all forward declarations of the math module.
Iterator insert(size_t index, const Type &value)
Inserting an element into the compressed vector.
Definition: CompressedVector.h:1562
#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
Header file for the IsSMPAssignable type trait.
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1147
Iterator * end_
Pointers one past the last non-zero element of each column.
Definition: CompressedMatrix.h:3293
Iterator begin_
Pointer to the first non-zero element of the compressed vector.
Definition: CompressedVector.h:483
#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
size_t size() const noexcept
Returns the current size/dimension of the compressed vector.
Definition: CompressedVector.h:1278
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedVector.h:293
#define BLAZE_CONSTRAINT_MUST_HAVE_SAME_SIZE(T1, T2)
Constraint on the size of two data types.In case the types T1 and T2 don't have the same size...
Definition: SameSize.h:60
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
void shrinkToFit()
Requesting the removal of unused capacity.
Definition: CompressedVector.h:1419
Header file for the subvector trait.
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
size_t nonZeros() const
Returns the number of non-zero elements in the compressed vector.
Definition: CompressedVector.h:1309
Iterator castDown(IteratorBase it) const noexcept
Performs a down-cast of the given iterator.
Definition: CompressedVector.h:1485
Constraint on the data type.
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
typename AddTrait< T1, T2 >::Type AddTrait_t
Auxiliary alias declaration for the AddTrait class template.The AddTrait_t alias declaration provides...
Definition: AddTrait.h:238
Constraint on the data type.
constexpr bool IsSparseVector_v
Auxiliary variable template for the IsSparseVector type trait.The IsSparseVector_v variable template ...
Definition: IsSparseVector.h:139
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:60
Header file for the TransposeFlag type trait.
Constraint on the data type.
Header file for the exception macros of the math module.
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:1179
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
Constraint on the data type.
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:611
size_t capacity_
The maximum capacity of the compressed vector.
Definition: CompressedVector.h:482
void erase(size_t index)
Erasing an element from the compressed vector.
Definition: CompressedVector.h:1680
typename CrossTrait< T1, T2 >::Type CrossTrait_t
Auxiliary alias declaration for the CrossTrait class template.The CrossTrait_t alias declaration prov...
Definition: CrossTrait.h:165
Iterator lowerBound(size_t index)
Returns an iterator to the first index not less then the given index.
Definition: CompressedVector.h:1885
Iterator find(size_t index)
Searches for a specific vector element.
Definition: CompressedVector.h:1838
Header file for the IsNumeric type trait.
void reset()
Reset to the default initial values.
Definition: CompressedVector.h:1323
Header file for the RemoveConst type trait.
void resize(size_t n, bool preserve=true)
Changing the size of the compressed vector.
Definition: CompressedVector.h:1363
Header file for the IsSparseVector type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedVector.h:298
Header file for run time assertion macros.
Header file for the relaxation flag types.
CompressedVector & operator=(initializer_list< Type > list)
List assignment to all vector elements.
Definition: CompressedVector.h:915
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.The CompositeType_t alias declaration pro...
Definition: Aliases.h:90
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
Constraint on the data type.
size_t extendCapacity() const noexcept
Calculating a new vector capacity.
Definition: CompressedVector.h:1458
Reference at(size_t index)
Checked access to the compressed vector elements.
Definition: CompressedVector.h:767
Headerfile for the generic transfer algorithm.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedVector.h:324
Header file for the column trait.
Header file for the VectorAccessProxy class.
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:281
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
constexpr Reference value() noexcept
Access to the current value of the value-index-pair.
Definition: ValueIndexPair.h:370
Constraint on the data type.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
Iterator * begin_
Pointers to the first non-zero element of each column.
Definition: CompressedMatrix.h:3292
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedVector.h:297
#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
void multAssign(const DenseVector< VT, TF > &rhs)
Default implementation of the multiplication assignment of a dense vector.
Definition: CompressedVector.h:2263
void divAssign(const DenseVector< VT, TF > &rhs)
Default implementation of the division assignment of a dense vector.
Definition: CompressedVector.h:2290
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: CompressedVector.h:2044
Header file for the IsDenseVector type trait.
const Type & ConstReference
Reference to a constant vector value.
Definition: CompressedVector.h:296
void swap(CompressedVector &sv) noexcept
Swapping the contents of two compressed vectors.
Definition: CompressedVector.h:1436
ConstIterator cbegin() const noexcept
Returns an iterator to the first non-zero element of the compressed vector.
Definition: CompressedVector.h:837
#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
Iterator end() noexcept
Returns an iterator just past the last non-zero element of the compressed vector. ...
Definition: CompressedVector.h:851
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:73
Constraint on the size of two data types.
constexpr bool IsRowVector_v
Auxiliary variable template for the IsRowVector type trait.The IsRowVector_v variable template provid...
Definition: IsRowVector.h:143
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:186
EnableIf_t< IsBuiltin_v< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:224
Header file for the default transpose flag for all vectors of the Blaze library.
Initializer list type of the Blaze library.
~CompressedVector()
The destructor for CompressedVector.
Definition: CompressedVector.h:691
static const Type zero_
Neutral element for accesses to zero elements.
Definition: CompressedMatrix.h:3295
size_t capacity() const noexcept
Returns the maximum capacity of the compressed vector.
Definition: CompressedVector.h:1292
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:138
Iterator end_
Pointer one past the last non-zero element of the compressed vector.
Definition: CompressedVector.h:484
CompressedVector< Type, TF > This
Type of this CompressedVector instance.
Definition: CompressedVector.h:288
Header file for the map trait.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
ConstIterator cend() const noexcept
Returns an iterator just past the last non-zero element of the compressed vector. ...
Definition: CompressedVector.h:881
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
constexpr bool IsIntegral_v
Auxiliary variable template for the IsIntegral type trait.The IsIntegral_v variable template provides...
Definition: IsIntegral.h:95
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 IsColumnVector type trait.
OutputIterator transfer(InputIterator first, InputIterator last, OutputIterator dest)
Transfers the elements from the given source range to the destination range.
Definition: Transfer.h:70
Iterator begin() noexcept
Returns an iterator to the first non-zero element of the compressed vector.
Definition: CompressedVector.h:807
static const Type zero_
Neutral element for accesses to zero elements.
Definition: CompressedVector.h:486
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: CompressedVector.h:2024
Header file for the IsResizable type trait.
bool canSMPAssign() const noexcept
Returns whether the vector can be used in SMP assignments.
Definition: CompressedVector.h:2063
EnableIf_t< IsBuiltin_v< T >, T *> allocate(size_t size)
Aligned array allocation for built-in data types.
Definition: Memory.h:156
#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
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#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
Efficient implementation of an arbitrary sized sparse vector.The CompressedVector class is the repres...
Definition: CompressedVector.h:206
void reserve(size_t n)
Setting the minimum capacity of the compressed vector.
Definition: CompressedVector.h:1388
Header file for the HighType type trait.