35 #ifndef _BLAZE_MATH_DENSE_DENSEVECTOR_H_
36 #define _BLAZE_MATH_DENSE_DENSEVECTOR_H_
74 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
75 inline bool operator==(
const DenseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
77 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
78 inline bool operator==(
const DenseVector<T1,TF1>& lhs,
const SparseVector<T2,TF2>& rhs );
80 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
81 inline bool operator==(
const SparseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
83 template<
typename T1,
typename T2,
bool TF >
84 inline EnableIf_<IsNumeric<T2>,
bool >
operator==(
const DenseVector<T1,TF>& vec, T2 scalar );
86 template<
typename T1,
typename T2,
bool TF >
87 inline EnableIf_<IsNumeric<T1>,
bool >
operator==( T1 scalar,
const DenseVector<T2,TF>& vec );
89 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
90 inline bool operator!=(
const DenseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
92 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
93 inline bool operator!=(
const DenseVector<T1,TF1>& lhs,
const SparseVector<T2,TF2>& rhs );
95 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
96 inline bool operator!=(
const SparseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
98 template<
typename T1,
typename T2,
bool TF >
99 inline EnableIf_<IsNumeric<T2>,
bool >
operator!=(
const DenseVector<T1,TF>& vec, T2 scalar );
101 template<
typename T1,
typename T2,
bool TF >
102 inline EnableIf_<IsNumeric<T1>,
bool >
operator!=( T1 scalar,
const DenseVector<T2,TF>& vec );
115 template<
typename T1
125 if( (~lhs).
size() != (~rhs).
size() )
return false;
133 for(
size_t i=0; i<a.size(); ++i )
134 if( !
equal( a[i], b[i] ) )
return false;
148 template<
typename T1
159 if( (~lhs).
size() != (~rhs).
size() )
return false;
169 for( ConstIterator element=b.begin(); element!=b.end(); ++element, ++i ) {
170 for( ; i<element->index(); ++i ) {
173 if( !
equal( element->value(), a[i] ) )
return false;
175 for( ; i<a.size(); ++i ) {
192 template<
typename T1
198 return ( rhs == lhs );
215 template<
typename T1
227 for(
size_t i=0; i<a.size(); ++i )
228 if( !
equal( a[i], scalar ) )
return false;
246 template<
typename T1
251 return ( vec == scalar );
264 template<
typename T1
270 return !( lhs == rhs );
283 template<
typename T1
289 return !( lhs == rhs );
302 template<
typename T1
308 return !( rhs == lhs );
325 template<
typename T1
330 return !( vec == scalar );
347 template<
typename T1
352 return !( vec == scalar );
368 template<
typename VT,
bool TF >
369 bool isnan(
const DenseVector<VT,TF>& dv );
371 template<
typename VT,
bool TF >
372 bool isDivisor(
const DenseVector<VT,TF>& dv );
374 template<
typename VT,
bool TF >
375 bool isUniform(
const DenseVector<VT,TF>& dv );
377 template<
typename VT,
bool TF >
378 const ElementType_<VT>
sqrLength(
const DenseVector<VT,TF>& dv );
380 template<
typename VT,
bool TF >
381 inline auto length(
const DenseVector<VT,TF>& dv ) -> decltype(
sqrt(
sqrLength( ~dv ) ) );
383 template<
typename VT,
bool TF >
384 const ElementType_<VT>
min(
const DenseVector<VT,TF>& dv );
386 template<
typename VT,
bool TF >
387 const ElementType_<VT>
max(
const DenseVector<VT,TF>& dv );
412 template<
typename VT
418 for(
size_t i=0UL; i<a.size(); ++i ) {
419 if(
isnan( a[i] ) )
return true;
442 template<
typename VT
448 for(
size_t i=0UL; i<a.size(); ++i ) {
482 template<
typename VT
489 if( (~dv).
size() < 2UL )
494 ConstReference cmp( (~dv)[0UL] );
496 for(
size_t i=1UL; i<(~dv).
size(); ++i ) {
497 if( (~dv)[i] != cmp )
519 template<
typename VT
527 ElementType
sum( 0 );
528 for(
size_t i=0UL; i<(~dv).
size(); ++i )
529 sum +=
sq( (~dv)[i] );
572 template<
typename VT
593 template<
typename VT
604 if( a.size() == 0UL )
return ET();
607 for(
size_t i=1UL; i<a.size(); ++i )
608 minimum =
min( minimum, a[i] );
626 template<
typename VT
637 if( a.size() == 0UL )
return ET();
640 for(
size_t i=1UL; i<a.size(); ++i )
641 maximum =
max( maximum, a[i] );
Header file for the isnan shim.
Header file for auxiliary alias declarations.
Constraint on the data type.
Header file for mathematical functions.
Header file for basic type definitions.
Header file for the SparseVector base class.
BLAZE_ALWAYS_INLINE const complex< int8_t > sum(const SIMDcint8 &a) noexcept
Returns the sum of all elements in the 8-bit integral complex SIMD vector.
Definition: Reduction.h:63
Header file for the square shim.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
const ElementType_< VT > sqrLength(const DenseVector< VT, TF > &dv)
Calculation of the dense vector square length .
Definition: DenseVector.h:521
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1669
Header file for the DenseVector base class.
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1716
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Header file for the vector transpose flag types.
auto length(const DenseVector< VT, TF > &dv) -> decltype(sqrt(sqrLength(~dv)))
Calculation of the dense vector length .
Definition: DenseVector.h:574
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
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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
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:655
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2641
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2645
const DMatForEachExpr< MT, Sqrt, SO > sqrt(const DenseMatrix< MT, SO > &dm)
Computes the square root of each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1282
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:444
Header file for run time assertion macros.
bool equal(const T1 &a, const T2 &b)
Generic equality check.
Definition: Equal.h:73
#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
bool isUniform(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a uniform matrix.
Definition: DenseMatrix.h:982
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:110
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
Header file for the isDivisor shim.
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289