ug4
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 
39 namespace ug{
40 
43 
45 // vOut = m * v
46 template <typename vector_t_out, typename matrix_t, typename vector_t_in>
47 inline
48 void
49 MatVecMult(vector_t_out& vOut, const matrix_t& m, const vector_t_in& v);
50 
52 // vOut += m * v
53 template <typename vector_t_out, typename matrix_t, typename vector_t_in>
54 inline
55 void
56 MatVecMultAppend(vector_t_out& vOut, const matrix_t& m, const vector_t_in& v);
57 
59 // vOut += s * m * v
60 template <typename vector_t_out, typename matrix_t, typename vector_t_in>
61 inline
62 void
63 MatVecScaleMultAppend(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
67 template <typename vector_t_out, typename matrix_t, typename vector_t_in>
68 inline
69 void
70 TransposedMatVecMult(vector_t_out& vOut, const matrix_t& m, const vector_t_in& v);
71 
73 // vOut += Transpose(m) * v
74 template <typename vector_t_out, typename matrix_t, typename vector_t_in>
75 inline
76 void
77 TransposedMatVecMultAdd(vector_t_out& vOut, const matrix_t& m, const vector_t_in& v);
78 
80 template <typename matrix_t, typename vector_t>
81 inline
82 void
83 GivensMatVecMult (matrix_t& A, vector_t& v);
84 
86 template <typename matrix_t, typename vector_t>
87 inline
88 void
89 InvMatVecMult_byGivens (matrix_t& A, vector_t& v);
90 
92 template <typename matrix_t, typename vector_t>
93 inline
94 void
95 OrthogProjectVec (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
T value_type
Definition: sparsematrix_interface.h:2