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>
168 template<
class T,
int N>
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];
247 #endif // CLASSIC_FVector_HH
A templated representation for vectors.
Tps< T > sqrt(const Tps< T > &x)
Square root.
FVector operator-() const
Change sign.
FVector & operator*=(const T &)
Multiply by scalar and assign.
T scaled_norm(const Array1D< T > D, const Vector< T > &V)
Euclidean norm of diagonal matrix D times vector V.
Matrix< T > operator-(const Matrix< T > &, const Matrix< T > &)
Matrix subtraction.
int size() const
Get array size.
FVector & operator-=(const FVector &)
Subtract FVector and assign.
Matrix< T > operator*(const Matrix< T > &, const Matrix< T > &)
Matrix multiply.
clearpage the user may choose between constant or variable radius This model includes fringe fields begin
T euclidean_norm(const Vector< T > &)
Euclidean norm.
T::PETE_Expr_t::PETE_Return_t sum(const PETE_Expr< T > &expr)
FVector & operator/=(const T &)
Divide by scalar and assign.
iterator end()
Get iterator pointing past end of array.
Matrix< T > operator+(const Matrix< T > &, const Matrix< T > &)
Matrix addition.
FVector & operator+=(const FVector &)
Add FVector and assign.
A templated representation for one-dimensional arrays.
Matrix< T > operator/(const Matrix< T > &, const T &)
Matrix divided by scalar.
iterator begin()
Get iterator pointing to beginning of array.