35 #ifndef _BLAZE_MATH_PROXY_DENSEMATRIXPROXY_H_
36 #define _BLAZE_MATH_PROXY_DENSEMATRIXPROXY_H_
97 enum :
bool { simdEnabled = MT::simdEnabled };
100 enum :
bool { smpAssignable = MT::smpAssignable };
106 inline Reference
operator()(
size_t i,
size_t j )
const;
107 inline Reference
at(
size_t i,
size_t j )
const;
109 inline Pointer
data ()
const;
110 inline Pointer
data (
size_t i )
const;
111 inline Iterator
begin (
size_t i )
const;
112 inline ConstIterator
cbegin(
size_t i )
const;
113 inline Iterator
end (
size_t i )
const;
114 inline ConstIterator
cend (
size_t i )
const;
121 inline size_t rows()
const;
125 inline size_t capacity(
size_t i )
const;
127 inline size_t nonZeros(
size_t i )
const;
128 inline void reset()
const;
129 inline void reset(
size_t i )
const;
130 inline void clear()
const;
131 inline void resize(
size_t m,
size_t n,
bool preserve=
true )
const;
132 inline void extend(
size_t m,
size_t n,
bool preserve=
true )
const;
133 inline void reserve(
size_t n )
const;
137 template<
typename Other >
inline void scale(
const Other& scalar )
const;
167 template<
typename PT
172 if( (~*
this).isRestricted() ) {
176 return (~*
this).get()(i,j);
193 template<
typename PT
198 if( (~*
this).isRestricted() ) {
202 return (~*
this).get().at(i,j);
219 template<
typename PT
223 if( (~*
this).isRestricted() ) {
227 return (~*
this).get().data();
240 template<
typename PT
244 if( (~*
this).isRestricted() ) {
248 return (~*
this).get().data(i);
265 template<
typename PT
270 if( (~*
this).isRestricted() ) {
274 return (~*
this).get().begin(i);
290 template<
typename PT
295 return (~*
this).get().cbegin(i);
312 template<
typename PT
317 if( (~*
this).isRestricted() ) {
321 return (~*
this).get().end(i);
337 template<
typename PT
342 return (~*
this).get().cend(i);
360 template<
typename PT
364 return (~*
this).get().rows();
374 template<
typename PT
378 return (~*
this).get().columns();
393 template<
typename PT
397 return (~*
this).get().spacing();
407 template<
typename PT
411 return (~*
this).get().capacity();
427 template<
typename PT
431 return (~*
this).get().capacity(i);
441 template<
typename PT
445 return (~*
this).get().nonZeros();
461 template<
typename PT
465 return (~*
this).get().nonZeros(i);
477 template<
typename PT
483 reset( (~*
this).
get() );
499 template<
typename PT
505 reset( (~*
this).
get(), i );
517 template<
typename PT
523 clear( (~*
this).
get() );
545 template<
typename PT
549 if( (~*
this).isRestricted() ) {
553 (~*
this).
get().resize( m, n, preserve );
574 template<
typename PT
578 if( (~*
this).isRestricted() ) {
582 (~*
this).
get().extend( m, n, preserve );
597 template<
typename PT
601 if( (~*
this).isRestricted() ) {
605 (~*
this).
get().reserve( n );
616 template<
typename PT
620 if( (~*
this).isRestricted() ) {
624 (~*
this).
get().transpose();
635 template<
typename PT
639 if( (~*
this).isRestricted() ) {
643 (~*
this).
get().ctranspose();
655 template<
typename PT
657 template<
typename Other >
660 if( (~*
this).isRestricted() ) {
664 (~*
this).
get().scale( scalar );
680 template<
typename PT,
typename MT >
684 template<
typename PT,
typename MT >
688 template<
typename PT,
typename MT >
692 template<
typename PT,
typename MT >
696 template<
typename PT,
typename MT >
699 template<
typename PT,
typename MT >
702 template<
typename PT,
typename MT >
705 template<
typename PT,
typename MT >
708 template<
typename PT,
typename MT >
711 template<
typename PT,
typename MT >
714 template<
typename PT,
typename MT >
717 template<
typename PT,
typename MT >
720 template<
typename PT,
typename MT >
723 template<
typename PT,
typename MT >
742 template<
typename PT
747 return proxy.
begin(i);
765 template<
typename PT
789 template<
typename PT
813 template<
typename PT
818 return proxy.
cend(i);
830 template<
typename PT
846 template<
typename PT
862 template<
typename PT
884 template<
typename PT
900 template<
typename PT
922 template<
typename PT
948 template<
typename PT
951 resize_backend(
const DenseMatrixProxy<PT,MT>& proxy,
size_t m,
size_t n,
bool preserve )
955 if( proxy.rows() != m || proxy.columns() != n ) {
976 template<
typename PT
979 resize_backend(
const DenseMatrixProxy<PT,MT>& proxy,
size_t m,
size_t n,
bool preserve )
981 proxy.resize( m, n, preserve );
1001 template<
typename PT
1004 resize_backend(
const DenseMatrixProxy<PT,MT>& proxy,
size_t m,
size_t n,
bool preserve )
1010 proxy.resize( m, preserve );
1041 template<
typename PT
1045 resize_backend( proxy, m, n, preserve );
1059 template<
typename PT
1081 template<
typename PT
1099 template<
typename PT
#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.
Header file for the UNUSED_PARAMETER function template.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:346
Header file for basic type definitions.
size_t rows() const
Returns the current number of rows of the represented matrix.
Definition: DenseMatrixProxy.h:362
CompositeType_< MT > CompositeType
Data type for composite expression templates.
Definition: DenseMatrixProxy.h:86
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:188
void extend(size_t m, size_t n, bool preserve=true) const
Extending the size of the represented matrix.
Definition: DenseMatrixProxy.h:576
Header file for the IsColumnMajorMatrix type trait.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
Iterator begin(size_t i) const
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: DenseMatrixProxy.h:268
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:384
void scale(const Other &scalar) const
Scaling of the matrix by the scalar value scalar ( ).
Definition: DenseMatrixProxy.h:658
ReturnType_< MT > ReturnType
Return type for expression template evaluations.
Definition: DenseMatrixProxy.h:85
ResultType_< MT > ResultType
Result type for expression template evaluations.
Definition: DenseMatrixProxy.h:81
Pointer_< MT > Pointer
Pointer to a non-constant matrix value.
Definition: DenseMatrixProxy.h:89
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
Proxy backend for dense matrix types.The DenseMatrixProxy class serves as a backend for the Proxy cla...
Definition: DenseMatrixProxy.h:77
BLAZE_ALWAYS_INLINE MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:298
BLAZE_ALWAYS_INLINE MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:232
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Iterator end(size_t i) const
Returns an iterator just past the last element of row/column i of the represented matrix...
Definition: DenseMatrixProxy.h:315
size_t columns() const
Returns the current number of columns of the represented matrix.
Definition: DenseMatrixProxy.h:376
ConstIterator cbegin(size_t i) const
Returns an iterator to the first element of row/column i of the represented matrix.
Definition: DenseMatrixProxy.h:293
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
OppositeType_< MT > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DenseMatrixProxy.h:82
Header file for the IsSquare type trait.
Constraint on the data type.
Reference operator()(size_t i, size_t j) const
Function call operator for the direct access to matrix elements.
Definition: DenseMatrixProxy.h:170
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
void transpose() const
In-place transpose of the represented matrix.
Definition: DenseMatrixProxy.h:618
Iterator_< MT > Iterator
Iterator over non-constant elements.
Definition: DenseMatrixProxy.h:91
Header file for the DisableIf class template.
typename T::Pointer Pointer_
Alias declaration for nested Pointer type definitions.The Pointer_ alias declaration provides a conve...
Definition: Aliases.h:263
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
ElementType_< MT > ElementType
Type of the matrix elements.
Definition: DenseMatrixProxy.h:84
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
Header file for the DenseMatrix base class.
size_t spacing() const
Returns the spacing between the beginning of two rows/columns of the represented matrix.
Definition: DenseMatrixProxy.h:395
TransposeType_< MT > TransposeType
Transpose type for expression template evaluations.
Definition: DenseMatrixProxy.h:83
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:330
ConstReference_< MT > ConstReference
Reference to a constant matrix value.
Definition: DenseMatrixProxy.h:88
size_t capacity() const
Returns the maximum capacity of the represented matrix.
Definition: DenseMatrixProxy.h:409
Header file for the exception macros of the math module.
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:538
BLAZE_ALWAYS_INLINE 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:254
typename T::Reference Reference_
Alias declaration for nested Reference type definitions.The Reference_ alias declaration provides a c...
Definition: Aliases.h:283
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
void clear() const
Clearing the represented matrix.
Definition: DenseMatrixProxy.h:519
ConstIterator_< MT > ConstIterator
Iterator over constant elements.
Definition: DenseMatrixProxy.h:92
Reference_< MT > Reference
Reference to a non-constant matrix value.
Definition: DenseMatrixProxy.h:87
Reference at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DenseMatrixProxy.h:196
Header file for the reset shim.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
void reserve(size_t n) const
Setting the minimum capacity of the represented matrix.
Definition: DenseMatrixProxy.h:599
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
Pointer data() const
Low-level data access to matrix elements.
Definition: DenseMatrixProxy.h:221
typename T::Iterator Iterator_
Alias declaration for nested Iterator type definitions.The Iterator_ alias declaration provides a con...
Definition: Aliases.h:183
typename T::ConstPointer ConstPointer_
Alias declaration for nested ConstPointer type definitions.The ConstPointer_ alias declaration provid...
Definition: Aliases.h:123
typename T::ConstReference ConstReference_
Alias declaration for nested ConstReference type definitions.The ConstReference_ alias declaration pr...
Definition: Aliases.h:143
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:314
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
void resize(size_t m, size_t n, bool preserve=true) const
Changing the size of the represented matrix.
Definition: DenseMatrixProxy.h:547
ConstPointer_< MT > ConstPointer
Pointer to a constant matrix value.
Definition: DenseMatrixProxy.h:90
size_t nonZeros() const
Returns the number of non-zero elements in the represented matrix.
Definition: DenseMatrixProxy.h:443
void reset() const
Reset to the default initial value.
Definition: DenseMatrixProxy.h:479
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2644
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
void ctranspose() const
In-place conjugate transpose of the represented matrix.
Definition: DenseMatrixProxy.h:637
ConstIterator cend(size_t i) const
Returns an iterator just past the last element of row/column i of the represented matrix...
Definition: DenseMatrixProxy.h:340
Header file for the IsResizable type trait.
System settings for the inline keywords.