35#ifndef _BLAZE_MATH_SPARSE_ZEROMATRIX_H_
36#define _BLAZE_MATH_SPARSE_ZEROMATRIX_H_
192template<
typename Type
196 :
public Expression< SparseMatrix< ZeroMatrix<Type,SO,Tag>, SO > >
231 template<
typename NewType >
240 template<
size_t NewM
261 template< typename MT,
bool SO2 >
291 template< typename MT,
bool SO2 >
302 constexpr
size_t rows() const noexcept;
305 constexpr
size_t capacity(
size_t i ) const noexcept;
307 constexpr
size_t nonZeros(
size_t i ) const noexcept;
309 constexpr
void resize(
size_t m,
size_t n ) noexcept;
334 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
335 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
372template< typename
Type
389template<
typename Type
405template<
typename Type
424template<
typename Type
460template<
typename Type
487template<
typename Type
516template<
typename Type
542template<
typename Type
568template<
typename Type
594template<
typename Type
627template<
typename Type
641 const size_t m( (*rhs).rows() );
642 const size_t n( (*rhs).columns() );
665template<
typename Type
680template<
typename Type
695template<
typename Type
716template<
typename Type
735template<
typename Type
756template<
typename Type
777template<
typename Type
799template<
typename Type
816template<
typename Type
821 const size_t tmp1(
m_ );
825 const size_t tmp2(
n_ );
853template<
typename Type
882template<
typename Type
911template<
typename Type
940template<
typename Type
945 const size_t tmp(
m_ );
959template<
typename Type
964 const size_t tmp(
m_ );
991template<
typename Type
994template<
typename Other >
1014template<
typename Type
1017template<
typename Other >
1037template<
typename Type
1062template< RelaxationFlag RF,
typename Type,
bool SO,
typename Tag >
1065template<
typename Type,
bool SO,
typename Tag >
1068template<
typename Type,
bool SO,
typename Tag >
1105 return ( m.rows() == 0UL && m.columns() == 0UL );
1127template<
typename Type
1147template<
typename Type
1167template<
typename Type
1170inline void erase( ZeroMatrix<Type,SO,Tag>& m,
size_t i,
size_t j )
1192template<
typename Type
1195 ,
typename Iterator >
1221template<
typename Type
1224 ,
typename Iterator >
1258template<
typename Type
1300template<
typename Type
1355template<
typename T,
bool SO = defaultStorageOrder >
1356constexpr decltype(
auto)
zero(
size_t m,
size_t n )
noexcept
1379template<
typename MT
1381inline ZeroMatrix<ElementType_t<MT>,SO>
1401template<
typename Type,
bool SO,
typename Tag >
1402struct IsUniform< ZeroMatrix<Type,SO,Tag> >
1419template<
typename Type,
bool SO,
typename Tag >
1437template<
typename T1,
typename T2 >
1438struct AddTraitEval1< T1, T2
1446template<
typename T1,
typename T2 >
1447struct AddTraitEval1< T1, T2
1455template<
typename T1,
typename T2 >
1456struct AddTraitEval1< T1, T2
1479template<
typename T1,
typename T2 >
1480struct SubTraitEval1< T1, T2
1488template<
typename T1,
typename T2 >
1489struct SubTraitEval1< T1, T2
1497template<
typename T1,
typename T2 >
1498struct SubTraitEval1< T1, T2
1521template<
typename T1,
typename T2 >
1522struct SchurTraitEval1< T1, T2
1559template<
typename T1,
typename T2 >
1560struct MultTraitEval1< T1, T2
1568template<
typename T1,
typename T2 >
1569struct MultTraitEval1< T1, T2
1577template<
typename T1,
typename T2 >
1578struct MultTraitEval1< T1, T2
1588template<
typename T1,
typename T2 >
1589struct MultTraitEval1< T1, T2
1615template<
typename T1,
typename T2 >
1616struct KronTraitEval1< T1, T2
1640template<
typename T1,
typename T2 >
1641struct DivTraitEval1< T1, T2
1664template<
typename T,
typename OP >
1665struct UnaryMapTraitEval1< T, OP
1669 using ElementType =
decltype( std::declval<OP>()( std::declval< ElementType_t<T> >() ) );
1681template<
typename T1,
typename T2,
typename OP >
1682struct BinaryMapTraitEval1< T1, T2, OP
1687 using ElementType =
decltype( std::declval<OP>()( std::declval< ElementType_t<T1> >()
1688 , std::declval< ElementType_t<T2> >() ) );
1710struct ExpandTraitEval1< T, E
1732template<
typename T,
size_t R0,
size_t R1 >
1733struct RepeatTraitEval1< T, R0, R1,
inf
1755template<
typename T,
bool SO,
typename Tag >
1758 using Type = ZeroMatrix<T,SO,Tag>;
1774template<
typename T,
bool SO,
typename Tag >
1777 using Type = ZeroMatrix<T,SO,Tag>;
1793template<
typename T1,
bool SO,
typename Tag,
typename T2 >
1796 using Type = ZeroMatrix< typename HighType<T1,T2>::Type, SO, Tag >;
1812template<
typename T1,
bool SO,
typename Tag,
typename T2 >
1815 using Type = ZeroMatrix< typename LowType<T1,T2>::Type, SO, Tag >;
1831template<
typename MT,
size_t I,
size_t J,
size_t M,
size_t N >
1832struct SubmatrixTraitEval1< MT, I, J, M, N
1835 using Type = ZeroMatrix< RemoveConst_t< ElementType_t<MT> >
1836 , StorageOrder_v<MT>
1853template<
typename MT,
size_t M >
1854struct RowsTraitEval1< MT, M
1857 using Type = ZeroMatrix< RemoveConst_t< ElementType_t<MT> >
1875template<
typename MT,
size_t N >
1876struct ColumnsTraitEval1< MT, N
1879 using Type = ZeroMatrix< 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 columns trait.
Constraint on the data type.
Header file for the declstrlow trait.
Header file for the declstrupp trait.
Header file for the division trait.
Header file for the EnableIf class template.
Header file for the EvaluateTrait class template.
Header file for the expand trait.
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 IsDenseVector type trait.
Header file for the IsIdentity type trait.
Header file for the IsLower 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 IsSparseMatrix type trait.
Header file for the IsSparseVector type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsUpper 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 rows trait.
Header file for the Schur product trait.
Header file for the subtraction trait.
Header file for the submatrix trait.
Header file for the ValueIndexPair class.
Constraint on the data type.
Header file for the YieldsZero type trait.
Base class for matrices.
Definition Matrix.h:85
Index-value-pair for sparse vectors and matrices.
Definition ValueIndexPair.h:75
Efficient implementation of an zero matrix.
Definition ZeroMatrix.h:197
constexpr size_t rows() const noexcept
constexpr ConstIterator begin(size_t i) const noexcept
Element * Iterator
Definition ZeroMatrix.h:224
size_t n_
Definition ZeroMatrix.h:346
This ResultType
Result type for expression template evaluations.
Definition ZeroMatrix.h:209
ConstIterator lowerBound(size_t i, size_t j) const
constexpr void clear() noexcept
ValueIndexPair< Type > Element
Value-index-pair for the ZeroMatrix class.
Definition ZeroMatrix.h:200
bool canAlias(const Other *alias) const noexcept
Expression< SparseMatrix< This, SO > > BaseType
Base type of this ZeroMatrix instance.
Definition ZeroMatrix.h:206
constexpr ZeroMatrix() noexcept
The default constructor for ZeroMatrix.
Definition ZeroMatrix.h:392
const Element * ConstIterator
Definition ZeroMatrix.h:225
ZeroMatrix< Type,!SO, Tag > TransposeType
Definition ZeroMatrix.h:215
constexpr ConstIterator end(size_t i) const noexcept
const Type & Reference
Definition ZeroMatrix.h:222
ConstIterator upperBound(size_t i, size_t j) const
constexpr size_t capacity() const noexcept
constexpr ZeroMatrix & transpose() noexcept
const This & CompositeType
Definition ZeroMatrix.h:220
constexpr ConstIterator cbegin(size_t i) const noexcept
constexpr ZeroMatrix & ctranspose() noexcept
ConstIterator find(size_t i, size_t j) const
constexpr size_t nonZeros() const noexcept
constexpr size_t columns() const noexcept
constexpr ConstIterator cend(size_t i) const noexcept
const Type & ConstReference
Definition ZeroMatrix.h:223
constexpr void swap(ZeroMatrix &m) noexcept
constexpr void resize(size_t m, size_t n) noexcept
static const Type zero_
Definition ZeroMatrix.h:348
Type ElementType
Definition ZeroMatrix.h:217
ZeroMatrix< Type,!SO, Tag > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition ZeroMatrix.h:212
constexpr ConstReference operator()(size_t i, size_t j) const noexcept
2D-access to the zero matrix elements.
Definition ZeroMatrix.h:464
bool canSMPAssign() const noexcept
static constexpr bool smpAssignable
Definition ZeroMatrix.h:252
size_t m_
Definition ZeroMatrix.h:345
bool isAliased(const Other *alias) const noexcept
ConstReference at(size_t i, size_t j) const
Tag TagType
Definition ZeroMatrix.h:218
const Type & ReturnType
Definition ZeroMatrix.h:219
ZeroMatrix< Type, SO, Tag > This
Type of this ZeroMatrix instance.
Definition ZeroMatrix.h:205
Header file for the Expression base class.
Header file for the SparseMatrix 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 IsStrictlyUpper_v
Auxiliary variable template for the IsStrictlyUpper type trait.
Definition IsStrictlyUpper.h:173
constexpr bool IsScalar_v
Auxiliary variable template for the IsScalar type trait.
Definition IsScalar.h:104
constexpr bool IsStrictlyLower_v
Auxiliary variable template for the IsStrictlyLower type trait.
Definition IsStrictlyLower.h:173
constexpr bool IsUpper_v
Auxiliary variable template for the IsUpper type trait.
Definition IsUpper.h:175
constexpr bool StorageOrder_v
Auxiliary variable template for the StorageOrder type trait.
Definition StorageOrder.h:93
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 IsSparseMatrix_v
Auxiliary variable template for the IsSparseMatrix type trait.
Definition IsSparseMatrix.h:124
constexpr bool IsIdentity_v
Auxiliary variable template for the IsIdentity type trait.
Definition IsIdentity.h:137
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 IsSparseVector_v
Auxiliary variable template for the IsSparseVector type trait.
Definition IsSparseVector.h:124
constexpr bool IsDenseVector_v
Auxiliary variable template for the IsDenseVector type trait.
Definition IsDenseVector.h:124
constexpr bool IsLower_v
Auxiliary variable template for the IsLower type trait.
Definition IsLower.h:175
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 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.
constexpr bool rowMajor
Storage order flag for row-major matrices.
Definition StorageOrder.h:71
constexpr bool columnMajor
Storage order flag for column-major matrices.
Definition StorageOrder.h:99
Header file for all forward declarations for sparse vectors and matrices.
Header file for the StorageOrder type trait.
Header file for the isZero shim.
Base template for the DeclStrLowTrait class.
Definition DeclStrLowTrait.h:128
Base template for the DeclStrUppTrait class.
Definition DeclStrUppTrait.h:128
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 ZeroMatrix with different data/element type.
Definition ZeroMatrix.h:232
ZeroMatrix< NewType, SO, Tag > Other
The type of the other ZeroMatrix.
Definition ZeroMatrix.h:233
Resize mechanism to obtain a ZeroMatrix with different fixed dimensions.
Definition ZeroMatrix.h:242
ZeroMatrix< Type, SO, Tag > Other
The type of the other ZeroMatrix.
Definition ZeroMatrix.h:243
Header file for the default storage order for all vectors of the Blaze library.
Header file for the IsZero type trait.
Header file for basic type definitions.