35 #ifndef _BLAZE_MATH_DENSEVECTOR_H_
36 #define _BLAZE_MATH_DENSEVECTOR_H_
92 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
93 inline bool operator==(
const DenseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
95 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
96 inline bool operator==(
const DenseVector<T1,TF1>& lhs,
const SparseVector<T2,TF2>& rhs );
98 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
99 inline bool operator==(
const SparseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
101 template<
typename T1,
typename T2,
bool TF >
102 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
103 operator==(
const DenseVector<T1,TF>& vec, T2 scalar );
105 template<
typename T1,
typename T2,
bool TF >
106 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
107 operator==( T1 scalar,
const DenseVector<T2,TF>& vec );
109 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
110 inline bool operator!=(
const DenseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
112 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
113 inline bool operator!=(
const DenseVector<T1,TF1>& lhs,
const SparseVector<T2,TF2>& rhs );
115 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
116 inline bool operator!=(
const SparseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
118 template<
typename T1,
typename T2,
bool TF >
119 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
120 operator!=(
const DenseVector<T1,TF>& vec, T2 scalar );
122 template<
typename T1,
typename T2,
bool TF >
123 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
124 operator!=( T1 scalar,
const DenseVector<T2,TF>& vec );
137 template<
typename T1
147 if( (~lhs).size() != (~rhs).size() )
return false;
155 for(
size_t i=0; i<a.size(); ++i )
156 if( !
equal( a[i], b[i] ) )
return false;
170 template<
typename T1
181 if( (~lhs).size() != (~rhs).size() )
return false;
191 for( ConstIterator element=b.begin(); element!=b.end(); ++element, ++i ) {
192 for( ; i<element->index(); ++i ) {
195 if( !
equal( element->value(), a[i] ) )
return false;
197 for( ; i<a.size(); ++i ) {
214 template<
typename T1
220 return ( rhs == lhs );
237 template<
typename T1
240 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
250 for(
size_t i=0; i<a.size(); ++i )
251 if( !
equal( a[i], scalar ) )
return false;
269 template<
typename T1
272 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
275 return ( vec == scalar );
288 template<
typename T1
294 return !( lhs == rhs );
307 template<
typename T1
313 return !( lhs == rhs );
326 template<
typename T1
332 return !( rhs == lhs );
349 template<
typename T1
352 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
355 return !( vec == scalar );
372 template<
typename T1
375 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
378 return !( vec == scalar );
394 template<
typename VT,
bool TF >
395 bool isnan(
const DenseVector<VT,TF>& dv );
397 template<
typename VT,
bool TF >
398 typename CMathTrait<typename VT::ElementType>::Type
length(
const DenseVector<VT,TF>& dv );
400 template<
typename VT,
bool TF >
403 template<
typename VT,
bool TF >
406 template<
typename VT,
bool TF >
432 template<
typename VT
440 for(
size_t i=0UL; i<a.size(); ++i ) {
441 if(
isnan( a[i] ) )
return true;
481 template<
typename VT
491 for(
size_t i=0UL; i<(~dv).size(); ++i )
492 sum +=
sq( (~dv)[i] );
493 return std::sqrt( sum );
511 template<
typename VT
519 ElementType
sum( 0 );
520 for(
size_t i=0UL; i<(~dv).size(); ++i )
521 sum +=
sq( (~dv)[i] );
539 template<
typename VT
550 if( a.size() == 0UL )
return ET();
553 for(
size_t i=1UL; i<a.size(); ++i )
554 minimum = min( minimum, a[i] );
572 template<
typename VT
583 if( a.size() == 0UL )
return ET();
586 for(
size_t i=1UL; i<a.size(); ++i )
587 maximum = max( maximum, a[i] );
Header file for the isnan shim.
Constraint on the data type.
Header file for mathematical functions.
Header file for the dense vector/dense vector multiplication expression.
Header file for the SparseVector base class.
Header file for the dense vector/dense vector subtraction expression.
double Type
Return type of the functions for integral and double arguments.
Definition: CMathTrait.h:79
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4642
const Quaternion< Type > sq(const Quaternion< Type > &m)
Squaring the given quaternion.
Definition: Quaternion.h:1034
int16_t sum(const sse_int16_t &a)
Returns the sum of all elements in the 16-bit integral intrinsic vector.
Definition: Reduction.h:62
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2408
Header file for the DenseVector base class.
bool isnan(const DenseMatrix< MT, SO > &dm)
Checks the given dense matrix for not-a-number elements.
Definition: DenseMatrix.h:640
Header file for the dense vector transpose expression.
Header file for the vector transpose flag types.
Header file for the dense vector/sparse vector addition expression.
Header file for the dense vector/scalar division expression.
Header file for the dense vector SMP implementation.
Header file for the dense vector evaluation expression.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
Header file for the dense vector/sparse vector cross product expression.
Header file for the dense vector/dense vector cross product expression.
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 dense vector/dense vector inner product expression.
Header file for the dense vector/sparse vector subtraction expression.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2406
CMathTrait< typename VT::ElementType >::Type length(const DenseVector< VT, TF > &dv)
Calculation of the dense vector length .
Definition: DenseVector.h:483
Header file for the dense vector serial evaluation expression.
Header file for the EnableIf class template.
Header file for the equal shim.
Header file for the IsNumeric type trait.
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
Header file for run time assertion macros.
Header file for all basic Vector functionality.
bool equal(const T1 &a, const T2 &b)
Generic equality check.
Definition: Equal.h:352
Header file for the square shim.
#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:79
const VT::ElementType max(const SparseVector< VT, TF > &sv)
Returns the largest element of the sparse vector.
Definition: SparseVector.h:408
Header file for the isDefault shim.
Header file for the RemoveReference type trait.
Header file for the cmath trait.
Header file for the sparse vector/dense vector subtraction expression.
Header file for the dense vector/scalar multiplication expression.
Header file for the sparse vector/sparse vector cross product expression.
Header file for the sparse vector SMP implementation.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
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 sparse vector/sparse vector cross product expression.
Header file for the dense vector/dense vector addition expression.
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
Header file for basic type definitions.
const VT::ElementType sqrLength(const DenseVector< VT, TF > &dv)
Calculation of the dense vector square length .
Definition: DenseVector.h:513
const VT::ElementType min(const SparseVector< VT, TF > &sv)
Returns the smallest element of the sparse vector.
Definition: SparseVector.h:351
Header file for the dense vector absolute value expression.