www.cemf.ir
VectorMath.hpp File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 pFlow
 

Macros

#define VecFunc(fnName)
 
#define VecFunc2(fnName)
 

Functions

template<typename T , typename Allocator >
Vector< T, Allocator > abs (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > abs (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > mod (const Vector< T, Allocator > &v1, const Vector< T, Allocator > &v2)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > mod (const Vector< T, Allocator > &v1, const Vector< T, Allocator > &v2, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > exp (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > exp (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > log (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > log (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > log10 (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > log10 (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > pow (const Vector< T, Allocator > &v1, const Vector< T, Allocator > &v2)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > pow (const Vector< T, Allocator > &v1, const Vector< T, Allocator > &v2, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > sqrt (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > sqrt (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > cbrt (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > cbrt (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > sin (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > sin (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > cos (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > cos (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > tan (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > tan (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > asin (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > asin (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > acos (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > acos (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > atan (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > atan (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > atan2 (const Vector< T, Allocator > &v1, const Vector< T, Allocator > &v2)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > atan2 (const Vector< T, Allocator > &v1, const Vector< T, Allocator > &v2, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > sinh (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > sinh (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > cosh (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > cosh (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > tanh (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > tanh (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > asinh (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > asinh (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > acosh (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > acosh (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > atanh (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > atanh (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
Vector< T, Allocator > pow (const Vector< T, Allocator > &v, T e)
 
template<typename T , typename Allocator , typename indexFunc >
Vector< T, Allocator > pow (const Vector< T, Allocator > &v, T e, indexFunc iFn)
 
template<typename T , typename Allocator >
min (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
min (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
max (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
max (const Vector< T, Allocator > &v, indexFunc iFn)
 
template<typename T , typename Allocator >
sum (const Vector< T, Allocator > &v)
 
template<typename T , typename Allocator , typename indexFunc >
sum (const Vector< T, Allocator > &v, indexFunc iFn)
 

Macro Definition Documentation

◆ VecFunc

#define VecFunc (   fnName)
Value:
template<typename T, typename Allocator> \
inline Vector<T, Allocator> fnName(const Vector<T,Allocator>& v) \
{ \
Vector<T, Allocator> res(v.name(), v.capacity(), 0 ,RESERVE()); \
for(auto& e:v) \
{ \
res.push_back( fnName(e) ); \
} \
return std::move(res); \
} \
template<typename T, typename Allocator, typename indexFunc> \
inline Vector<T, Allocator> fnName(const Vector<T, Allocator>& v, indexFunc iFn) \
{ \
Vector<T, Allocator> res(v.name(), v.capacity(), 0, RESERVE()); \
for(size_t i=0; i<v.size(); i++) \
{ \
if( iFn(i) ) \
res.push_back(fnName(v[i])); \
else \
res.push_back(v[i]); \
} \
return std::move(res); \
}

Definition at line 24 of file VectorMath.hpp.

◆ VecFunc2

#define VecFunc2 (   fnName)
Value:
template<typename T, typename Allocator> \
inline Vector<T, Allocator> fnName(const Vector<T, Allocator>& v1, const Vector<T, Allocator>& v2) \
{ \
Vector<T, Allocator> res(v1.name(), v1.capacity(), 0 ,RESERVE()); \
for(size_t i=0; i<v1.size(); i++) \
{ \
res.push_back( fnName(v1[i], v2[i])); \
} \
return std::move(res); \
} \
template<typename T, typename Allocator, typename indexFunc> \
inline Vector<T, Allocator> fnName(const Vector<T, Allocator>& v1, const Vector<T, Allocator>& v2, indexFunc iFn) \
{ \
Vector<T, Allocator> res(v1.name(), v1.capacity(), 0 ,RESERVE()); \
for(size_t i=0; i<v1.size(); i++) \
{ \
if( iFn(i) ) \
res.push_back(fnName(v1[i], v2[i])); \
else \
res.push_back(v1[i]); \
} \
return std::move(res); \
}

Definition at line 49 of file VectorMath.hpp.

RESERVE
Definition: Vector.hpp:40