1#ifndef CLASSIC_FVector_HH
2#define CLASSIC_FVector_HH
37template<
class T,
int N>
77template<
class T,
int N>
81template<
class T,
int N>
85template<
class T,
int N>
89template<
class T,
int N>
93template<
class T,
int N>
97template<
class T,
int N>
101template<
class T,
int N>
105template<
class T,
int N>
112template<
class T,
int N>
118template<
class T,
int N>
124template<
class T,
int N>
130template<
class T,
int N>
136template<
class T,
int N>
139 std::transform(this->
begin(), this->
end(), result.
begin(), std::negate<T>());
144template<
class T,
int N>
147 std::bind(std::multiplies<T>(), std::placeholders::_1, val));
152template<
class T,
int N>
155 std::bind(std::divides<T>(), std::placeholders::_1, val));
160template<
class T,
int N>
162 std::transform(this->
begin(), this->
end(), rhs.
begin(), this->begin(),
168template<
class T,
int N>
170 std::transform(this->
begin(), this->
end(), rhs.
begin(), this->begin(),
179template<
class T,
int N>
183 result.
begin(), std::plus<T>());
188template<
class T,
int N>
192 result.
begin(), std::minus<T>());
199template<
class T,
int N>
201 return std::inner_product(lhs.
begin(), lhs.
end(), rhs.
begin(),
T(0));
205template<
class T,
int N>
212template<
class T,
int N>
220template<
class T,
int N>
224 std::bind(std::multiplies<T>(), std::placeholders::_1, x));
229template<
class T,
int N>
235template<
class T,
int N>
239 for(
int i = 0; i < V.
size(); ++i) {
240 double dv = D[i] * V[i];
FVector< T, N > operator-(const FVector< T, N > &, const FVector< T, N > &)
Subtract.
T scaled_norm(const FArray1D< T, N > D, const FVector< T, N > &V)
Euclidean norm of diagonal matrix D times FVector V.
T euclidean_norm(const FVector< T, N > &)
Euclidean norm.
FVector< T, N > operator/(const FVector< T, N > &, const T &)
Divide.
FVector< T, N > operator+(const FVector< T, N > &, const FVector< T, N > &)
Add.
T operator*(const FVector< T, N > &, const FVector< T, N > &)
Dot product.
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
PartBunchBase< T, Dim >::ConstIterator begin(PartBunchBase< T, Dim > const &bunch)
Tps< T > sqrt(const Tps< T > &x)
Square root.
T::PETE_Expr_t::PETE_Return_t sum(const PETE_Expr< T > &expr)
A templated representation for one-dimensional arrays.
int size() const
Get array size.
iterator end()
Get iterator pointing past end of array.
iterator begin()
Get iterator pointing to beginning of array.
A templated representation for vectors.
FVector & operator*=(const T &)
Multiply by scalar and assign.
FVector(const T *t)
Constructor.
FVector(const T &t)
Constructor.
FVector(const FArray1D< T, N > &)
Conversion from one-dimensional array.
FVector & operator+=(const FVector &)
Add FVector and assign.
FVector & operator-=(const FVector &)
Subtract FVector and assign.
FVector & operator/=(const T &)
Divide by scalar and assign.
FVector operator-() const
Change sign.