35 #ifndef _BLAZE_MATH_DENSEVECTOR_H_
36 #define _BLAZE_MATH_DENSEVECTOR_H_
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 typename EnableIf< IsNumeric<T2>,
bool >::Type
100 operator==(
const DenseVector<T1,TF>& vec, T2 scalar );
102 template<
typename T1,
typename T2,
bool TF >
103 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
104 operator==( T1 scalar,
const DenseVector<T2,TF>& vec );
106 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
107 inline bool operator!=(
const DenseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
109 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
110 inline bool operator!=(
const DenseVector<T1,TF1>& lhs,
const SparseVector<T2,TF2>& rhs );
112 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
113 inline bool operator!=(
const SparseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
115 template<
typename T1,
typename T2,
bool TF >
116 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
117 operator!=(
const DenseVector<T1,TF>& vec, T2 scalar );
119 template<
typename T1,
typename T2,
bool TF >
120 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
121 operator!=( T1 scalar,
const DenseVector<T2,TF>& vec );
134 template<
typename T1
144 if( (~lhs).size() != (~rhs).size() )
return false;
152 for(
size_t i=0; i<a.size(); ++i )
153 if( !
equal( a[i], b[i] ) )
return false;
167 template<
typename T1
178 if( (~lhs).size() != (~rhs).size() )
return false;
188 for( ConstIterator element=b.begin(); element!=b.end(); ++element, ++i ) {
189 for( ; i<element->index(); ++i ) {
192 if( !
equal( element->value(), a[i] ) )
return false;
194 for( ; i<a.size(); ++i ) {
211 template<
typename T1
217 return ( rhs == lhs );
234 template<
typename T1
237 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
247 for(
size_t i=0; i<a.size(); ++i )
248 if( !
equal( a[i], scalar ) )
return false;
266 template<
typename T1
269 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
272 return ( vec == scalar );
285 template<
typename T1
291 return !( lhs == rhs );
304 template<
typename T1
310 return !( lhs == rhs );
323 template<
typename T1
329 return !( rhs == lhs );
346 template<
typename T1
349 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
352 return !( vec == scalar );
369 template<
typename T1
372 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
375 return !( vec == scalar );
391 template<
typename VT,
bool TF >
392 bool isnan(
const DenseVector<VT,TF>& dv );
394 template<
typename VT,
bool TF >
395 typename CMathTrait<typename VT::ElementType>::Type
length(
const DenseVector<VT,TF>& dv );
397 template<
typename VT,
bool TF >
400 template<
typename VT,
bool TF >
403 template<
typename VT,
bool TF >
429 template<
typename VT
437 for(
size_t i=0UL; i<a.size(); ++i ) {
438 if(
isnan( a[i] ) )
return true;
478 template<
typename VT
488 for(
size_t i=0UL; i<(~dv).size(); ++i )
489 sum +=
sq( (~dv)[i] );
490 return std::sqrt( sum );
508 template<
typename VT
516 ElementType
sum( 0 );
517 for(
size_t i=0UL; i<(~dv).size(); ++i )
518 sum +=
sq( (~dv)[i] );
536 template<
typename VT
547 if( a.size() == 0UL )
return ET();
550 for(
size_t i=1UL; i<a.size(); ++i )
551 minimum = min( minimum, a[i] );
569 template<
typename VT
580 if( a.size() == 0UL )
return ET();
583 for(
size_t i=1UL; i<a.size(); ++i )
584 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 <cmath> 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:4622
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:2384
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:637
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 evaluation expression.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
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:2382
CMathTrait< typename VT::ElementType >::Type length(const DenseVector< VT, TF > &dv)
Calculation of the dense vector length .
Definition: DenseVector.h:480
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:405
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.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:105
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:510
const VT::ElementType min(const SparseVector< VT, TF > &sv)
Returns the smallest element of the sparse vector.
Definition: SparseVector.h:348
Header file for the dense vector absolute value expression.