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 bool isUniform(
const DenseVector<VT,TF>& dv );
380 template<
typename VT,
bool TF >
381 typename CMathTrait<typename VT::ElementType>::Type
length(
const DenseVector<VT,TF>& dv );
383 template<
typename VT,
bool TF >
386 template<
typename VT,
bool TF >
389 template<
typename VT,
bool TF >
415 template<
typename VT
423 for(
size_t i=0UL; i<a.size(); ++i ) {
424 if(
isnan( a[i] ) )
return true;
457 template<
typename VT
464 if( (~dv).
size() < 2UL )
469 ConstReference cmp( (~dv)[0UL] );
471 for(
size_t i=1UL; i<(~dv).
size(); ++i ) {
472 if( (~dv)[i] != cmp )
514 template<
typename VT
524 for(
size_t i=0UL; i<(~dv).
size(); ++i )
525 sum +=
sq( (~dv)[i] );
526 return std::sqrt( sum );
544 template<
typename VT
552 ElementType
sum( 0 );
553 for(
size_t i=0UL; i<(~dv).
size(); ++i )
554 sum +=
sq( (~dv)[i] );
572 template<
typename VT
583 if( a.size() == 0UL )
return ET();
586 for(
size_t i=1UL; i<a.size(); ++i )
587 minimum =
min( minimum, a[i] );
605 template<
typename VT
616 if( a.size() == 0UL )
return ET();
619 for(
size_t i=1UL; i<a.size(); ++i )
620 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:1649
Constraint on the data type.
Header file for mathematical functions.
Header file for basic type definitions.
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:264
double Type
Return type of the functions for integral and double arguments.
Definition: CMathTrait.h:79
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
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
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:861
Header file for the vector transpose flag types.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1602
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:2505
CMathTrait< typename VT::ElementType >::Type length(const DenseVector< VT, TF > &dv)
Calculation of the dense vector length .
Definition: DenseVector.h:516
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2509
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.
Header file for the RemoveReference type trait.
Header file for the cmath trait.
bool isUniform(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a uniform matrix.
Definition: DenseMatrix.h:910
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
const MultExprTrait< T, T >::Type sq(const T &a)
Squaring the given value/object.
Definition: Square.h:65
const VT::ElementType sqrLength(const DenseVector< VT, TF > &dv)
Calculation of the dense vector square length .
Definition: DenseVector.h:546