ug4
Loading...
Searching...
No Matches
math_matrix_vector_functions.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009-2015: G-CSC, Goethe University Frankfurt
3 * Author: Andreas Vogel
4 *
5 * This file is part of UG4.
6 *
7 * UG4 is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License version 3 (as published by the
9 * Free Software Foundation) with the following additional attribution
10 * requirements (according to LGPL/GPL v3 §7):
11 *
12 * (1) The following notice must be displayed in the Appropriate Legal Notices
13 * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14 *
15 * (2) The following notice must be displayed at a prominent place in the
16 * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17 *
18 * (3) The following bibliography is recommended for citation and must be
19 * preserved in all covered files:
20 * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21 * parallel geometric multigrid solver on hierarchically distributed grids.
22 * Computing and visualization in science 16, 4 (2013), 151-164"
23 * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24 * flexible software system for simulating pde based models on high performance
25 * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26 *
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU Lesser General Public License for more details.
31 */
32
33#ifndef __H__UGMATH__MATRIX_VECTOR_FUNCTIONS__
34#define __H__UGMATH__MATRIX_VECTOR_FUNCTIONS__
35
36#include "math_matrix.h"
37#include "math_vector.h"
38
39namespace ug{
40
43
45// vOut = m * v
46template <typename vector_t_out, typename matrix_t, typename vector_t_in>
47inline
48void
49MatVecMult(vector_t_out& vOut, const matrix_t& m, const vector_t_in& v);
50
52// vOut += m * v
53template <typename vector_t_out, typename matrix_t, typename vector_t_in>
54inline
55void
56MatVecMultAppend(vector_t_out& vOut, const matrix_t& m, const vector_t_in& v);
57
59// vOut += s * m * v
60template <typename vector_t_out, typename matrix_t, typename vector_t_in>
61inline
62void
63MatVecScaleMultAppend(vector_t_out& vOut, typename vector_t_out::value_type s, const matrix_t& m, const vector_t_in& v);
64
66// vOut = Transpose(m) * v
67template <typename vector_t_out, typename matrix_t, typename vector_t_in>
68inline
69void
70TransposedMatVecMult(vector_t_out& vOut, const matrix_t& m, const vector_t_in& v);
71
73// vOut += Transpose(m) * v
74template <typename vector_t_out, typename matrix_t, typename vector_t_in>
75inline
76void
77TransposedMatVecMultAdd(vector_t_out& vOut, const matrix_t& m, const vector_t_in& v);
78
80template <typename matrix_t, typename vector_t>
81inline
82void
83GivensMatVecMult (matrix_t& A, vector_t& v);
84
86template <typename matrix_t, typename vector_t>
87inline
88void
89InvMatVecMult_byGivens (matrix_t& A, vector_t& v);
90
92template <typename matrix_t, typename vector_t>
93inline
94void
95OrthogProjectVec (vector_t& v, const matrix_t& A);
96
97// end group ugbase_math
99
100} //end of namespace: ug
101
103
104#endif /* __H__LGMATH__LGMATH_MATRIX_VECTOR_FUNCTIONS__ */
void TransposedMatVecMultAdd(vector_t_out &vOut, const matrix_t &m, const vector_t_in &v)
Transposed Matrix - Vector Muliplication.
Definition math_matrix_vector_functions_common_impl.hpp:132
void MatVecMultAppend(vector_t_out &vOut, const matrix_t &m, const vector_t_in &v)
Matrix - Vector Multiplication adding to a second vector.
Definition math_matrix_vector_functions_common_impl.hpp:70
void InvMatVecMult_byGivens(matrix_t &A, vector_t &v)
Multiplication by the inverse using the Givens rotations.
Definition math_matrix_vector_functions_common_impl.hpp:223
void GivensMatVecMult(matrix_t &A, vector_t &v)
Multiplication by the Givens rotation of the QR-Decomposition.
Definition math_matrix_vector_functions_common_impl.hpp:158
void TransposedMatVecMult(vector_t_out &vOut, const matrix_t &m, const vector_t_in &v)
Transposed Matrix - Vector Muliplication.
Definition math_matrix_vector_functions_common_impl.hpp:111
void OrthogProjectVec(vector_t &v, const matrix_t &A)
Orthogonal projection.
Definition math_matrix_vector_functions_common_impl.hpp:251
void MatVecScaleMultAppend(vector_t_out &vOut, typename vector_t_out::value_type s, const matrix_t &m, const vector_t_in &v)
Matrix - Vector Multiplication added scaled to a second vector.
Definition math_matrix_vector_functions_common_impl.hpp:90
void MatVecMult(vector_t_out &vOut, const matrix_t &m, const vector_t_in &v)
Matrix - Vector Multiplication.
Definition math_matrix_vector_functions_common_impl.hpp:49
the ug namespace