1 #ifndef CLASSIC_FVector_HH
2 #define CLASSIC_FVector_HH
37 template<
class T,
int N>
77 template<
class T,
int N>
81 template<
class T,
int N>
85 template<
class T,
int N>
89 template<
class T,
int N>
93 template<
class T,
int N>
97 template<
class T,
int N>
101 template<
class T,
int N>
105 template<
class T,
int N>
112 template<
class T,
int N>
118 template<
class T,
int N>
124 template<
class T,
int N>
130 template<
class T,
int N>
136 template<
class T,
int N>
139 std::transform(this->
begin(), this->
end(), result.
begin(), std::negate<T>());
144 template<
class T,
int N>
147 std::bind(std::multiplies<T>(), std::placeholders::_1, val));
152 template<
class T,
int N>
155 std::bind(std::divides<T>(), std::placeholders::_1, val));
160 template<
class T,
int N>
162 std::transform(this->
begin(), this->
end(), rhs.
begin(), this->begin(),
168 template<
class T,
int N>
170 std::transform(this->
begin(), this->
end(), rhs.
begin(), this->begin(),
179 template<
class T,
int N>
183 result.
begin(), std::plus<T>());
188 template<
class T,
int N>
192 result.
begin(), std::minus<T>());
199 template<
class T,
int N>
201 return std::inner_product(lhs.
begin(), lhs.
end(), rhs.
begin(),
T(0));
205 template<
class T,
int N>
212 template<
class T,
int N>
220 template<
class T,
int N>
224 std::bind(std::multiplies<T>(), std::placeholders::_1, x));
229 template<
class T,
int N>
235 template<
class T,
int N>
239 for(
int i = 0; i < V.
size(); ++i) {
240 double dv = D[i] * V[i];
Tps< T > sqrt(const Tps< T > &x)
Square root.
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
PartBunchBase< T, Dim >::ConstIterator begin(PartBunchBase< T, Dim > const &bunch)
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.
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.