35#ifndef _BLAZE_MATH_PROXY_DENSEVECTORPROXY_H_
36#define _BLAZE_MATH_PROXY_DENSEVECTORPROXY_H_
76 :
public DenseVector< PT, IsRowVector_v<VT> >
118 inline size_t size()
const;
121 inline void reset()
const;
122 inline void clear()
const;
123 inline void resize(
size_t n,
bool preserve=
true )
const;
124 inline void extend(
size_t n,
bool preserve=
true )
const;
125 inline void reserve(
size_t n )
const;
132 template<
typename Other >
inline void scale(
const Other& scalar )
const;
140 DenseVectorProxy() =
default;
141 DenseVectorProxy(
const DenseVectorProxy& ) =
default;
142 DenseVectorProxy( DenseVectorProxy&& ) =
default;
143 ~DenseVectorProxy() =
default;
144 DenseVectorProxy& operator=(
const DenseVectorProxy& ) =
default;
145 DenseVectorProxy& operator=( DenseVectorProxy&& ) =
default;
179 if( (**this).isRestricted() ) {
183 return (**this).get()[index];
204 if( (**this).isRestricted() ) {
208 return (**this).get().at( index );
225 if( (**this).isRestricted() ) {
229 return (**this).get().data();
244 if( (**this).isRestricted() ) {
248 return (**this).get().begin();
262 return (**this).get().cbegin();
277 if( (**this).isRestricted() ) {
281 return (**this).get().end();
295 return (**this).get().cend();
317 return (**this).get().size();
331 return (**this).get().capacity();
348 return (**this).get().nonZeros();
366 reset( (**this).get() );
384 clear( (**this).get() );
409 if( (**this).isRestricted() ) {
413 (**this).get().resize( n, preserve );
436 if( (**this).isRestricted() ) {
440 (**this).get().extend( n, preserve );
459 if( (**this).isRestricted() ) {
463 (**this).get().reserve( n );
481template<
typename Other >
484 if( (**this).isRestricted() ) {
488 (**this).get().scale( scalar );
504template<
typename PT,
typename VT >
508template<
typename PT,
typename VT >
512template<
typename PT,
typename VT >
516template<
typename PT,
typename VT >
520template<
typename PT,
typename VT >
523template<
typename PT,
typename VT >
526template<
typename PT,
typename VT >
529template<
typename PT,
typename VT >
547 return proxy.
begin();
672 resize_backend(
const DenseVectorProxy<PT,VT>& proxy,
size_t n,
bool preserve )
676 if( proxy.size() != n ) {
701 proxy.resize( n, preserve );
731 resize_backend( proxy, n, preserve );
Header file for auxiliary alias declarations.
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.
Definition Aliases.h:470
typename T::ConstPointer ConstPointer_t
Alias declaration for nested ConstPointer type definitions.
Definition Aliases.h:150
typename T::ConstReference ConstReference_t
Alias declaration for nested ConstReference type definitions.
Definition Aliases.h:170
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.
Definition Aliases.h:130
typename T::Reference Reference_t
Alias declaration for nested Reference type definitions.
Definition Aliases.h:390
typename T::Iterator Iterator_t
Alias declaration for nested Iterator type definitions.
Definition Aliases.h:210
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.
Definition Aliases.h:110
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition Aliases.h:550
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition Aliases.h:190
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition Aliases.h:450
typename T::Pointer Pointer_t
Alias declaration for nested Pointer type definitions.
Definition Aliases.h:330
Header file for the EnableIf class template.
Header file for the IsResizable type trait.
Header file for the IsRowVector type trait.
Header file for the MAYBE_UNUSED function template.
Proxy backend for dense vector types.
Definition DenseVectorProxy.h:77
ConstPointer_t< VT > ConstPointer
Pointer to a constant vector value.
Definition DenseVectorProxy.h:88
ConstIterator cbegin() const
Returns an iterator to the first element of the represented vector.
Definition DenseVectorProxy.h:260
size_t capacity() const
Returns the maximum capacity of the represented vector.
Definition DenseVectorProxy.h:329
ElementType_t< VT > ElementType
Type of the vector elements.
Definition DenseVectorProxy.h:82
size_t nonZeros() const
Returns the number of non-zero elements in the represented vector.
Definition DenseVectorProxy.h:346
void reserve(size_t n) const
Setting the minimum capacity of the represented vector.
Definition DenseVectorProxy.h:457
static constexpr bool simdEnabled
Compilation flag for SIMD optimization.
Definition DenseVectorProxy.h:95
Reference operator[](size_t index) const
Subscript operator for the direct access to vector elements.
Definition DenseVectorProxy.h:177
ResultType_t< VT > ResultType
Result type for expression template evaluations.
Definition DenseVectorProxy.h:80
void scale(const Other &scalar) const
Scaling of the vector by the scalar value scalar ( ).
Definition DenseVectorProxy.h:482
ConstReference_t< VT > ConstReference
Reference to a constant vector value.
Definition DenseVectorProxy.h:86
Pointer data() const
Low-level data access to vector elements.
Definition DenseVectorProxy.h:223
Reference at(size_t index) const
Checked access to the vector elements.
Definition DenseVectorProxy.h:202
Iterator_t< VT > Iterator
Iterator over non-constant elements.
Definition DenseVectorProxy.h:89
void clear() const
Clearing the represented vector.
Definition DenseVectorProxy.h:380
void reset() const
Reset to the default initial value.
Definition DenseVectorProxy.h:362
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition DenseVectorProxy.h:98
size_t size() const
Returns the current size/dimension of the represented vector.
Definition DenseVectorProxy.h:315
Pointer_t< VT > Pointer
Pointer to a non-constant vector value.
Definition DenseVectorProxy.h:87
void resize(size_t n, bool preserve=true) const
Changing the size of the represented vector.
Definition DenseVectorProxy.h:407
void extend(size_t n, bool preserve=true) const
Extending the size of the represented vector.
Definition DenseVectorProxy.h:434
Iterator end() const
Returns an iterator just past the last element of the represented vector.
Definition DenseVectorProxy.h:275
ConstIterator_t< VT > ConstIterator
Iterator over constant elements.
Definition DenseVectorProxy.h:90
TransposeType_t< VT > TransposeType
Transpose type for expression template evaluations.
Definition DenseVectorProxy.h:81
Iterator begin() const
Returns an iterator to the first element of the represented vector.
Definition DenseVectorProxy.h:242
CompositeType_t< VT > CompositeType
Data type for composite expression templates.
Definition DenseVectorProxy.h:84
Reference_t< VT > Reference
Reference to a non-constant vector value.
Definition DenseVectorProxy.h:85
ConstIterator cend() const
Returns an iterator just past the last element of the represented vector.
Definition DenseVectorProxy.h:293
ReturnType_t< VT > ReturnType
Return type for expression template evaluations.
Definition DenseVectorProxy.h:83
Constraint on the data type.
Header file for the DenseVector base class.
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.
Definition DenseVector.h:61
constexpr void clear(Matrix< MT, SO > &matrix)
Clearing the given matrix.
Definition Matrix.h:960
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:628
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition Matrix.h:730
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:562
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition Matrix.h:692
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition Matrix.h:806
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition Matrix.h:1108
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:584
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition Matrix.h:518
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition Matrix.h:676
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition Inline.h:85
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
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition Exception.h:235
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:175
Header file for the exception macros of the math module.
Header file for the clear shim.
Header file for the reset shim.
System settings for the inline keywords.
Header file for basic type definitions.