22 #ifndef _BLAZE_MATH_DENSEVECTOR_H_
23 #define _BLAZE_MATH_DENSEVECTOR_H_
30 #include <boost/type_traits/remove_reference.hpp>
71 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
72 inline bool operator==(
const DenseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
74 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
75 inline bool operator==(
const DenseVector<T1,TF1>& lhs,
const SparseVector<T2,TF2>& rhs );
77 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
78 inline bool operator==(
const SparseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
80 template<
typename T1,
typename T2,
bool TF >
81 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
82 operator==(
const DenseVector<T1,TF>& vec, T2 scalar );
84 template<
typename T1,
typename T2,
bool TF >
85 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
86 operator==( T1 scalar,
const DenseVector<T2,TF>& vec );
88 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
89 inline bool operator!=(
const DenseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
91 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
92 inline bool operator!=(
const DenseVector<T1,TF1>& lhs,
const SparseVector<T2,TF2>& rhs );
94 template<
typename T1,
bool TF1,
typename T2,
bool TF2 >
95 inline bool operator!=(
const SparseVector<T1,TF1>& lhs,
const DenseVector<T2,TF2>& rhs );
97 template<
typename T1,
typename T2,
bool TF >
98 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
99 operator!=(
const DenseVector<T1,TF>& vec, T2 scalar );
101 template<
typename T1,
typename T2,
bool TF >
102 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
103 operator!=( T1 scalar,
const DenseVector<T2,TF>& vec );
116 template<
typename T1
122 typedef typename T1::CompositeType CT1;
123 typedef typename T2::CompositeType CT2;
126 if( (~lhs).size() != (~rhs).size() )
return false;
134 for(
size_t i=0; i<a.size(); ++i )
135 if( !
equal( a[i], b[i] ) )
return false;
149 template<
typename T1
155 typedef typename T1::CompositeType CT1;
156 typedef typename T2::CompositeType CT2;
157 typedef typename boost::remove_reference<CT2>::type::ConstIterator ConstIterator;
160 if( (~lhs).size() != (~rhs).size() )
return false;
170 for( ConstIterator element=b.begin(); element!=b.end(); ++element, ++i ) {
171 for( ; i<element->index(); ++i ) {
174 if( !
equal( element->value(), a[i] ) )
return false;
176 for( ; i<a.size(); ++i ) {
193 template<
typename T1
199 return ( rhs == lhs );
216 template<
typename T1
219 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
222 typedef typename T1::CompositeType CT1;
229 for(
size_t i=0; i<a.size(); ++i )
230 if( !
equal( a[i], scalar ) )
return false;
248 template<
typename T1
251 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
254 return ( vec == scalar );
267 template<
typename T1
273 return !( lhs == rhs );
286 template<
typename T1
292 return !( lhs == rhs );
305 template<
typename T1
311 return !( rhs == lhs );
328 template<
typename T1
331 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
334 return !( vec == scalar );
351 template<
typename T1
354 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
357 return !( vec == scalar );
373 template<
typename VT,
bool TF >
374 inline const typename VT::ElementType
min(
const DenseVector<VT,TF>& dv );
376 template<
typename VT,
bool TF >
377 inline const typename VT::ElementType
max(
const DenseVector<VT,TF>& dv );
393 template<
typename VT
399 typedef typename VT::ElementType ET;
401 if( (~dv).size() == 0 )
return ET();
403 ET minimum( (~dv)[0] );
404 for(
size_t i=1; i<(~dv).size(); ++i )
405 minimum =
min( minimum, (~dv)[i] );
422 template<
typename VT
428 typedef typename VT::ElementType ET;
430 if( (~dv).size() == 0 )
return ET();
432 ET maximum( (~dv)[0] );
433 for(
size_t i=1; i<(~dv).size(); ++i )
434 maximum =
max( maximum, (~dv)[i] );