35#ifndef _BLAZE_MATH_SPARSE_ZEROVECTOR_H_
36#define _BLAZE_MATH_SPARSE_ZEROVECTOR_H_
178template<
typename Type
182 :
public Expression< SparseVector< ZeroVector<Type,TF,Tag>, TF > >
214 template<
typename NewType >
223 template<
size_t NewN >
272 template< typename VT >
283 constexpr
size_t size() const noexcept;
287 constexpr
void resize(
size_t n ) noexcept;
304 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
305 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
341template< typename
Type
358template<
typename Type
372template<
typename Type
390template<
typename Type
393template<
typename VT >
420template<
typename Type
445template<
typename Type
451 if( index >=
size_ ) {
465template<
typename Type
481template<
typename Type
497template<
typename Type
513template<
typename Type
542template<
typename Type
545template<
typename VT >
555 size_ = (*rhs).size();
575template<
typename Type
590template<
typename Type
608template<
typename Type
625template<
typename Type
645template<
typename Type
661template<
typename Type
666 const size_t tmp(
size_ );
692template<
typename Type
717template<
typename Type
742template<
typename Type
775template<
typename Type
778template<
typename Other >
798template<
typename Type
801template<
typename Other >
821template<
typename Type
846template< RelaxationFlag RF,
typename Type,
bool TF,
typename Tag >
849template<
typename Type,
bool TF,
typename Tag >
852template<
typename Type,
bool TF,
typename Tag >
888 return ( v.size() == 0UL );
910template<
typename Type
930template<
typename Type
949template<
typename Type
952inline void erase( ZeroVector<Type,TF,Tag>& v,
size_t index )
971template<
typename Type
974 ,
typename Iterator >
997template<
typename Type
1000 ,
typename Iterator >
1035template<
typename Type
1073template<
typename Type
1120template<
typename T,
bool TF = defaultTransposeFlag >
1121constexpr decltype(
auto)
zero(
size_t n )
noexcept
1144template<
typename VT
1146inline ZeroVector<ElementType_t<VT>,TF>
1166template<
typename Type,
bool TF,
typename Tag >
1167struct IsUniform< ZeroVector<Type,TF,Tag> >
1184template<
typename Type,
bool TF,
typename Tag >
1202template<
typename T1,
typename T2 >
1203struct AddTraitEval1< T1, T2
1211template<
typename T1,
typename T2 >
1212struct AddTraitEval1< T1, T2
1220template<
typename T1,
typename T2 >
1221struct AddTraitEval1< T1, T2
1244template<
typename T1,
typename T2 >
1245struct SubTraitEval1< T1, T2
1253template<
typename T1,
typename T2 >
1254struct SubTraitEval1< T1, T2
1262template<
typename T1,
typename T2 >
1263struct SubTraitEval1< T1, T2
1286template<
typename T1,
typename T2 >
1287struct MultTraitEval1< T1, T2
1297template<
typename T1,
typename T2 >
1298struct MultTraitEval1< T1, T2
1308template<
typename T1,
typename T2 >
1309struct MultTraitEval1< T1, T2
1319template<
typename T1,
typename T2 >
1320struct MultTraitEval1< T1, T2
1333template<
typename T1,
typename T2 >
1334struct MultTraitEval1< T1, T2
1360template<
typename T1,
typename T2 >
1361struct KronTraitEval1< T1, T2
1385template<
typename T1,
typename T2 >
1386struct DivTraitEval1< T1, T2
1396template<
typename T1,
typename T2 >
1397struct DivTraitEval1< T1, T2
1420template<
typename T1,
typename T2 >
1421struct CrossTraitEval1< T1, T2
1447template<
typename T,
typename OP >
1448struct UnaryMapTraitEval1< T, OP
1452 using ElementType =
decltype( std::declval<OP>()( std::declval< ElementType_t<T> >() ) );
1464template<
typename T1,
typename T2,
typename OP >
1465struct BinaryMapTraitEval1< T1, T2, OP
1470 using ElementType =
decltype( std::declval<OP>()( std::declval< ElementType_t<T1> >()
1471 , std::declval< ElementType_t<T2> >() ) );
1491template<
typename T,
size_t R0 >
1492struct RepeatTraitEval1< T, R0,
inf,
inf
1514template<
typename T1,
bool TF,
typename Tag,
typename T2 >
1517 using Type = ZeroVector< typename HighType<T1,T2>::Type, TF, Tag >;
1533template<
typename T1,
bool TF,
typename Tag,
typename T2 >
1536 using Type = ZeroVector< typename LowType<T1,T2>::Type, TF, Tag >;
1552template<
typename VT,
size_t I,
size_t N >
1553struct SubvectorTraitEval1< VT, I, N
1556 using Type = ZeroVector< RemoveConst_t< ElementType_t<VT> >
1557 , TransposeFlag_v<VT>
1574template<
typename VT,
size_t N >
1575struct ElementsTraitEval1< VT, N
1578 using Type = ZeroVector< RemoveConst_t< ElementType_t<VT> >
1579 , TransposeFlag_v<VT>
1596template<
typename MT,
size_t I >
1597struct RowTraitEval1< MT, I
1600 using Type = ZeroVector< RemoveConst_t< ElementType_t<MT> >
1618template<
typename MT,
size_t I >
1619struct ColumnTraitEval1< MT, I
1622 using Type = ZeroVector< RemoveConst_t< ElementType_t<MT> >
1640template<
typename MT, ptrdiff_t I >
1641struct BandTraitEval1< MT, I
1644 using Type = ZeroVector< RemoveConst_t< ElementType_t<MT> >
Header file for the addition trait.
Header file for auxiliary alias declarations.
typename T1::template Rebind< T2 >::Other Rebind_t
Alias declaration for nested Rebind class templates.
Definition Aliases.h:350
typename ResultType_t< T >::TagType TagType_t
Alias declaration for nested TagType type definitions.
Definition Aliases.h:530
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition Aliases.h:190
Header file for run time assertion macros.
Header file for the band trait.
Header file for the column trait.
Constraint on the data type.
Header file for the cross product trait.
Header file for the division trait.
Header file for the elements trait.
Header file for the EnableIf class template.
Header file for the EvaluateTrait class template.
Header file for the function trace functionality.
Header file for the HighType type trait.
Header file for the IntegralConstant class template.
Header file for the IsColumnVector type trait.
Header file for the IsMatrix type trait.
Header file for the IsRowVector type trait.
Header file for the IsSMPAssignable type trait.
Header file for the IsScalar type trait.
Header file for the IsVector type trait.
Header file for the Kron product trait.
Header file for the LowType type trait.
Header file for the map trait.
Header file for the MAYBE_UNUSED function template.
Header file for the multiplication trait.
Constraint on the data type.
Constraint on the data type.
Header file for the relaxation flag enumeration.
Header file for the RemoveConst type trait.
Header file for the repeat trait.
Header file for the row trait.
Header file for the subtraction trait.
Header file for the subvector trait.
Header file for the ValueIndexPair class.
Constraint on the data type.
Header file for the YieldsZero type trait.
Index-value-pair for sparse vectors and matrices.
Definition ValueIndexPair.h:75
Base class for N-dimensional vectors.
Definition Vector.h:82
Efficient implementation of an arbitrary sized zero vector.
Definition ZeroVector.h:183
ConstIterator upperBound(size_t index) const
ConstIterator find(size_t index) const
ZeroVector< Type,!TF, Tag > TransposeType
Transpose type for expression template evaluations.
Definition ZeroVector.h:198
constexpr ConstIterator begin() const noexcept
const Type & ReturnType
Definition ZeroVector.h:202
constexpr void resize(size_t n) noexcept
constexpr size_t capacity() const noexcept
Element * Iterator
Definition ZeroVector.h:207
constexpr ConstReference operator[](size_t index) const noexcept
Subscript operator for the direct access to the zero vector elements.
Definition ZeroVector.h:424
Type ElementType
Definition ZeroVector.h:200
constexpr ZeroVector() noexcept
The default constructor for ZeroVector.
Definition ZeroVector.h:361
constexpr size_t nonZeros() const noexcept
const Element * ConstIterator
Definition ZeroVector.h:208
constexpr size_t size() const noexcept
constexpr ConstIterator cbegin() const noexcept
ConstIterator lowerBound(size_t index) const
bool canSMPAssign() const noexcept
const This & CompositeType
Definition ZeroVector.h:204
constexpr void swap(ZeroVector &v) noexcept
Tag TagType
Definition ZeroVector.h:201
ZeroVector< Type, TF, Tag > This
Type of this ZeroVector instance.
Definition ZeroVector.h:191
constexpr ConstIterator cend() const noexcept
constexpr ConstIterator end() const noexcept
static const Type zero_
Definition ZeroVector.h:317
const Type & Reference
Definition ZeroVector.h:205
This ResultType
Result type for expression template evaluations.
Definition ZeroVector.h:195
constexpr void clear() noexcept
bool isAliased(const Other *alias) const noexcept
const Type & ConstReference
Definition ZeroVector.h:206
Expression< SparseVector< This, TF > > BaseType
Base type of this ZeroVector instance.
Definition ZeroVector.h:192
ConstReference at(size_t index) const
ValueIndexPair< Type > Element
Value-index-pair for the ZeroVector class.
Definition ZeroVector.h:186
size_t size_
Definition ZeroVector.h:315
static constexpr bool smpAssignable
Definition ZeroVector.h:234
bool canAlias(const Other *alias) const noexcept
Header file for the Expression base class.
Header file for the SparseVector base class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.
Definition Volatile.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.
Definition Pointer.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.
Definition Const.h:79
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TAG(A, B)
Data type constraint.
Definition SameTag.h:68
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.
Definition Reference.h:79
bool isZero(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a zero matrix.
Definition DenseMatrix.h:1819
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition DiagonalMatrix.h:207
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition DiagonalMatrix.h:225
bool isDefault(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the given diagonal matrix is in default state.
Definition DiagonalMatrix.h:169
typename SubTrait< T1, T2 >::Type SubTrait_t
Auxiliary alias declaration for the SubTrait class template.
Definition SubTrait.h:163
typename AddTrait< T1, T2 >::Type AddTrait_t
Auxiliary alias declaration for the AddTrait class template.
Definition AddTrait.h:163
typename MapTrait< Args... >::Type MapTrait_t
Auxiliary alias declaration for the MapTrait class template.
Definition MapTrait.h:131
typename DivTrait< T1, T2 >::Type DivTrait_t
Auxiliary alias declaration for the DivTrait class template.
Definition DivTrait.h:164
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.
Definition MultTrait.h:165
constexpr bool IsScalar_v
Auxiliary variable template for the IsScalar type trait.
Definition IsScalar.h:104
constexpr bool IsVector_v
Auxiliary variable template for the IsVector type trait.
Definition IsVector.h:125
constexpr bool IsZero_v
Auxiliary variable template for the IsZero type trait.
Definition IsZero.h:166
constexpr bool YieldsZero_v
Auxiliary variable template for the YieldsZero type trait.
Definition YieldsZero.h:125
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.
Definition IsMatrix.h:124
constexpr bool IsColumnVector_v
Auxiliary variable template for the IsColumnVector type trait.
Definition IsColumnVector.h:126
constexpr bool IsSMPAssignable_v
Auxiliary variable template for the IsSMPAssignable type trait.
Definition IsSMPAssignable.h:132
constexpr bool IsRowVector_v
Auxiliary variable template for the IsRowVector type trait.
Definition IsRowVector.h:126
constexpr bool TransposeFlag_v
Auxiliary variable template for the TransposeFlag type trait.
Definition TransposeFlag.h:93
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition RelaxationFlag.h:66
constexpr Infinity inf
Global Infinity instance.
Definition Infinity.h:1080
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition Assert.h:117
constexpr bool defaultTransposeFlag
The default transpose flag for all vectors of the Blaze library.
Definition TransposeFlag.h:75
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition MaybeUnused.h:81
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:138
BoolConstant< true > TrueType
Type traits base class.
Definition IntegralConstant.h:132
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition Exception.h:235
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition FunctionTrace.h:94
ZeroMatrix< ElementType_t< MT >, SO > declzero(const Matrix< MT, SO > &m)
Declares the given matrix expression m as zero matrix.
Definition ZeroMatrix.h:1382
constexpr decltype(auto) zero(size_t m, size_t n) noexcept
Creating a zero matrix.
Definition ZeroMatrix.h:1356
Header file for the exception macros of the math module.
Header file for all forward declarations of the math module.
Header file for all forward declarations for sparse vectors and matrices.
Header file for the TransposeFlag type trait.
Header file for the isZero shim.
Base class for all expression templates.
Definition Expression.h:60
Base template for the HighType type trait.
Definition HighType.h:322
Compile time check for zero vectors or matrices.
Definition IsZero.h:109
Base template for the LowType type trait.
Definition LowType.h:322
Rebind mechanism to obtain a ZeroVector with different data/element type.
Definition ZeroVector.h:215
ZeroVector< NewType, TF, Tag > Other
The type of the other ZeroVector.
Definition ZeroVector.h:216
Resize mechanism to obtain a ZeroVector with a different fixed number of elements.
Definition ZeroVector.h:224
ZeroVector< Type, TF, Tag > Other
The type of the other ZeroVector.
Definition ZeroVector.h:225
Header file for the default transpose flag for all vectors of the Blaze library.
Header file for the IsZero type trait.
Header file for basic type definitions.