33 #include "../operations_vec.h"
39 template<
typename vector_t,
typename matrix_t>
43 static inline bool MatMult(vector_t &dest,
44 const number &beta1,
const matrix_t &A1,
const vector_t &w1)
46 for(
size_t i=0; i<dest.size(); i++)
49 A1.mat_mult_add_row(i, dest[i], beta1, w1);
56 const number &alpha1,
const vector_t &v1,
57 const number &beta1,
const matrix_t &A1,
const vector_t &w1)
59 for(
size_t i=0; i<dest.size(); i++)
62 A1.mat_mult_add_row(i, dest[i], beta1, w1);
69 const number &alpha1,
const vector_t &v1,
70 const number &alpha2,
const vector_t &v2,
71 const number &beta1,
const matrix_t &A1,
const vector_t &w1)
73 for(
size_t i=0; i<dest.size(); i++)
76 A1.cast().mat_mult_add_row(i, dest[i], beta1, w1);
84 const number &beta1,
const matrix_t &A1,
const vector_t &w1,
85 const number &beta2,
const matrix_t &A2,
const vector_t &w2)
87 for(
size_t i=0; i<dest.size(); i++)
90 A1.cast().mat_mult_add_row(i, dest[i], beta1, w1);
91 A2.cast().mat_mult_add_row(i, dest[i], beta2, w2);
99 const number &alpha1,
const vector_t &v1,
100 const number &beta1,
const matrix_t &A1,
const vector_t &w1,
101 const number &beta2,
const matrix_t &A2,
const vector_t &w2)
103 for(
size_t i=0; i<dest.size(); i++)
106 A1.cast().mat_mult_add_row(i, dest[i], beta1, w1);
107 A2.cast().mat_mult_add_row(i, dest[i], beta2, w2);
114 const number &beta1,
const matrix_t &A1,
const vector_t &w1)
121 const number &alpha1,
const vector_t &v1,
122 const number &beta1,
const matrix_t &A1,
const vector_t &w1)
124 return MatMultTransposedAddDirect(dest, beta1, A1, w1, alpha1, w1);
double number
Definition: types.h:124
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
@ MATRIX_USE_ROW_FUNCTIONS
Definition: matrix_algebra_types.h:68
void VecScaleAssign(double &dest, double alpha1, const double &v1)
calculates dest = alpha1*v1. for doubles
Definition: operations_vec.h:49
bool MatMultTransposed(vector_t &dest, const number &beta1, const matrix_t &A1, const vector_t &w1)
calculates dest = alpha1*v1 + beta1 * A1 *w1;
Definition: operations_mat.h:111
static bool MatMultAdd(vector_t &dest, const number &alpha1, const vector_t &v1, const number &alpha2, const vector_t &v2, const number &beta1, const matrix_t &A1, const vector_t &w1)
calculates dest = alpha1*v1 + alpha2*v2 + beta1 * A1 *w1;
Definition: matrix_use_row_functions.h:68
static bool MatMultTransposed(vector_t &dest, const number &beta1, const matrix_t &A1, const vector_t &w1)
calculates dest = beta1 * A1^T *w1;
Definition: matrix_use_row_functions.h:113
static bool MatMult(vector_t &dest, const number &beta1, const matrix_t &A1, const vector_t &w1)
calculates dest = beta1 * A1;
Definition: matrix_use_row_functions.h:43
static bool MatMultAdd(vector_t &dest, const number &beta1, const matrix_t &A1, const vector_t &w1, const number &beta2, const matrix_t &A2, const vector_t &w2)
calculates dest = beta1 * A1 *w1 + beta2 * A2*w2;
Definition: matrix_use_row_functions.h:83
static bool MatMultTransposedAdd(vector_t &dest, const number &alpha1, const vector_t &v1, const number &beta1, const matrix_t &A1, const vector_t &w1)
calculates dest = alpha1*v1 + beta1 * A1^T *w1;
Definition: matrix_use_row_functions.h:120
static bool MatMultAdd(vector_t &dest, const number &alpha1, const vector_t &v1, const number &beta1, const matrix_t &A1, const vector_t &w1)
calculates dest = alpha1*v1 + beta1 * A1 *w1;
Definition: matrix_use_row_functions.h:55
static bool MatMultAdd(vector_t &dest, const number &alpha1, const vector_t &v1, const number &beta1, const matrix_t &A1, const vector_t &w1, const number &beta2, const matrix_t &A2, const vector_t &w2)
calculates dest = beta1 * A1 *w1 + beta2 * A2*w2 + alpha1*v1;
Definition: matrix_use_row_functions.h:98
Definition: matrix_algebra_types.h:75