Go to the documentation of this file.
24 #define VecFunc(fnName) \
25 template<typename T, typename Allocator> \
26 inline Vector<T, Allocator> fnName(const Vector<T,Allocator>& v) \
28 Vector<T, Allocator> res(v.name(), v.capacity(), 0 ,RESERVE()); \
31 res.push_back( fnName(e) ); \
33 return std::move(res); \
35 template<typename T, typename Allocator, typename indexFunc> \
36 inline Vector<T, Allocator> fnName(const Vector<T, Allocator>& v, indexFunc iFn) \
38 Vector<T, Allocator> res(v.name(), v.capacity(), 0, RESERVE()); \
39 for(size_t i=0; i<v.size(); i++) \
42 res.push_back(fnName(v[i])); \
44 res.push_back(v[i]); \
46 return std::move(res); \
49 #define VecFunc2(fnName) \
50 template<typename T, typename Allocator> \
51 inline Vector<T, Allocator> fnName(const Vector<T, Allocator>& v1, const Vector<T, Allocator>& v2) \
53 Vector<T, Allocator> res(v1.name(), v1.capacity(), 0 ,RESERVE()); \
54 for(size_t i=0; i<v1.size(); i++) \
56 res.push_back( fnName(v1[i], v2[i])); \
58 return std::move(res); \
60 template<typename T, typename Allocator, typename indexFunc> \
61 inline Vector<T, Allocator> fnName(const Vector<T, Allocator>& v1, const Vector<T, Allocator>& v2, indexFunc iFn) \
63 Vector<T, Allocator> res(v1.name(), v1.capacity(), 0 ,RESERVE()); \
64 for(size_t i=0; i<v1.size(); i++) \
67 res.push_back(fnName(v1[i], v2[i])); \
69 res.push_back(v1[i]); \
71 return std::move(res); \
115 template<
typename T,
typename Allocator>
121 res.push_back(
pow(elm,e));
123 return std::move(res);
126 template<
typename T,
typename Allocator,
typename indexFunc>
130 for(
size_t i=0; i<v.
size(); i++)
134 res.push_back(
pow(v[i],e));
141 return std::move(res);
144 template<
typename T,
typename Allocator>
147 T minVal(largestPositive<T>());
150 minVal =
min(elm, minVal);
155 template<
typename T,
typename Allocator,
typename indexFunc>
158 T minVal(largestPositive<T>());
159 for(
size_t i=0; i<v.
size(); i++)
163 minVal =
min(v[i], minVal);
170 template<
typename T,
typename Allocator>
173 T maxVal(largestNegative<T>());
176 maxVal =
max(elm, maxVal);
181 template<
typename T,
typename Allocator ,
typename indexFunc>
184 T maxVal(largestNegative<T>());
185 for(
size_t i=0; i<v.
size(); i++)
189 maxVal =
max(v[i], maxVal);
196 template<
typename T,
typename Allocator>
199 T s =
static_cast<T
>(0);
207 template<
typename T,
typename Allocator,
typename indexFunc>
210 T s =
static_cast<T
>(0);
211 for(
size_t i=0; i<v.
size(); ++i)
Vector< T, Allocator > exp(const Vector< T, Allocator > &v)
Vector< T, Allocator > atan(const Vector< T, Allocator > &v)
Vector< T, Allocator > asin(const Vector< T, Allocator > &v)
Vector< T, Allocator > cbrt(const Vector< T, Allocator > &v)
Vector< T, Allocator > sinh(const Vector< T, Allocator > &v)
Vector< T, Allocator > pow(const Vector< T, Allocator > &v1, const Vector< T, Allocator > &v2)
Vector< T, Allocator > sqrt(const Vector< T, Allocator > &v)
Vector< T, Allocator > cosh(const Vector< T, Allocator > &v)
Vector< T, Allocator > cos(const Vector< T, Allocator > &v)
T max(const internalField< T, MemorySpace > &iField)
auto size() const
Size of the vector.
Vector< T, Allocator > asinh(const Vector< T, Allocator > &v)
Vector< T, Allocator > log10(const Vector< T, Allocator > &v)
auto capacity() const
Capacity of the vector.
Vector< T, Allocator > log(const Vector< T, Allocator > &v)
Vector< T, Allocator > mod(const Vector< T, Allocator > &v1, const Vector< T, Allocator > &v2)
Vector< T, Allocator > abs(const Vector< T, Allocator > &v)
T min(const internalField< T, MemorySpace > &iField)
T sum(const Vector< T, Allocator > &v)
Vector< T, Allocator > sin(const Vector< T, Allocator > &v)
const word & name() const
Name of the vector.
Vector< T, Allocator > atanh(const Vector< T, Allocator > &v)
Vector< T, Allocator > tanh(const Vector< T, Allocator > &v)
Vector< T, Allocator > atan2(const Vector< T, Allocator > &v1, const Vector< T, Allocator > &v2)
Vector< T, Allocator > tan(const Vector< T, Allocator > &v)
Vector< T, Allocator > acosh(const Vector< T, Allocator > &v)
Vector< T, Allocator > acos(const Vector< T, Allocator > &v)