35 #ifndef _BLAZE_MATH_VIEWS_SPARSECOLUMN_H_
36 #define _BLAZE_MATH_VIEWS_SPARSECOLUMN_H_
338 template<
typename MT
339 ,
bool SO = IsColumnMajorMatrix<MT>::value >
340 class SparseColumn :
public SparseVector< SparseColumn<MT,SO>, false >
385 explicit inline SparseColumn( MT& matrix,
size_t index );
418 template<
typename Other >
420 operator*=( Other rhs );
422 template<
typename Other >
424 operator/=( Other rhs );
431 inline size_t size()
const;
436 inline void erase (
size_t index );
439 inline void reserve(
size_t n );
440 template<
typename Other >
inline SparseColumn& scale ( Other scalar );
466 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
467 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
520 template<
typename MT
526 if(
matrix_.columns() <= index )
527 throw std::invalid_argument(
"Invalid column access index" );
546 template<
typename MT
562 template<
typename MT
567 return const_cast<const MT&
>(
matrix_ )(index,
col_);
579 template<
typename MT
595 template<
typename MT
611 template<
typename MT
627 template<
typename MT
643 template<
typename MT
659 template<
typename MT
686 template<
typename MT
696 if(
this == &rhs || ( &
matrix_ == &rhs.matrix_ &&
col_ == rhs.col_ ) )
699 if( size() != rhs.size() )
700 throw std::invalid_argument(
"Column sizes do not match" );
702 if( rhs.canAlias( &
matrix_ ) ) {
729 template<
typename MT
731 template<
typename VT >
740 if( size() != (~rhs).size() )
741 throw std::invalid_argument(
"Vector sizes do not match" );
743 if( (~rhs).canAlias( &
matrix_ ) ) {
768 template<
typename MT
770 template<
typename VT >
775 if( size() != (~rhs).size() )
776 throw std::invalid_argument(
"Vector sizes do not match" );
782 if( (~rhs).canAlias( &
matrix_ ) ) {
809 template<
typename MT
811 template<
typename VT >
816 if( size() != (~rhs).size() )
817 throw std::invalid_argument(
"Vector sizes do not match" );
836 template<
typename MT
838 template<
typename VT >
843 if( size() != (~rhs).size() )
844 throw std::invalid_argument(
"Vector sizes do not match" );
864 template<
typename MT
866 template<
typename VT >
869 if( size() != (~rhs).size() )
870 throw std::invalid_argument(
"Vector sizes do not match" );
877 const MultType tmp( *
this * (~rhs) );
897 template<
typename MT
899 template<
typename Other >
903 for(
Iterator element=begin(); element!=end(); ++element )
904 element->value() *= rhs;
922 template<
typename MT
924 template<
typename Other >
936 const Tmp tmp( Tmp(1)/static_cast<Tmp>( rhs ) );
937 for(
Iterator element=begin(); element!=end(); ++element )
938 element->value() *= tmp;
941 for(
Iterator element=begin(); element!=end(); ++element )
942 element->value() /= rhs;
963 template<
typename MT
977 template<
typename MT
994 template<
typename MT
1008 template<
typename MT
1029 template<
typename MT
1047 template<
typename MT
1064 template<
typename MT
1082 template<
typename MT
1100 template<
typename MT
1115 template<
typename MT
1117 template<
typename Other >
1120 for(
Iterator element=begin(); element!=end(); ++element )
1121 element->value() *= scalar;
1135 template<
typename MT
1142 size_t nonzeros( 2UL*capacity()+1UL );
1143 nonzeros = max( nonzeros, 7UL );
1144 nonzeros = min( nonzeros, size() );
1174 template<
typename MT
1196 template<
typename MT
1217 template<
typename MT
1238 template<
typename MT
1259 template<
typename MT
1280 template<
typename MT
1321 template<
typename MT
1348 template<
typename MT
1350 template<
typename Other >
1353 return static_cast<const void*
>( &
matrix_ ) == static_cast<const void*>( alias );
1368 template<
typename MT
1370 template<
typename Other >
1373 return static_cast<const void*
>( &
matrix_ ) == static_cast<const void*>( alias );
1389 template<
typename MT
1391 template<
typename VT >
1397 for(
size_t i=0UL; i<size(); ++i )
1419 template<
typename MT
1421 template<
typename VT >
1427 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
1428 matrix_.append( element->index(),
col_, element->value() );
1445 template<
typename MT
1447 template<
typename VT >
1458 const AddType tmp( *
this + (~rhs) );
1476 template<
typename MT
1478 template<
typename VT >
1489 const AddType tmp( *
this + (~rhs) );
1508 template<
typename MT
1510 template<
typename VT >
1521 const SubType tmp( *
this - (~rhs) );
1539 template<
typename MT
1541 template<
typename VT >
1552 const SubType tmp( *
this - (~rhs) );
1580 template<
typename MT >
1603 typedef SparseColumn<MT,false>
This;
1604 typedef typename ColumnTrait<MT>::Type
ResultType;
1614 typedef typename SelectType< useConst, ConstReference, typename MT::Reference >::Type
Reference;
1620 template<
typename MatrixType
1621 ,
typename IteratorType >
1632 enum { returnConst = IsConst<MatrixType>::value };
1637 typedef typename SelectType< returnConst, const ElementType&, ElementType& >::Type ReferenceType;
1646 inline ColumnElement( IteratorType pos,
size_t row )
1658 template<
typename T >
inline ColumnElement&
operator=(
const T& v ) {
1670 template<
typename T >
inline ColumnElement& operator+=(
const T& v ) {
1682 template<
typename T >
inline ColumnElement& operator-=(
const T& v ) {
1694 template<
typename T >
inline ColumnElement& operator*=(
const T& v ) {
1706 template<
typename T >
inline ColumnElement& operator/=(
const T& v ) {
1717 inline const ColumnElement* operator->()
const {
1727 inline ReferenceType value()
const {
1728 return pos_->value();
1737 inline size_t index()
const {
1753 template<
typename MatrixType
1754 ,
typename IteratorType >
1755 class ColumnIterator
1759 typedef std::forward_iterator_tag IteratorCategory;
1760 typedef ColumnElement<MatrixType,IteratorType> ValueType;
1761 typedef ValueType PointerType;
1762 typedef ValueType ReferenceType;
1763 typedef ptrdiff_t DifferenceType;
1766 typedef IteratorCategory iterator_category;
1767 typedef ValueType value_type;
1768 typedef PointerType pointer;
1769 typedef ReferenceType reference;
1770 typedef DifferenceType difference_type;
1780 inline ColumnIterator( MatrixType& matrix,
size_t row,
size_t column )
1801 inline ColumnIterator( MatrixType& matrix,
size_t row,
size_t column, IteratorType pos )
1816 template<
typename MatrixType2,
typename IteratorType2 >
1817 inline ColumnIterator(
const ColumnIterator<MatrixType2,IteratorType2>& it )
1830 inline ColumnIterator& operator++() {
1846 inline const ColumnIterator operator++(
int ) {
1847 const ColumnIterator tmp( *
this );
1858 inline ReferenceType
operator*()
const {
1859 return ReferenceType( pos_,
row_ );
1868 inline PointerType operator->()
const {
1869 return PointerType( pos_,
row_ );
1879 template<
typename MatrixType2,
typename IteratorType2 >
1880 inline bool operator==(
const ColumnIterator<MatrixType2,IteratorType2>& rhs )
const {
1881 return ( &
matrix_ == &rhs.matrix_ ) && (
row_ == rhs.row_ ) && (
column_ == rhs.column_ );
1891 template<
typename MatrixType2,
typename IteratorType2 >
1892 inline bool operator!=(
const ColumnIterator<MatrixType2,IteratorType2>& rhs )
const {
1893 return !( *
this == rhs );
1903 inline DifferenceType
operator-(
const ColumnIterator& rhs )
const {
1904 size_t counter( 0UL );
1905 for(
size_t i=rhs.row_; i<
row_; ++i ) {
1923 template<
typename MatrixType2,
typename IteratorType2 >
friend class ColumnIterator;
1924 template<
typename MT2,
bool SO2 >
friend class SparseColumn;
1932 typedef ColumnIterator<const MT,typename MT::ConstIterator>
ConstIterator;
1935 typedef typename SelectType< useConst, ConstIterator, ColumnIterator<MT,typename MT::Iterator> >::Type
Iterator;
1941 explicit inline SparseColumn( MT& matrix,
size_t index );
1969 template<
typename VT >
inline SparseColumn& operator+=(
const Vector<VT,false>& rhs );
1970 template<
typename VT >
inline SparseColumn& operator-=(
const Vector<VT,false>& rhs );
1971 template<
typename VT >
inline SparseColumn& operator*=(
const Vector<VT,false>& rhs );
1973 template<
typename Other >
1974 inline typename EnableIf< IsNumeric<Other>,
SparseColumn >::Type&
1975 operator*=( Other rhs );
1977 template<
typename Other >
1978 inline typename EnableIf< IsNumeric<Other>,
SparseColumn >::Type&
1979 operator/=( Other rhs );
1986 inline size_t size()
const;
1989 inline void reset();
1991 inline void erase (
size_t index );
1994 inline void reserve(
size_t n );
1995 template<
typename Other >
inline SparseColumn& scale ( Other scalar );
2021 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
2022 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
2023 template<
typename VT >
inline void assign (
const DenseVector <VT,false>& rhs );
2024 template<
typename VT >
inline void assign (
const SparseVector<VT,false>& rhs );
2025 template<
typename VT >
inline void addAssign(
const Vector<VT,false>& rhs );
2026 template<
typename VT >
inline void subAssign(
const Vector<VT,false>& rhs );
2068 template<
typename MT >
2073 if(
matrix_.columns() <= index )
2074 throw std::invalid_argument(
"Invalid column access index" );
2095 template<
typename MT >
2112 template<
typename MT >
2116 return const_cast<const MT&
>(
matrix_ )(index,
col_);
2130 template<
typename MT >
2147 template<
typename MT >
2164 template<
typename MT >
2181 template<
typename MT >
2198 template<
typename MT >
2215 template<
typename MT >
2243 template<
typename MT >
2244 inline SparseColumn<MT,false>& SparseColumn<MT,false>::operator=(
const SparseColumn& rhs )
2252 if(
this == &rhs || ( &
matrix_ == &rhs.matrix_ &&
col_ == rhs.col_ ) )
2255 if( size() != rhs.size() )
2256 throw std::invalid_argument(
"Column sizes do not match" );
2258 if( rhs.canAlias( &
matrix_ ) ) {
2283 template<
typename MT >
2284 template<
typename VT >
2285 inline SparseColumn<MT,false>& SparseColumn<MT,false>::operator=(
const Vector<VT,false>& rhs )
2289 if( size() != (~rhs).size() )
2290 throw std::invalid_argument(
"Vector sizes do not match" );
2312 template<
typename MT >
2313 template<
typename VT >
2314 inline SparseColumn<MT,false>& SparseColumn<MT,false>::operator+=(
const Vector<VT,false>& rhs )
2318 if( size() != (~rhs).size() )
2319 throw std::invalid_argument(
"Vector sizes do not match" );
2340 template<
typename MT >
2341 template<
typename VT >
2342 inline SparseColumn<MT,false>& SparseColumn<MT,false>::operator-=(
const Vector<VT,false>& rhs )
2346 if( size() != (~rhs).size() )
2347 throw std::invalid_argument(
"Vector sizes do not match" );
2369 template<
typename MT >
2370 template<
typename VT >
2371 inline SparseColumn<MT,false>& SparseColumn<MT,false>::operator*=(
const Vector<VT,false>& rhs )
2373 if( size() != (~rhs).size() )
2374 throw std::invalid_argument(
"Vector sizes do not match" );
2376 typedef typename MultTrait<ResultType,typename VT::ResultType>::Type MultType;
2381 const MultType tmp( *
this * (~rhs) );
2402 template<
typename MT >
2403 template<
typename Other >
2404 inline typename EnableIf< IsNumeric<Other>, SparseColumn<MT,false> >::Type&
2405 SparseColumn<MT,false>::operator*=( Other rhs )
2407 for(
Iterator element=begin(); element!=end(); ++element )
2408 element->value() *= rhs;
2428 template<
typename MT >
2429 template<
typename Other >
2430 inline typename EnableIf< IsNumeric<Other>, SparseColumn<MT,false> >::Type&
2431 SparseColumn<MT,false>::operator/=( Other rhs )
2435 typedef typename DivTrait<ElementType,Other>::Type DT;
2436 typedef typename If< IsNumeric<DT>, DT, Other >::Type Tmp;
2440 if( IsNumeric<DT>::value && IsFloatingPoint<DT>::value ) {
2441 const Tmp tmp( Tmp(1)/static_cast<Tmp>( rhs ) );
2442 for(
Iterator element=begin(); element!=end(); ++element )
2443 element->value() *= tmp;
2446 for(
Iterator element=begin(); element!=end(); ++element )
2447 element->value() /= rhs;
2470 template<
typename MT >
2471 inline size_t SparseColumn<MT,false>::size()
const
2485 template<
typename MT >
2486 inline size_t SparseColumn<MT,false>::capacity()
const
2503 template<
typename MT >
2504 inline size_t SparseColumn<MT,false>::nonZeros()
const
2506 size_t counter( 0UL );
2507 for(
ConstIterator element=begin(); element!=end(); ++element ) {
2522 template<
typename MT >
2525 for(
size_t i=0UL; i<size(); ++i ) {
2546 template<
typename MT >
2548 SparseColumn<MT,false>::insert(
size_t index,
const ElementType& value )
2565 template<
typename MT >
2566 inline void SparseColumn<MT,false>::erase(
size_t index )
2583 template<
typename MT >
2586 const size_t row( pos.row_ );
2591 matrix_.erase( row, pos.pos_ );
2608 template<
typename MT >
2611 for( ; first!=last; ++first ) {
2612 matrix_.erase( first.row_, first.pos_ );
2630 template<
typename MT >
2631 void SparseColumn<MT,false>::reserve(
size_t n )
2647 template<
typename MT >
2648 template<
typename Other >
2649 inline SparseColumn<MT,false>& SparseColumn<MT,false>::scale( Other scalar )
2651 for(
Iterator element=begin(); element!=end(); ++element )
2652 element->value() *= scalar;
2681 template<
typename MT >
2686 if( pos !=
matrix_.end( index ) )
2709 template<
typename MT >
2714 if( pos !=
matrix_.end( index ) )
2736 template<
typename MT >
2739 for(
size_t i=index; i<size(); ++i )
2766 template<
typename MT >
2769 for(
size_t i=index; i<size(); ++i )
2796 template<
typename MT >
2799 for(
size_t i=index+1UL; i<size(); ++i )
2826 template<
typename MT >
2829 for(
size_t i=index+1UL; i<size(); ++i )
2876 template<
typename MT >
2877 inline void SparseColumn<MT,false>::append(
size_t index,
const ElementType& value,
bool check )
2905 template<
typename MT >
2906 template<
typename Other >
2907 inline bool SparseColumn<MT,false>::canAlias(
const Other* alias )
const
2909 return static_cast<const void*
>( &
matrix_ ) == static_cast<const void*>( alias );
2922 template<
typename MT >
2923 template<
typename Other >
2924 inline bool SparseColumn<MT,false>::isAliased(
const Other* alias )
const
2926 return static_cast<const void*
>( &
matrix_ ) == static_cast<const void*>( alias );
2944 template<
typename MT >
2945 template<
typename VT >
2950 for(
size_t i=0UL; i<(~rhs).size(); ++i ) {
2970 template<
typename MT >
2971 template<
typename VT >
2978 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
2979 for( ; i<element->index(); ++i )
2983 for( ; i<size(); ++i ) {
3003 template<
typename MT >
3004 template<
typename VT >
3007 typedef typename AddTrait<ResultType,typename VT::ResultType>::Type AddType;
3014 const AddType tmp( *
this + (~rhs) );
3033 template<
typename MT >
3034 template<
typename VT >
3037 typedef typename SubTrait<ResultType,typename VT::ResultType>::Type SubType;
3044 const SubType tmp( *
this - (~rhs) );
3066 template<
typename MT,
bool SO >
3067 inline void reset( SparseColumn<MT,SO>& column );
3069 template<
typename MT,
bool SO >
3070 inline void clear( SparseColumn<MT,SO>& column );
3072 template<
typename MT,
bool SO >
3073 inline bool isDefault(
const SparseColumn<MT,SO>& column );
3085 template<
typename MT
3087 inline void reset( SparseColumn<MT,SO>& column )
3103 template<
typename MT
3105 inline void clear( SparseColumn<MT,SO>& column )
3130 template<
typename MT
3136 const ConstIterator end( column.end() );
3137 for( ConstIterator element=column.begin(); element!=end; ++element )
3138 if( !
isDefault( element->value() ) )
return false;
3173 template<
typename MT
3175 inline typename DisableIf< Or< IsComputation<MT>, IsTransExpr<MT> >, SparseColumn<MT> >::Type
3176 column( SparseMatrix<MT,SO>& sm,
size_t index )
3180 return SparseColumn<MT>( ~sm, index );
3206 template<
typename MT
3208 inline typename DisableIf< Or< IsComputation<MT>, IsTransExpr<MT> >, SparseColumn<const MT> >::Type
3209 column(
const SparseMatrix<MT,SO>& sm,
size_t index )
3213 return SparseColumn<const MT>( ~sm, index );
3228 template<
typename MT,
bool SO >
3229 struct SubvectorTrait< SparseColumn<MT,SO> >
Constraint on the data type.
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, DenseColumn< MT > >::Type column(DenseMatrix< MT, SO > &dm, size_t index)
Creating a view on a specific column of the given dense matrix.
Definition: DenseColumn.h:3026
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:98
Header file for mathematical functions.
void subAssign(const DenseVector< VT, false > &rhs)
Default implementation of the subtraction assignment of a dense vector.
Definition: SparseColumn.h:1511
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
Operand matrix_
The sparse matrix containing the column.
Definition: SparseColumn.h:488
Header file for the UNUSED_PARAMETER function template.
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:112
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:3703
Header file for the subtraction trait.
Iterator end()
Returns an iterator just past the last element of the column.
Definition: SparseColumn.h:629
Header file for the SparseVector base class.
Header file for the View base class.
ConstIterator cend() const
Returns an iterator just past the last element of the column.
Definition: SparseColumn.h:661
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:114
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a column dense or sparse vector type...
Definition: TransposeFlag.h:159
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4555
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:196
#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:118
const size_t col_
The index of the column in the matrix.
Definition: DenseColumn.h:2070
Header file for the IsColumnMajorMatrix type trait.
void assign(const DenseVector< VT, false > &rhs)
Default implementation of the assignment of a dense vector.
Definition: SparseColumn.h:1392
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2375
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:84
Iterator find(size_t index)
Searches for a specific column element.
Definition: SparseColumn.h:1176
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SparseColumn.h:364
const size_t row_
The first row of the submatrix.
Definition: DenseSubmatrix.h:2793
#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:118
void clear(DynamicMatrix< Type, SO > &m)
Clearing the given dense matrix.
Definition: DynamicMatrix.h:4528
Constraint on the data type.
MT::ConstIterator ConstIterator
Iterator over constant elements.
Definition: SparseColumn.h:376
SelectType< useConst, ConstIterator, typename MT::Iterator >::Type Iterator
Iterator over non-constant elements.
Definition: SparseColumn.h:379
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the DisableIf class template.
Header file for the multiplication trait.
MT::ElementType ElementType
Type of the column elements.
Definition: SparseColumn.h:365
Header file for the If class template.
Header file for the IsFloatingPoint type trait.
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: StorageOrder.h:161
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
Header file for the Or class template.
Iterator begin()
Returns an iterator to the first element of the column.
Definition: SparseColumn.h:581
void addAssign(const DenseVector< VT, false > &rhs)
Default implementation of the addition assignment of a dense vector.
Definition: SparseColumn.h:1448
size_t size() const
Returns the current size/dimension of the sparse column.
Definition: SparseColumn.h:965
MT::ConstReference ConstReference
Reference to a constant column value.
Definition: SparseColumn.h:370
Header file for the subvector trait.
Iterator lowerBound(size_t index)
Returns an iterator to the first index not less then the given index.
Definition: SparseColumn.h:1219
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
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
#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:79
Constraint on the data type.
Iterator upperBound(size_t index)
Returns an iterator to the first index greater then the given index.
Definition: SparseColumn.h:1261
Constraint on the data type.
Operand matrix_
The dense matrix containing the column.
Definition: DenseColumn.h:2069
size_t nonZeros() const
Returns the number of non-zero elements in the column.
Definition: SparseColumn.h:996
Constraints on the storage order of matrix types.
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
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2373
Constraint on the data type.
Header file for the SelectType class template.
const size_t column_
The first column of the submatrix.
Definition: DenseSubmatrix.h:2794
Constraint on the data type.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2377
Header file for the EnableIf class template.
ColumnIterator< const MT > ConstIterator
Iterator over constant elements.
Definition: DenseColumn.h:1972
Header file for the IsNumeric type trait.
const size_t col_
The index of the column in the matrix.
Definition: SparseColumn.h:489
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: StorageOrder.h:81
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2374
Header file for the IsConst type trait.
void erase(size_t index)
Erasing an element from the sparse column.
Definition: SparseColumn.h:1049
SparseColumn< MT, SO > This
Type of this SparseColumn instance.
Definition: SparseColumn.h:362
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:141
Base template for the MultTrait class.
Definition: MultTrait.h:141
SelectType< IsExpression< MT >::value, MT, MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: SparseColumn.h:346
Header file for the addition trait.
ColumnTrait< MT >::Type ResultType
Result type for expression template evaluations.
Definition: SparseColumn.h:363
Header file for the division trait.
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
void reserve(size_t n)
Setting the minimum capacity of the sparse column.
Definition: SparseColumn.h:1102
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Header file for the reset shim.
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, DenseRow< MT > >::Type row(DenseMatrix< MT, SO > &dm, size_t index)
Creating a view on a specific row of the given dense matrix.
Definition: DenseRow.h:3025
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
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2378
Header file for the column trait.
Header file for the isDefault shim.
Iterator insert(size_t index, const ElementType &value)
Inserting an element into the sparse column.
Definition: SparseColumn.h:1032
size_t capacity() const
Returns the maximum capacity of the sparse column.
Definition: SparseColumn.h:979
#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:118
ConstIterator cbegin() const
Returns an iterator to the first element of the column.
Definition: SparseColumn.h:613
Compile time check for constant data types.The IsConst type trait tests whether or not the given temp...
Definition: IsConst.h:94
const SparseColumn & CompositeType
Data type for composite expression templates.
Definition: SparseColumn.h:367
Base template for the DivTrait class.
Definition: DivTrait.h:141
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: SparseColumn.h:366
#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
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:147
Base class for all views.The View class serves as a tag for all views (subvectors, submatrices, rows, columns, ...). All classes that represent a view and that are used within the expression template environment of the Blaze library have to derive from this class in order to qualify as a view. Only in case a class is derived from the View base class, the IsView type trait recognizes the class as valid view.
Definition: View.h:64
CompressedMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:247
SparseColumn(MT &matrix, size_t index)
The constructor for SparseColumn.
Definition: SparseColumn.h:522
SparseColumn & operator=(const SparseColumn &rhs)
Copy assignment operator for SparseColumn.
Definition: SparseColumn.h:688
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:105
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2370
void reset()
Reset to the default initial values.
Definition: SparseColumn.h:1010
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
Header file for basic type definitions.
Reference operator[](size_t index)
Subscript operator for the direct access to the column elements.
Definition: SparseColumn.h:548
SelectType< useConst, ConstReference, typename MT::Reference >::Type Reference
Reference to a non-constant column value.
Definition: SparseColumn.h:373
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
SelectType< useConst, ConstIterator, ColumnIterator< MT > >::Type Iterator
Iterator over non-constant elements.
Definition: DenseColumn.h:1980
bool canAlias(const Other *alias) const
Returns whether the sparse column can alias with the given address alias.
Definition: SparseColumn.h:1351
void append(size_t index, const ElementType &value, bool check=false)
Appending an element to the sparse column.
Definition: SparseColumn.h:1323
bool isAliased(const Other *alias) const
Returns whether the sparse column is aliased with the given address alias.
Definition: SparseColumn.h:1371
size_t extendCapacity() const
Calculating a new sparse column capacity.
Definition: SparseColumn.h:1137
#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
Operand matrix_
The dense matrix containing the submatrix.
Definition: DenseSubmatrix.h:2792
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
Reference to a specific column of a sparse matrix.The SparseColumn template represents a reference to...
Definition: Forward.h:51
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.