35 #ifndef _BLAZE_MATH_DENSE_DENSEVECTOR_H_ 36 #define _BLAZE_MATH_DENSE_DENSEVECTOR_H_ 76 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
77 inline bool operator==(
const DenseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
79 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
80 inline bool operator==(
const DenseVector<T1,TF1>& lhs,
const SparseVector<T2,TF2>& rhs );
82 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
83 inline bool operator==(
const SparseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
85 template<
typename T1,
typename T2,
bool TF >
86 inline EnableIf_<IsNumeric<T2>,
bool >
operator==(
const DenseVector<T1,TF>& vec, T2 scalar );
88 template<
typename T1,
typename T2,
bool TF >
89 inline EnableIf_<IsNumeric<T1>,
bool >
operator==( T1 scalar,
const DenseVector<T2,TF>& vec );
91 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
92 inline bool operator!=(
const DenseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
94 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
95 inline bool operator!=(
const DenseVector<T1,TF1>& lhs,
const SparseVector<T2,TF2>& rhs );
97 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
98 inline bool operator!=(
const SparseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
100 template<
typename T1,
typename T2,
bool TF >
101 inline EnableIf_<IsNumeric<T2>,
bool >
operator!=(
const DenseVector<T1,TF>& vec, T2 scalar );
103 template<
typename T1,
typename T2,
bool TF >
104 inline EnableIf_<IsNumeric<T1>,
bool >
operator!=( T1 scalar,
const DenseVector<T2,TF>& vec );
117 template<
typename T1
127 if( (~lhs).
size() != (~rhs).
size() )
return false;
135 for(
size_t i=0; i<a.size(); ++i )
136 if( !
equal( a[i], b[i] ) )
return false;
150 template<
typename T1
161 if( (~lhs).
size() != (~rhs).
size() )
return false;
171 for(
ConstIterator element=b.begin(); element!=b.end(); ++element, ++i ) {
172 for( ; i<element->index(); ++i ) {
175 if( !
equal( element->value(), a[i] ) )
return false;
177 for( ; i<a.size(); ++i ) {
194 template<
typename T1
200 return ( rhs == lhs );
217 template<
typename T1
229 for(
size_t i=0; i<a.size(); ++i )
230 if( !
equal( a[i], scalar ) )
return false;
248 template<
typename T1
253 return ( vec == scalar );
266 template<
typename T1
272 return !( lhs == rhs );
285 template<
typename T1
291 return !( lhs == rhs );
304 template<
typename T1
310 return !( rhs == lhs );
327 template<
typename T1
332 return !( vec == scalar );
349 template<
typename T1
354 return !( vec == scalar );
370 template<
typename VT,
bool TF >
373 template<
typename VT,
bool TF >
376 template<
typename VT,
bool TF >
379 template<
typename VT,
bool TF >
382 template<
typename VT,
bool TF >
385 template<
typename VT,
bool TF >
388 template<
typename VT,
bool TF >
414 template<
typename VT
420 for(
size_t i=0UL; i<a.size(); ++i ) {
421 if(
isnan( a[i] ) )
return true;
444 template<
typename VT
450 for(
size_t i=0UL; i<a.size(); ++i ) {
484 template<
typename VT
498 for(
size_t i=1UL; i<a.size(); ++i ) {
521 template<
typename VT
530 for(
size_t i=0UL; i<(~dv).
size(); ++i )
531 sum +=
sq( (~dv)[i] );
574 template<
typename VT
595 template<
typename VT
606 if( a.size() == 0UL )
return ET();
609 for(
size_t i=1UL; i<a.size(); ++i )
610 minimum =
min( minimum, a[i] );
628 template<
typename VT
639 if( a.size() == 0UL )
return ET();
642 for(
size_t i=1UL; i<a.size(); ++i )
643 maximum =
max( maximum, a[i] );
Header file for the isnan shim.
Header file for auxiliary alias declarations.
Headerfile for the generic min algorithm.
Constraint on the data type.
Header file for basic type definitions.
Header file for the SparseVector base class.
Header file for the square shim.
constexpr bool equal(const T1 &a, const T2 &b)
Generic equality check.
Definition: Equal.h:76
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
const ElementType_< VT > sqrLength(const DenseVector< VT, TF > &dv)
Calculation of the square length (magnitude) of the dense vector .
Definition: DenseVector.h:523
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1762
Header file for the DenseVector base class.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3085
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1809
Header file for the vector transpose flag types.
auto length(const DenseVector< VT, TF > &dv) -> decltype(sqrt(sqrLength(~dv)))
Calculation of the length (magnitude) of the dense vector .
Definition: DenseVector.h:576
Header file for the sqrt shim.
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
Headerfile for the generic max algorithm.
BLAZE_ALWAYS_INLINE constexpr MultExprTrait_< T, T > sq(const T &a) noexcept(noexcept(a *a))
Squaring the given value/object.
Definition: Square.h:66
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3081
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:250
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Header file for the equal shim.
bool isnan(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is not a number.
Definition: DiagonalProxy.h:682
bool isUniform(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a uniform matrix.
Definition: DenseMatrix.h:1010
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
Header file for the EnableIf class template.
Header file for the IsNumeric type trait.
bool isDivisor(const DenseVector< VT, TF > &dv)
Returns whether the given dense vector is a valid divisor.
Definition: DenseVector.h:446
BLAZE_ALWAYS_INLINE ValueType_< T > sum(const SIMDi8< T > &a) noexcept
Returns the sum of all elements in the 8-bit integral SIMD vector.
Definition: Reduction.h:65
Header file for run time assertion macros.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
Header file for the isDefault shim.
Header file for the RemoveReference type trait.
typename T::ConstReference ConstReference_
Alias declaration for nested ConstReference type definitions.The ConstReference_ alias declaration pr...
Definition: Aliases.h:143
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
decltype(auto) sqrt(const DenseMatrix< MT, SO > &dm)
Computes the square root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1448
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
Header file for the isDivisor shim.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:600