1#ifndef CLASSIC_Vector_HH
2#define CLASSIC_Vector_HH
153 std::transform(this->
begin(), this->
end(), result.
begin(), std::negate<T>());
161 std::bind(std::multiplies<T>(), std::placeholders::_1, val));
169 std::bind(std::divides<T>(), std::placeholders::_1, val));
176 std::transform(this->
begin(), this->
end(), array.
begin(), this->begin(),
184 std::transform(this->
begin(), this->
end(), array.
begin(), this->begin(),
215 return std::inner_product(V1.
begin(), V1.
end(), V2.
begin(),
T(0));
238 std::bind(std::multiplies<T>(), std::placeholders::_1, x));
250 throw SizeError(
"scaled_norm()",
"Inconsistent dimensions.");
254 for(
int i = 0; i < V.
size(); ++i) {
255 double dv = D[i] * V[i];
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 scaled_norm(const Array1D< T > D, const Vector< T > &V)
Euclidean norm of diagonal matrix D times vector V.
T operator*(const Vector< T > &, const Vector< T > &)
Vector dot product.
T euclidean_norm(const Vector< T > &)
Euclidean norm.
Vector< T > operator/(const Vector< T > &, const T &)
Vector divided by scalar.
Vector< T > operator+(const Vector< T > &, const Vector< T > &)
Vector addition.
Vector< T > operator-(const Vector< T > &, const Vector< T > &)
Vector subtraction.
T::PETE_Expr_t::PETE_Return_t sum(const PETE_Expr< T > &expr)
iterator begin()
Get beginning of data.
int size() const
Get array size.
iterator end()
Get end of data.
Array1D< T > & operator=(const Array1D< T > &)
Vector< T > & operator/=(const T &)
Divide by scalar and assign.
Vector()
Default constructor.
Vector< T > & operator-=(const Vector< T > &)
Subtract vector and assign.
Vector< T > & operator=(const Vector< T > &)
Vector< T > & operator*=(const T &)
Multiply by scalar and assign.
Vector< T > & operator+=(const Vector< T > &)
Add vector and assign.
Vector< T > operator-() const
Change sign of vector.