35 #ifndef _BLAZE_MATH_DENSE_DENSEVECTOR_H_
36 #define _BLAZE_MATH_DENSE_DENSEVECTOR_H_
72 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
73 inline bool operator==(
const DenseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
75 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
76 inline bool operator==(
const DenseVector<T1,TF1>& lhs,
const SparseVector<T2,TF2>& rhs );
78 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
79 inline bool operator==(
const SparseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
81 template<
typename T1,
typename T2,
bool TF >
82 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
83 operator==(
const DenseVector<T1,TF>& vec, T2 scalar );
85 template<
typename T1,
typename T2,
bool TF >
86 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
87 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 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 );
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
220 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
230 for(
size_t i=0; i<a.size(); ++i )
231 if( !
equal( a[i], scalar ) )
return false;
249 template<
typename T1
252 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
255 return ( vec == scalar );
268 template<
typename T1
274 return !( lhs == rhs );
287 template<
typename T1
293 return !( lhs == rhs );
306 template<
typename T1
312 return !( rhs == lhs );
329 template<
typename T1
332 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
335 return !( vec == scalar );
352 template<
typename T1
355 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
358 return !( vec == scalar );
374 template<
typename VT,
bool TF >
375 bool isnan(
const DenseVector<VT,TF>& dv );
377 template<
typename VT,
bool TF >
378 typename CMathTrait<typename VT::ElementType>::Type
length(
const DenseVector<VT,TF>& dv );
380 template<
typename VT,
bool TF >
383 template<
typename VT,
bool TF >
386 template<
typename VT,
bool TF >
412 template<
typename VT
420 for(
size_t i=0UL; i<a.size(); ++i ) {
421 if(
isnan( a[i] ) )
return true;
461 template<
typename VT
471 for(
size_t i=0UL; i<(~dv).
size(); ++i )
472 sum +=
sq( (~dv)[i] );
473 return std::sqrt( sum );
491 template<
typename VT
499 ElementType
sum( 0 );
500 for(
size_t i=0UL; i<(~dv).
size(); ++i )
501 sum +=
sq( (~dv)[i] );
519 template<
typename VT
530 if( a.size() == 0UL )
return ET();
533 for(
size_t i=1UL; i<a.size(); ++i )
534 minimum =
min( minimum, a[i] );
552 template<
typename VT
563 if( a.size() == 0UL )
return ET();
566 for(
size_t i=1UL; i<a.size(); ++i )
567 maximum =
max( maximum, a[i] );
Header file for the isnan shim.
BLAZE_ALWAYS_INLINE int16_t sum(const sse_int16_t &a)
Returns the sum of all elements in the 16-bit integral intrinsic vector.
Definition: Reduction.h:63
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:994
Constraint on the data type.
Header file for mathematical functions.
Header file for the SparseVector base class.
Header file for the square shim.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
double Type
Return type of the functions for integral and double arguments.
Definition: CMathTrait.h:79
const Quaternion< Type > sq(const Quaternion< Type > &m)
Squaring the given quaternion.
Definition: Quaternion.h:1034
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
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:609
Header file for the vector transpose flag types.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:947
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.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
CMathTrait< typename VT::ElementType >::Type length(const DenseVector< VT, TF > &dv)
Calculation of the dense vector length .
Definition: DenseVector.h:463
Header file for the EnableIf class template.
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.
bool equal(const T1 &a, const T2 &b)
Generic equality check.
Definition: Equal.h:376
#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
Header file for the isDefault shim.
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
Header file for the RemoveReference type trait.
Header file for the cmath trait.
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
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:493