All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
multi_dimensional_newton_method.h
1 /* Copyright (C) 2004-2012 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Contact: martin.o.foerg@googlemail.com
18  */
19 
20 #ifndef NUMERICS_NUMERICSMULTIDIMENSIONALNEWTONMETHOD_H_
21 #define NUMERICS_NUMERICSMULTIDIMENSIONALNEWTONMETHOD_H_
22 
23 #include <fmatvec/fmatvec.h>
24 
25 #include <map>
26 
27 #include <mbsim/numerics/functions/newton_method_jacobian_functions.h>
28 #include <mbsim/numerics/functions/criteria_functions.h>
29 #include <mbsim/numerics/functions/damping_functions.h>
30 
31 namespace fmatvec {
32  bool operator<(const fmatvec::RangeV & i1, const fmatvec::RangeV & i2);
33 }
34 
35 namespace MBSim {
36 
42  public:
47 
48  virtual ~MultiDimensionalNewtonMethod() {
49  }
50 
51  /* GETTER / SETTER */
52  int getNumberOfIterations() const {
53  return iter;
54  }
55  int getNumberOfMaximalIterations() const {
56  return itermax;
57  }
58  int getInfo() const {
59  return info;
60  }
61  void setMaximumNumberOfIterations(int itmax_) {
62  itermax = itmax_;
63  }
64  void setFunction(Function<fmatvec::Vec(fmatvec::Vec)> *function_) {
65  function = function_;
66  }
67  void setJacobianFunction(NewtonJacobianFunction * jacobian_) {
68  jacobian = jacobian_;
69  }
70  void setDampingFunction(MBSim::DampingFunction * damping_) {
71  damping = damping_;
72  }
73  void setCriteriaFunction(CriteriaFunction * criteria_) {
74  criteria = criteria_;
75  }
76  CriteriaFunction * getCriteriaFunction() {
77  return criteria;
78  }
79  void setLinearAlgebra(int linAlg_) {
80  linAlg = linAlg_;
81  }
82 
83  void setJacobianUpdateFreq(int JacobianUpdateFreq_) {
84  jacobianUpdateFreq = JacobianUpdateFreq_;
85  }
86  /***************************************************/
87 
92  fmatvec::Vec solve(const fmatvec::Vec & initialValue);
93 
94  private:
95 
100 
105 
106  /*
107  * \brief damping function
108  */
109  DampingFunction *damping;
110 
111  /*
112  * \brief criteria function
113  *
114  * This function defines the criteria when to stop the Newton algorithm
115  */
116  CriteriaFunction *criteria;
117 
121  int itermax;
122 
123  /*
124  * \brief number of iterations
125  */
126  int iter;
127 
128  /*
129  * \brief information about the result of the method
130  */
131  int info;
132 
138  int linAlg;
139 
144 
145  };
146 }
147 #endif /* NUMERICSMULTIDIMENSIONALNEWTONMETHOD_H_ */
Newton method for multidimensional root finding.
Definition: multi_dimensional_newton_method.h:41
NewtonJacobianFunction * jacobian
Jacobian matrix.
Definition: multi_dimensional_newton_method.h:104
int itermax
maximum number of iterations, actual number of iterations, maximum number of damping steps...
Definition: multi_dimensional_newton_method.h:121
base class for square Jacobians used for the newton method
Definition: newton_method_jacobian_functions.h:31
int jacobianUpdateFreq
the frequency of updating Jacobian during iteration
Definition: multi_dimensional_newton_method.h:143
MultiDimensionalNewtonMethod()
plain constructor
Definition: multi_dimensional_newton_method.cc:58
Mother class for different criterias that are fulfilled or not.
Definition: criteria_functions.h:33
Definition: planar_contour.h:31
Definition: damping_functions.h:27
int linAlg
flag which linear algebra solution should be taken 0 = solve with LU-decomposition 1 = solve with LS ...
Definition: multi_dimensional_newton_method.h:138
fmatvec::Vec solve(const fmatvec::Vec &initialValue)
solve nonlinear root function
Definition: multi_dimensional_newton_method.cc:62

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML