39 #ifndef BRIDGE_MAT_VEC_OPERATIONS_H_
40 #define BRIDGE_MAT_VEC_OPERATIONS_H_
45 namespace AlgebraCommon{
47 template<
typename TAlgebra>
69 for(
size_t i=0; i<vsac->size(); i++)
71 scaling.push_back(scale*vsac->scaling[i]);
72 vecs.push_back(vsac->vecs[i]);
80 for(
size_t i=0; i<vsac->size(); i++)
82 scaling.push_back(scale*vsac->scaling[i]);
83 vecs.push_back(vsac->vecs[i]);
89 for(
size_t i=0; i<vsac->size(); i++)
91 scaling.push_back(scale*vsac->scaling[i]);
92 vecs.push_back(vsac->vecs[i]);
115 for(
size_t i=0; i<
size(); i++)
131 std::vector<SmartPtr<vector_type> >
vecs;
134 template<
typename TAlgebra>
140 template<
typename TAlgebra>
147 template<
typename TAlgebra>
150 return v1->dotprod(*v2);
165 template<
typename TAlgebra>
169 return VecProd2<TAlgebra>(v1, v2);
172 template<
typename TAlgebra>
176 return VecProd2<TAlgebra>(v1, v2);
179 template<
typename TAlgebra>
186 template<
typename TAlgebra>
193 template<
typename TAlgebra>
203 template<
typename vector_t>
204 inline void VecScaleAdd2(vector_t &dest,
double alpha1,
const vector_t &v1,
double alpha2,
const vector_t &v2)
210 template<
typename vector_t>
211 inline void VecScaleAdd3(vector_t &dest,
double alpha1,
const vector_t &v1,
double alpha2,
const vector_t &v2,
double alpha3,
const vector_t &v3)
213 VecScaleAdd(dest, alpha1, v1, alpha2, v2, alpha3, v3);
describes a linear mapping X->Y
Definition: linear_operator.h:80
Definition: bridge_mat_vec_operations.h:49
std::vector< SmartPtr< vector_type > > vecs
Definition: bridge_mat_vec_operations.h:131
VecScaleAddClass(double scale, SmartPtr< VecScaleAddClass< TAlgebra > > vsac, double scale1, SmartPtr< vector_type > v1)
Definition: bridge_mat_vec_operations.h:65
VecScaleAddClass(double scale1, SmartPtr< vector_type > v1, double scale, SmartPtr< VecScaleAddClass< TAlgebra > > vsac)
Definition: bridge_mat_vec_operations.h:76
void assign(SmartPtr< vector_type > p)
Definition: bridge_mat_vec_operations.h:112
std::vector< double > scaling
Definition: bridge_mat_vec_operations.h:130
VecScaleAddClass(double scale1, SmartPtr< vector_type > v1)
Definition: bridge_mat_vec_operations.h:52
TAlgebra::vector_type vector_type
Definition: bridge_mat_vec_operations.h:50
SmartPtr< vector_type > eval()
Definition: bridge_mat_vec_operations.h:105
VecScaleAddClass(double scale, SmartPtr< VecScaleAddClass< TAlgebra > > vsac)
Definition: bridge_mat_vec_operations.h:87
VecScaleAddClass(const VecScaleAddClass< TAlgebra > &parent)
Definition: bridge_mat_vec_operations.h:98
VecScaleAddClass()
Definition: bridge_mat_vec_operations.h:96
size_t size() const
Definition: bridge_mat_vec_operations.h:103
VecScaleAddClass(double scale1, SmartPtr< vector_type > v1, double scale2, SmartPtr< vector_type > v2)
Definition: bridge_mat_vec_operations.h:57
@ PST_CONSISTENT
Definition: parallel_storage_type.h:68
#define UG_THROW(msg)
Definition: error.h:57
void VecScaleAdd(vector_t &vOut, typename vector_t::value_type s1, const vector_t &v1, typename vector_t::value_type s2, const vector_t &v2)
Scales two Vectors, adds them and returns the sum in a third vector.
Definition: math_vector_functions_common_impl.hpp:265
void Assign(SmartPtr< typename TAlgebra::vector_type > p, SmartPtr< VecScaleAddClass< TAlgebra > > vsac)
Definition: bridge_mat_vec_operations.h:135
double VecScaleAddProd2(SmartPtr< VecScaleAddClass< TAlgebra > > vsac, SmartPtr< typename TAlgebra::vector_type > v1)
Definition: bridge_mat_vec_operations.h:173
double VecMaxNorm(SmartPtr< typename TAlgebra::vector_type > v)
Definition: bridge_mat_vec_operations.h:187
double VecProd2(SmartPtr< typename TAlgebra::vector_type > v1, SmartPtr< typename TAlgebra::vector_type > v2)
Definition: bridge_mat_vec_operations.h:148
void VecScaleAdd3(vector_t &dest, double alpha1, const vector_t &v1, double alpha2, const vector_t &v2, double alpha3, const vector_t &v3)
calculates dest = alpha1*v1 + alpha2*v2 + alpha3*v3
Definition: bridge_mat_vec_operations.h:211
void VecScaleAdd2(vector_t &dest, double alpha1, const vector_t &v1, double alpha2, const vector_t &v2)
calculates dest = alpha1*v1 + alpha2*v2
Definition: bridge_mat_vec_operations.h:204
SmartPtr< typename TAlgebra::vector_type > Eval(SmartPtr< VecScaleAddClass< TAlgebra > > vsac)
Definition: bridge_mat_vec_operations.h:141
double VecScaleAddProd1(SmartPtr< typename TAlgebra::vector_type > v1, SmartPtr< VecScaleAddClass< TAlgebra > > vsac)
Definition: bridge_mat_vec_operations.h:166
SmartPtr< T > VecProdOp(SmartPtr< ILinearOperator< T, T > > op, SmartPtr< T > v)
Definition: bridge_mat_vec_operations.h:154
double VecScaleAddNorm(SmartPtr< VecScaleAddClass< TAlgebra > > vsac)
Definition: bridge_mat_vec_operations.h:194
double VecNorm(SmartPtr< typename TAlgebra::vector_type > v)
Definition: bridge_mat_vec_operations.h:180
void VecScaleAssign(double &dest, double alpha1, const double &v1)
calculates dest = alpha1*v1. for doubles
Definition: operations_vec.h:49