So-Bogus
A c++ sparse block matrix library aimed at Second Order cone problems
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Preconditioners.hpp
1 /*
2  * This file is part of bogus, a C++ sparse block matrix library.
3  *
4  * Copyright 2013 Gilles Daviet <gdaviet@gmail.com>
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 */
10 
11 #ifndef BOGUS_PRECONDITIONERS_HPP
12 #define BOGUS_PRECONDITIONERS_HPP
13 
14 namespace bogus {
15 
17 template < typename MatrixType >
19 {
20 public:
21  void setMatrix( const MatrixType & )
22  {}
23 
24  template < bool transpose, typename ResT, typename RhsT >
25  void apply( const RhsT& rhs, ResT &res ) const
26  {
27  res = rhs ;
28  }
29 } ;
30 
32 
37 template < typename MatrixType >
39 {
40 } ;
41 
43 
47 template < typename MatrixType >
49 {
50 } ;
51 
53 
57 template < typename MatrixType >
59 {
60 } ;
61 
63 
65 template < typename PreconditionerMatrixType >
67 
68  template < typename MatrixType >
69  class Type
70  {
71  const PreconditionerMatrixType* m_preconditionerMatrix ;
72 
73  public:
74 
75  Type() : m_preconditionerMatrix( 0 )
76  {}
77 
78  void setMatrix( const MatrixType & )
79  {}
80 
81  void setPreconditionerMatrix( const PreconditionerMatrixType & preconditioner )
82  {
83  m_preconditionerMatrix = &preconditioner ;
84  }
85 
86  template < bool transpose, typename ResT, typename RhsT >
87  void apply( const RhsT& rhs, ResT &res ) const
88  {
89  m_preconditionerMatrix->template multiply< transpose >( rhs, res ) ;
90  }
91  } ;
92 } ;
93 
94 }
95 
96 #endif
97 
Trivial ( identity ) preconditioner. Does nothing.
Definition: Preconditioners.hpp:18
Diagonal Block-LU preconditioner.
Definition: Preconditioners.hpp:48
Diagonal preconditioner.
Definition: Preconditioners.hpp:38
Matrix preconditioner.
Definition: Preconditioners.hpp:66
Diagonal Block-LDLT preconditioner.
Definition: Preconditioners.hpp:58
Definition: Preconditioners.hpp:69