35 #ifndef _BLAZE_MATH_SPARSE_COMPRESSEDVECTOR_H_
36 #define _BLAZE_MATH_SPARSE_COMPRESSEDVECTOR_H_
178 template<
typename Type
195 template<
typename Other >
196 inline Element&
operator=(
const Other& rhs )
198 ElementBase::operator=( rhs );
211 struct FindIndex :
public std::binary_function<Element,size_t,bool>
213 inline bool operator()(
const Element& element,
size_t index )
const {
214 return element.index() < index;
216 inline bool operator()(
size_t index,
const Element& element )
const {
217 return index < element.index();
219 inline bool operator()(
const Element& element1,
const Element& element2 )
const {
220 return element1.index() < element2.index();
283 template<
typename Other >
285 operator*=( Other rhs );
287 template<
typename Other >
289 operator/=( Other rhs );
296 inline size_t size()
const;
302 inline void erase (
size_t index );
305 inline void resize(
size_t n,
bool preserve=
true );
327 inline void append(
size_t index,
const Type& value,
bool check=
false );
334 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
335 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
386 template<
typename Type
402 template<
typename Type
418 template<
typename Type
435 template<
typename Type
454 template<
typename Type
472 template<
typename Type
474 template<
typename VT >
476 : size_ ( (~dv).size() )
492 template<
typename Type
494 template<
typename VT >
496 : size_ ( (~sv).size() )
518 template<
typename Type
546 template<
typename Type
564 template<
typename Type
573 if( pos ==
end_ || pos->index_ != index )
586 template<
typename Type
600 template<
typename Type
614 template<
typename Type
628 template<
typename Type
642 template<
typename Type
656 template<
typename Type
682 template<
typename Type
687 if( &rhs ==
this )
return *
this;
689 const size_t nonzeros( rhs.
nonZeros() );
692 Iterator newBegin(
new Element[nonzeros] );
719 template<
typename Type
721 template<
typename VT >
727 if( (~rhs).canAlias(
this ) ) {
732 size_ = (~rhs).size();
751 template<
typename Type
753 template<
typename VT >
759 if( (~rhs).canAlias(
this ) || (~rhs).nonZeros() >
capacity_ ) {
764 size_ = (~rhs).size();
784 template<
typename Type
786 template<
typename VT >
791 if( (~rhs).size() != size_ )
792 throw std::invalid_argument(
"Vector sizes do not match" );
811 template<
typename Type
813 template<
typename VT >
818 if( (~rhs).size() != size_ )
819 throw std::invalid_argument(
"Vector sizes do not match" );
839 template<
typename Type
841 template<
typename VT >
844 if( (~rhs).size() != size_ )
845 throw std::invalid_argument(
"Vector sizes do not match" );
866 template<
typename Type
868 template<
typename Other >
873 element->value_ *= rhs;
891 template<
typename Type
893 template<
typename Other >
905 const Tmp tmp( Tmp(1)/static_cast<Tmp>( rhs ) );
907 element->value_ *= tmp;
911 element->value_ /= rhs;
932 template<
typename Type
946 template<
typename Type
963 template<
typename Type
977 template<
typename Type
993 template<
typename Type
1015 template<
typename Type
1022 const Iterator pos( lowerBound( index ) );
1024 if( pos !=
end_ && pos->index_ == index )
1025 throw std::invalid_argument(
"Bad access index" );
1028 std::copy_backward( pos,
end_,
end_+1 );
1029 pos->value_ = value;
1030 pos->index_ = index;
1036 size_t newCapacity( extendCapacity() );
1038 Iterator newBegin =
new Element[newCapacity];
1040 tmp->value_ = value;
1041 tmp->index_ = index;
1042 end_ = std::copy( pos,
end_, tmp+1 );
1062 template<
typename Type
1068 const Iterator pos( find( index ) );
1070 end_ = std::copy( pos+1,
end_, pos );
1083 template<
typename Type
1090 end_ = std::copy( pos+1,
end_, pos );
1105 template<
typename Type
1115 end_ = std::copy( last,
end_, first );
1133 template<
typename Type
1138 end_ = lowerBound( n );
1158 template<
typename Type
1163 const size_t newCapacity( n );
1166 Iterator newBegin =
new Element[newCapacity];
1184 template<
typename Type
1186 template<
typename Other >
1190 element->value_ *= scalar;
1203 template<
typename Type
1223 template<
typename Type
1231 nonzeros = max( nonzeros, 7UL );
1232 nonzeros = min( nonzeros, size_ );
1262 template<
typename Type
1266 return const_cast<Iterator>(
const_cast<const This&
>( *this ).
find( index ) );
1284 template<
typename Type
1289 if( pos !=
end_ && pos->index_ == index )
1308 template<
typename Type
1330 template<
typename Type
1335 return std::lower_bound(
begin_,
end_, index, FindIndex() );
1352 template<
typename Type
1374 template<
typename Type
1379 return std::upper_bound(
begin_,
end_, index, FindIndex() );
1416 template<
typename Type
1424 end_->value_ = value;
1427 end_->index_ = index;
1452 template<
typename Type
1454 template<
typename Other >
1457 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1472 template<
typename Type
1474 template<
typename Other >
1477 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1493 template<
typename Type
1495 template<
typename VT >
1501 size_t nonzeros( 0UL );
1503 for(
size_t i=0UL; i<size_; ++i )
1506 reserve( extendCapacity() );
1508 end_->value_ = (~rhs)[i];
1531 template<
typename Type
1533 template<
typename VT >
1545 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1546 append( element->index(), element->value() );
1562 template<
typename Type
1564 template<
typename VT >
1575 const AddType tmp( *
this + (~rhs) );
1593 template<
typename Type
1595 template<
typename VT >
1617 template<
typename Type
1619 template<
typename VT >
1630 const SubType tmp( *
this - (~rhs) );
1648 template<
typename Type
1650 template<
typename VT >
1672 template<
typename Type,
bool TF >
1675 template<
typename Type,
bool TF >
1678 template<
typename Type,
bool TF >
1681 template<
typename Type,
bool TF >
1694 template<
typename Type
1710 template<
typename Type
1738 template<
typename Type
1744 for( ConstIterator element=v.
begin(); element!=v.
end(); ++element )
1745 if( !
isDefault( element->value() ) )
return false;
1760 template<
typename Type
1779 template<
typename T,
bool TF >
1780 struct IsResizable< CompressedVector<T,TF> > :
public TrueType
1786 template<
typename T,
bool TF >
1787 struct IsResizable< const CompressedVector<T,TF> > :
public TrueType
1793 template<
typename T,
bool TF >
1794 struct IsResizable< volatile CompressedVector<T,TF> > :
public TrueType
1800 template<
typename T,
bool TF >
1801 struct IsResizable< const volatile CompressedVector<T,TF> > :
public TrueType
1820 template<
typename T1,
bool TF,
typename T2,
size_t N >
1821 struct AddTrait< CompressedVector<T1,TF>, StaticVector<T2,N,TF> >
1823 typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
1826 template<
typename T1,
size_t N,
bool TF,
typename T2 >
1827 struct AddTrait< StaticVector<T1,N,TF>, CompressedVector<T2,TF> >
1829 typedef StaticVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
1832 template<
typename T1,
bool TF,
typename T2,
size_t N >
1833 struct AddTrait< CompressedVector<T1,TF>, HybridVector<T2,N,TF> >
1835 typedef HybridVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
1838 template<
typename T1,
size_t N,
bool TF,
typename T2 >
1839 struct AddTrait< HybridVector<T1,N,TF>, CompressedVector<T2,TF> >
1841 typedef HybridVector< typename AddTrait<T1,T2>::Type, N, TF > Type;
1844 template<
typename T1,
bool TF,
typename T2 >
1845 struct AddTrait< CompressedVector<T1,TF>, DynamicVector<T2,TF> >
1847 typedef DynamicVector< typename AddTrait<T1,T2>::Type, TF > Type;
1850 template<
typename T1,
bool TF,
typename T2 >
1851 struct AddTrait< DynamicVector<T1,TF>, CompressedVector<T2,TF> >
1853 typedef DynamicVector< typename AddTrait<T1,T2>::Type, TF > Type;
1856 template<
typename T1,
bool TF,
typename T2 >
1857 struct AddTrait< CompressedVector<T1,TF>, CompressedVector<T2,TF> >
1859 typedef CompressedVector< typename AddTrait<T1,T2>::Type, TF > Type;
1875 template<
typename T1,
bool TF,
typename T2,
size_t N >
1876 struct SubTrait< CompressedVector<T1,TF>, StaticVector<T2,N,TF> >
1878 typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
1881 template<
typename T1,
size_t N,
bool TF,
typename T2 >
1882 struct SubTrait< StaticVector<T1,N,TF>, CompressedVector<T2,TF> >
1884 typedef StaticVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
1887 template<
typename T1,
bool TF,
typename T2,
size_t N >
1888 struct SubTrait< CompressedVector<T1,TF>, HybridVector<T2,N,TF> >
1890 typedef HybridVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
1893 template<
typename T1,
size_t N,
bool TF,
typename T2 >
1894 struct SubTrait< HybridVector<T1,N,TF>, CompressedVector<T2,TF> >
1896 typedef HybridVector< typename SubTrait<T1,T2>::Type, N, TF > Type;
1899 template<
typename T1,
bool TF,
typename T2 >
1900 struct SubTrait< CompressedVector<T1,TF>, DynamicVector<T2,TF> >
1902 typedef DynamicVector< typename SubTrait<T1,T2>::Type, TF > Type;
1905 template<
typename T1,
bool TF,
typename T2 >
1906 struct SubTrait< DynamicVector<T1,TF>, CompressedVector<T2,TF> >
1908 typedef DynamicVector< typename SubTrait<T1,T2>::Type, TF > Type;
1911 template<
typename T1,
bool TF,
typename T2 >
1912 struct SubTrait< CompressedVector<T1,TF>, CompressedVector<T2,TF> >
1914 typedef CompressedVector< typename SubTrait<T1,T2>::Type, TF > Type;
1930 template<
typename T1,
bool TF,
typename T2 >
1931 struct MultTrait< CompressedVector<T1,TF>, T2 >
1933 typedef CompressedVector< typename MultTrait<T1,T2>::Type, TF > Type;
1937 template<
typename T1,
typename T2,
bool TF >
1938 struct MultTrait< T1, CompressedVector<T2,TF> >
1940 typedef CompressedVector< typename MultTrait<T1,T2>::Type, TF > Type;
1944 template<
typename T1,
bool TF,
typename T2,
size_t N >
1945 struct MultTrait< CompressedVector<T1,TF>, StaticVector<T2,N,TF> >
1947 typedef CompressedVector< typename MultTrait<T1,T2>::Type, TF > Type;
1950 template<
typename T1,
typename T2,
size_t N >
1951 struct MultTrait< CompressedVector<T1,false>, StaticVector<T2,N,true> >
1953 typedef CompressedMatrix< typename MultTrait<T1,T2>::Type,
true > Type;
1956 template<
typename T1,
typename T2,
size_t N >
1957 struct MultTrait< CompressedVector<T1,true>, StaticVector<T2,N,false> >
1959 typedef typename MultTrait<T1,T2>::Type Type;
1962 template<
typename T1,
size_t N,
bool TF,
typename T2 >
1963 struct MultTrait< StaticVector<T1,N,TF>, CompressedVector<T2,TF> >
1965 typedef CompressedVector< typename MultTrait<T1,T2>::Type, TF > Type;
1968 template<
typename T1,
size_t N,
typename T2 >
1969 struct MultTrait< StaticVector<T1,N,false>, CompressedVector<T2,true> >
1971 typedef CompressedMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
1974 template<
typename T1,
size_t N,
typename T2 >
1975 struct MultTrait< StaticVector<T1,N,true>, CompressedVector<T2,false> >
1977 typedef typename MultTrait<T1,T2>::Type Type;
1980 template<
typename T1,
bool TF,
typename T2,
size_t N >
1981 struct MultTrait< CompressedVector<T1,TF>, HybridVector<T2,N,TF> >
1983 typedef CompressedVector< typename MultTrait<T1,T2>::Type, TF > Type;
1986 template<
typename T1,
typename T2,
size_t N >
1987 struct MultTrait< CompressedVector<T1,false>, HybridVector<T2,N,true> >
1989 typedef CompressedMatrix< typename MultTrait<T1,T2>::Type,
true > Type;
1992 template<
typename T1,
typename T2,
size_t N >
1993 struct MultTrait< CompressedVector<T1,true>, HybridVector<T2,N,false> >
1995 typedef typename MultTrait<T1,T2>::Type Type;
1998 template<
typename T1,
size_t N,
bool TF,
typename T2 >
1999 struct MultTrait< HybridVector<T1,N,TF>, CompressedVector<T2,TF> >
2001 typedef CompressedVector< typename MultTrait<T1,T2>::Type, TF > Type;
2004 template<
typename T1,
size_t N,
typename T2 >
2005 struct MultTrait< HybridVector<T1,N,false>, CompressedVector<T2,true> >
2007 typedef CompressedMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2010 template<
typename T1,
size_t N,
typename T2 >
2011 struct MultTrait< HybridVector<T1,N,true>, CompressedVector<T2,false> >
2013 typedef typename MultTrait<T1,T2>::Type Type;
2016 template<
typename T1,
bool TF,
typename T2 >
2017 struct MultTrait< CompressedVector<T1,TF>, DynamicVector<T2,TF> >
2019 typedef CompressedVector< typename MultTrait<T1,T2>::Type, TF > Type;
2022 template<
typename T1,
typename T2 >
2023 struct MultTrait< CompressedVector<T1,false>, DynamicVector<T2,true> >
2025 typedef CompressedMatrix< typename MultTrait<T1,T2>::Type,
true > Type;
2028 template<
typename T1,
typename T2 >
2029 struct MultTrait< CompressedVector<T1,true>, DynamicVector<T2,false> >
2031 typedef typename MultTrait<T1,T2>::Type Type;
2034 template<
typename T1,
bool TF,
typename T2 >
2035 struct MultTrait< DynamicVector<T1,TF>, CompressedVector<T2,TF> >
2037 typedef CompressedVector< typename MultTrait<T1,T2>::Type, TF > Type;
2040 template<
typename T1,
typename T2 >
2041 struct MultTrait< DynamicVector<T1,false>, CompressedVector<T2,true> >
2043 typedef CompressedMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2046 template<
typename T1,
typename T2 >
2047 struct MultTrait< DynamicVector<T1,true>, CompressedVector<T2,false> >
2049 typedef typename MultTrait<T1,T2>::Type Type;
2052 template<
typename T1,
bool TF,
typename T2 >
2053 struct MultTrait< CompressedVector<T1,TF>, CompressedVector<T2,TF> >
2055 typedef CompressedVector< typename MultTrait<T1,T2>::Type, TF > Type;
2058 template<
typename T1,
typename T2 >
2059 struct MultTrait< CompressedVector<T1,false>, CompressedVector<T2,true> >
2061 typedef CompressedMatrix< typename MultTrait<T1,T2>::Type,
false > Type;
2064 template<
typename T1,
typename T2 >
2065 struct MultTrait< CompressedVector<T1,true>, CompressedVector<T2,false> >
2067 typedef typename MultTrait<T1,T2>::Type Type;
2083 template<
typename T1,
typename T2 >
2084 struct CrossTrait< CompressedVector<T1,false>, StaticVector<T2,3UL,false> >
2087 typedef typename MultTrait<T1,T2>::Type T;
2090 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2093 template<
typename T1,
typename T2 >
2094 struct CrossTrait< StaticVector<T1,3UL,false>, CompressedVector<T2,false> >
2097 typedef typename MultTrait<T1,T2>::Type T;
2100 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2103 template<
typename T1,
typename T2,
size_t N >
2104 struct CrossTrait< CompressedVector<T1,false>, HybridVector<T2,N,false> >
2107 typedef typename MultTrait<T1,T2>::Type T;
2110 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2113 template<
typename T1,
size_t N,
typename T2 >
2114 struct CrossTrait< HybridVector<T1,N,false>, CompressedVector<T2,false> >
2117 typedef typename MultTrait<T1,T2>::Type T;
2120 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2123 template<
typename T1,
typename T2 >
2124 struct CrossTrait< CompressedVector<T1,false>, DynamicVector<T2,false> >
2127 typedef typename MultTrait<T1,T2>::Type T;
2130 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2133 template<
typename T1,
typename T2 >
2134 struct CrossTrait< DynamicVector<T1,false>, CompressedVector<T2,false> >
2137 typedef typename MultTrait<T1,T2>::Type T;
2140 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2143 template<
typename T1,
typename T2 >
2144 struct CrossTrait< CompressedVector<T1,false>, CompressedVector<T2,false> >
2147 typedef typename MultTrait<T1,T2>::Type T;
2150 typedef StaticVector< typename SubTrait<T,T>::Type, 3UL,
false > Type;
2166 template<
typename T1,
bool TF,
typename T2 >
2167 struct DivTrait< CompressedVector<T1,TF>, T2 >
2169 typedef CompressedVector< typename DivTrait<T1,T2>::Type, TF > Type;
2186 template<
typename T1,
bool TF,
typename T2 >
2187 struct MathTrait< CompressedVector<T1,TF>, CompressedVector<T2,TF> >
2189 typedef CompressedVector< typename MathTrait<T1,T2>::HighType, TF > HighType;
2190 typedef CompressedVector< typename MathTrait<T1,T2>::LowType , TF > LowType;
2206 template<
typename T1,
bool TF >
2207 struct SubvectorTrait< CompressedVector<T1,TF> >
2209 typedef CompressedVector<T1,TF> Type;
#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:116
bool isAliased(const Other *alias) const
Returns whether the vector is aliased with the given address alias.
Definition: CompressedVector.h:1475
const bool defaultTransposeFlag
The default transpose flag for all vectors of the Blaze library.This value specifies the default tran...
Definition: TransposeFlag.h:56
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:98
Constraint on the data type.
Header file for mathematical functions.
void reset(DynamicMatrix< Type, SO > &m)
Resetting the given dense matrix.
Definition: DynamicMatrix.h:4512
#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
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:112
Header file for the subtraction trait.
Header file for the SparseVector base class.
size_t capacity() const
Returns the maximum capacity of the compressed vector.
Definition: CompressedVector.h:948
void assign(const DenseVector< VT, TF > &rhs)
Default implementation of the assignment of a dense vector.
Definition: CompressedVector.h:1496
Iterator upperBound(size_t index)
Returns an iterator to the first index greater then the given index.
Definition: CompressedVector.h:1355
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4555
ValueIndexPair< Type > ElementBase
Base class for the compressed vector element.
Definition: CompressedVector.h:184
CompressedVector< Type,!TF > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedVector.h:230
const blaze::Null NULL
Global NULL pointer.This instance of the Null class replaces the NULL macro to ensure a type-safe NUL...
Definition: Null.h:300
Access proxy for sparse, N-dimensional vectors.The VectorAccessProxy provides safe access to the elem...
Definition: VectorAccessProxy.h:89
void swap(CompressedVector &sv)
Swapping the contents of two compressed vectors.
Definition: CompressedVector.h:1205
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2375
VectorAccessProxy< This > Reference
Reference to a non-constant vector value.
Definition: CompressedVector.h:234
Header file for a safe C++ NULL pointer implementation.
const Type & ConstReference
Reference to a constant vector value.
Definition: CompressedVector.h:235
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:1565
Iterator end()
Returns an iterator just past the last non-zero element of the compressed vector. ...
Definition: CompressedVector.h:630
#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:116
void clear()
Clearing the compressed vector.
Definition: CompressedVector.h:995
size_t size_
The current size/dimension of the compressed vector.
Definition: CompressedVector.h:356
const CompressedVector & CompositeType
Data type for composite expression templates.
Definition: CompressedVector.h:233
void clear(DynamicMatrix< Type, SO > &m)
Clearing the given dense matrix.
Definition: DynamicMatrix.h:4528
Constraint on the data type.
size_t capacity_
The current capacity of the pointer array.
Definition: CompressedMatrix.h:2513
Header file for the floating point precision of the Blaze library.
size_t extendCapacity() const
Calculating a new vector capacity.
Definition: CompressedVector.h:1225
Header file for the ValueIndexPair class.
void subAssign(const DenseVector< VT, TF > &rhs)
Default implementation of the subtraction assignment of a dense vector.
Definition: CompressedVector.h:1620
void append(size_t index, const Type &value, bool check=false)
Appending an element to the compressed vector.
Definition: CompressedVector.h:1418
Header file for the multiplication trait.
Header file for the If class template.
Header file for the IsFloatingPoint type trait.
CompressedVector()
The default constructor for CompressedVector.
Definition: CompressedVector.h:404
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two sparse matrices.
Definition: CompressedMatrix.h:4541
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
bool canAlias(const Other *alias) const
Returns whether the vector can alias with the given address alias.
Definition: CompressedVector.h:1455
Iterator insert(size_t index, const Type &value)
Inserting an element into the compressed vector.
Definition: CompressedVector.h:1018
#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:116
ConstIterator cend() const
Returns an iterator just past the last non-zero element of the compressed vector. ...
Definition: CompressedVector.h:658
Iterator * end_
Pointers one past the last non-zero element of each column.
Definition: CompressedMatrix.h:2515
Iterator begin_
Pointer to the first non-zero element of the compressed vector.
Definition: CompressedVector.h:358
#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:78
Header file for the subvector trait.
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:179
Constraint on the data type.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedVector.h:232
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
ConstIterator cbegin() const
Returns an iterator to the first non-zero element of the compressed vector.
Definition: CompressedVector.h:616
Constraint on the data type.
#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:78
Constraint on the data type.
Compile time check for floating point data types.This type trait tests whether or not the given templ...
Definition: IsFloatingPoint.h:94
Header file for the EnableIf class template.
size_t capacity_
The maximum capacity of the compressed vector.
Definition: CompressedVector.h:357
This ResultType
Result type for expression template evaluations.
Definition: CompressedVector.h:229
void erase(size_t index)
Erasing an element from the compressed vector.
Definition: CompressedVector.h:1064
Reference operator[](size_t index)
Subscript operator for the direct access to the compressed vector elements.
Definition: CompressedVector.h:549
Iterator lowerBound(size_t index)
Returns an iterator to the first index not less then the given index.
Definition: CompressedVector.h:1311
Iterator find(size_t index)
Searches for a specific vector element.
Definition: CompressedVector.h:1264
Header file for the IsNumeric type trait.
void reset()
Reset to the default initial values.
Definition: CompressedVector.h:979
void resize(size_t n, bool preserve=true)
Changing the size of the compressed vector.
Definition: CompressedVector.h:1135
Header file for the IsSparseVector type trait.
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:141
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
void swap(DynamicMatrix< Type, SO > &a, DynamicMatrix< Type, SO > &b)
Swapping the contents of two matrices.
Definition: DynamicMatrix.h:4584
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:209
Constraint on the data type.
CompressedVector< Type, TF > This
Type of this CompressedVector instance.
Definition: CompressedVector.h:228
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
#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:79
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:239
const VT::ElementType max(const SparseVector< VT, TF > &sv)
Returns the largest element of the sparse vector.
Definition: SparseVector.h:405
#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:116
size_t size() const
Returns the current size/dimension of the compressed vector.
Definition: CompressedVector.h:934
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2378
Header file for the VectorAccessProxy class.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedVector.h:237
Header file for the isDefault shim.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedVector.h:236
Constraint on the data type.
Iterator * begin_
Pointers to the first non-zero element of each column.
Definition: CompressedMatrix.h:2514
size_t nonZeros() const
Returns the number of non-zero elements in the compressed vector.
Definition: CompressedVector.h:965
Base template for the DivTrait class.
Definition: DivTrait.h:141
Header file for the mathematical trait.
#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:79
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:69
Constraint on the size of two data types.
Header file for the default transpose flag for all vectors of the Blaze library.
~CompressedVector()
The destructor for CompressedVector.
Definition: CompressedVector.h:520
CompressedVector & operator=(const CompressedVector &rhs)
Copy assignment operator for CompressedVector.
Definition: CompressedVector.h:685
static const Type zero_
Neutral element for accesses to zero elements.
Definition: CompressedMatrix.h:2517
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:105
Iterator end_
Pointer one past the last non-zero element of the compressed vector.
Definition: CompressedVector.h:359
Iterator begin()
Returns an iterator to the first non-zero element of the compressed vector.
Definition: CompressedVector.h:588
Header file for basic type definitions.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2376
Base template for the SubTrait class.
Definition: SubTrait.h:141
const VT::ElementType min(const SparseVector< VT, TF > &sv)
Returns the smallest element of the sparse vector.
Definition: SparseVector.h:348
boost::true_type TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Type ElementType
Type of the compressed vector elements.
Definition: CompressedVector.h:231
static const Type zero_
Neutral element for accesses to zero elements.
Definition: CompressedVector.h:361
Header file for the IsResizable 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:238
#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:180
void reserve(size_t n)
Setting the minimum capacity of the compressed vector.
Definition: CompressedVector.h:1160