1 #ifndef SELDON_FILE_VECTOR_EXPRESSION_INLINE_CXX
7 template<
class T,
class E>
10 return static_cast<const E&
>(*this).GetSize();
15 template<
class T,
class E>
18 return static_cast<const E&
>(*this)(i);
23 template<
class T,
class E1,
class E2>
template<
class T1,
class T2>
29 #ifdef SELDON_CHECK_DIMENSIONS
30 if (u_.GetSize() != v_.GetSize())
32 string(
"Cannot subtract u and v because the sizes ")
40 template<
class T,
class E1,
class E2>
48 template<
class T,
class E1,
class E2>
56 template<
class T,
class E1,
class E2>
template<
class T1,
class T2>
61 #ifdef SELDON_CHECK_DIMENSIONS
62 if (
long(u_.GetSize()) !=
long(v_.GetSize()))
64 string(
"Cannot Add u and v because the sizes ")
72 template<
class T,
class E1,
class E2>
80 template<
class T,
class E1,
class E2>
88 template<
class T,
class E1,
class E2>
template<
class T1,
class T2>
94 #ifdef SELDON_CHECK_DIMENSIONS
95 if (u_.GetSize() != v_.GetSize())
97 string(
"Cannot multiply u and v because the sizes ")
105 template<
class T,
class E1,
class E2>
113 template<
class T,
class E1,
class E2>
116 return u_(i) * v_(i);
121 template<
class T,
class E1,
class E2>
template<
class T1,
class T2>
127 #ifdef SELDON_CHECK_DIMENSIONS
128 if (u_.GetSize() != v_.GetSize())
130 string(
"Cannot divide u and v because the sizes ")
138 template<
class T,
class E1,
class E2>
146 template<
class T,
class E1,
class E2>
149 return u_(i) / v_(i);
154 template<
class T,
class T0,
class E>
template<
class T1>
157 : alpha_(alpha), u_(u)
163 template<
class T,
class T0,
class E>
171 template<
class T,
class T0,
class E>
179 template<
class T,
class T0,
class E>
template<
class T1>
182 : alpha_(alpha), u_(u)
188 template<
class T,
class T0,
class E>
196 template<
class T,
class T0,
class E>
199 return alpha_ / u_(i);
204 template<
class T,
class T0,
class E>
template<
class T1>
207 : alpha_(alpha), u_(u)
213 template<
class T,
class T0,
class E>
221 template<
class T,
class T0,
class E>
224 return alpha_ + u_(i);
229 template<
class T,
class T0,
class E>
template<
class T1>
232 : alpha_(alpha), u_(u)
238 template<
class T,
class T0,
class E>
246 template<
class T,
class T0,
class E>
249 return alpha_ - u_(i);
254 template<
class T,
class E>
262 template<
class T,
class E>
270 template<
class T,
class E>
283 template<
class T,
class E1,
class E2>
293 template<
class T,
class E1,
class E2>
294 inline const VectorSum<complex<T>, E1, E2>
303 template<
class T,
class E1,
class E2>
304 inline const VectorSum<complex<T>, E1, E2>
313 template<
class T,
class E1,
class E2>
314 inline const VectorDifference<T, E1, E2>
323 template<
class T,
class E1,
class E2>
324 inline const VectorDifference<complex<T>, E1, E2>
333 template<
class T,
class E1,
class E2>
334 inline const VectorDifference<complex<T>, E1, E2>
343 template<
class T,
class E1,
class E2>
344 inline const VectorProduct<T, E1, E2>
353 template<
class T,
class E1,
class E2>
354 inline const VectorProduct<complex<T>, E1, E2>
363 template<
class T,
class E1,
class E2>
364 inline const VectorProduct<complex<T>, E1, E2>
373 template<
class T,
class E1,
class E2>
374 inline const VectorDivision<T, E1, E2>
383 template<
class T,
class E1,
class E2>
384 inline const VectorDivision<complex<T>, E1, E2>
393 template<
class T,
class E1,
class E2>
394 inline const VectorDivision<complex<T>, E1, E2>
403 template<
class T,
class E>
404 inline const VectorScaled<T, T, E>
413 template<
class T,
class E>
414 inline const VectorScaled<complex<T>, complex<T>, E>
423 template<
class T,
class E>
424 inline const VectorScaled<complex<T>, T, E>
433 template<
class T,
class E>
442 template<
class T,
class E>
443 inline const VectorScaled<complex<T>, complex<T>, E>
445 const complex<T>& alpha)
452 template<
class T,
class E>
453 inline const VectorScaled<complex<T>, T, E>
462 template<
class T,
class E>
471 template<
class T,
class E>
472 inline const VectorScalDiv<complex<T>, complex<T>, E>
481 template<
class T,
class E>
482 inline const VectorScalDiv<complex<T>, T, E>
491 template<
class T,
class E>
495 T one; SetComplexOne(one);
501 template<
class T,
class E>
502 inline const VectorScaled<complex<T>, complex<T>, E>
504 const complex<T>& alpha)
506 T one; SetComplexOne(one);
512 template<
class T,
class E>
513 inline const VectorScaled<complex<T>, T, E>
517 T one; SetComplexOne(one);
523 template<
class T,
class E>
532 template<
class T,
class E>
533 inline const VectorScalSum<complex<T>, complex<T>, E>
542 template<
class T,
class E>
543 inline const VectorScalSum<complex<T>, T, E>
552 template<
class T,
class E>
561 template<
class T,
class E>
562 inline const VectorScalSum<complex<T>, complex<T>, E>
564 const complex<T>& alpha)
571 template<
class T,
class E>
572 inline const VectorScalSum<complex<T>, T, E>
581 template<
class T,
class E>
590 template<
class T,
class E>
591 inline const VectorScalSum<complex<T>, complex<T>, E>
593 const complex<T>& alpha)
600 template<
class T,
class E>
601 inline const VectorScalSum<complex<T>, T, E>
610 template<
class T,
class E>
619 template<
class T,
class E>
620 inline const VectorScalDiff<complex<T>, complex<T>, E>
629 template<
class T,
class E>
630 inline const VectorScalDiff<complex<T>, T, E>
639 template<
class T,
class E>
647 #define SELDON_FILE_VECTOR_EXPRESSION_INLINE_CXX
VectorScalSum(const T0 &, const VectorExpression< T1, E > &)
Constructor alpha + u with a scalar alpha and an expression u.
const TinyMatrixProduct< T, m, n, E1, E2 > operator*(const TinyMatrixExpression< T, m, n, E1 > &u, const TinyMatrixExpression< T, m, n, E2 > &v)
returns u*v element-wise
const TinyMatrixSum< T, m, n, E1, E2 > operator+(const TinyMatrixExpression< T, m, n, E1 > &u, const TinyMatrixExpression< T, m, n, E2 > &v)
returns u+v
long GetSize() const
returns the size of the associated vector
Addition between a scalar and a vector.
long GetSize() const
returns the size of the associated vector
std::string to_str(const T &input)
Converts most types to string.
Expression between vectors.
VectorScaled(const T0 &, const VectorExpression< T1, E > &)
Constructor alpha * u with a scalar alpha and an expression u.
VectorScalDiff(const T0 &, const VectorExpression< T1, E > &)
Constructor alpha - u with a scalar alpha and an expression u.
VectorDivision(const VectorExpression< T1, E1 > &, const VectorExpression< T2, E2 > &)
Constructor u / v with two expressions u and v.
Division between a scalar and a vector.
const T operator()(long) const
returns the i-th element of the sum
const T operator()(long) const
returns the i-th element of the element-wise division
const T operator()(long) const
returns the element i of expression
long GetSize() const
returns the size of the associated vector
long GetSize() const
returns the size of the associated vectors
const T operator()(long) const
returns the i-th element of the difference
const TinyMatrixDivision< T, m, n, E1, E2 > operator/(const TinyMatrixExpression< T, m, n, E1 > &u, const TinyMatrixExpression< T, m, n, E2 > &v)
returns u/v element-wise
Sum between two expressions.
const T operator()(long) const
returns the i-th element of alpha*u
Subtraction between a scalar and a vector.
Division between two expressions (elementwise)
const T operator()(long) const
returns the i-th element of alpha - u
long GetSize() const
returns the size of the associated vectors
VectorSum(const VectorExpression< T1, E1 > &, const VectorExpression< T2, E2 > &)
Constructor u+v with two expressions u and v.
long GetSize() const
returns the size of the associated vector
const T operator()(long) const
returns the i-th element of the element-wise product
const TinyMatrixDifference< T, m, n, E1, E2 > operator-(const TinyMatrixExpression< T, m, n, E1 > &u, const TinyMatrixExpression< T, m, n, E2 > &v)
returns u-v
long GetSize() const
returns the size of the associated vector
VectorDifference(const VectorExpression< T1, E1 > &, const VectorExpression< T2, E2 > &)
Constructor u-v with two expressions u and v.
long GetSize() const
returns the size of the associated vectors
long GetSize() const
returns the size of the associated vectors
VectorOpposite(const VectorExpression< T, E > &)
Constructor -u with an expression u.
Product between two expressions (elementwise)
VectorScalDiv(const T0 &, const VectorExpression< T1, E > &)
Constructor alpha / u with a scalar alpha and an expression u.
VectorProduct(const VectorExpression< T1, E1 > &, const VectorExpression< T2, E2 > &)
Constructor u*v with two expressions u and v.
const T operator()(long) const
returns the i-th element of -u
const T operator()(long) const
returns the i-th element of alpha + u
const T operator()(long) const
returns the i-th element of alpha / u
Multiplication between a scalar and a vector.
long GetSize() const
returns the size of the associated vector
Difference between two expressions.