mbsim  4.0.0
MBSim Kernel
newton_method_jacobian_functions.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 NUMERICSNEWTONMEHTODFUNCTION_H_
21#define NUMERICSNEWTONMEHTODFUNCTION_H_
22
23#include <fmatvec/fmatvec.h>
24#include <mbsim/functions/function.h>
25
26namespace MBSim {
27
31 class NewtonJacobianFunction : public Function<fmatvec::SqrMat(fmatvec::Vec)> {
32 public:
37
38 /*
39 * \brief destructor
40 */
41 ~NewtonJacobianFunction() override = default;
42
43 /* GETTER / SETTER*/
44 virtual void setFunction(Function<fmatvec::Vec(fmatvec::Vec)> * function_) {
45 function = function_;
46 }
47 /*****************/
48
49 /*INHERITED INTERFACE*/
50 fmatvec::SqrMat operator ()(const fmatvec::Vec &x) override = 0;
51 /*********************/
52
53 protected:
54 Function<fmatvec::Vec(fmatvec::Vec)> *function;
55 };
56
61 public:
66
67 /*
68 * \brief destructor
69 */
70 ~NumericalNewtonJacobianFunction() override = default;
71
72 /*INHERITED INTERFACE*/
73 fmatvec::SqrMat operator ()(const fmatvec::Vec &x) override;
74 };
75
76// /*!
77// * \brief class to compute a Jacobian matrix once at the beginning and then uses it over and over again
78// *
79// * \todo: implement
80// */
81// class ConstantNewtonJacobianFunction : public NewtonJacobianFunction {
82// public:
83// /**
84// * \brief constructor
85// */
86// ConstantNewtonJacobianFunction();
87//
88// /*
89// * \brief destructor
90// */
91// virtual ~ConstantNewtonJacobianFunction() {
92// }
93//
94// /*INHERITED INTERFACE*/
95// virtual fmatvec::SqrMat operator ()(const fmatvec::Vec &x, Function<fmatvec::Vec(fmatvec::Vec)> *function);
96//
97// };
98
99// /*!
100// * \brief class use the identity matrix as Jacobian matrix in the newton method yields a fixpoint iteration
101// *
102// * \todo: implement
103// */
104// class FixpointNewtonJacobianFunction : public NewtonJacobianFunction {
105// public:
106// /**
107// * \brief constructor
108// */
109// FixpointNewtonJacobianFunction();
110//
111// /*
112// * \brief destructor
113// */
114// virtual ~FixpointNewtonJacobianFunction() {
115// }
116//
117// /*INHERITED INTERFACE*/
118// virtual fmatvec::SqrMat operator ()(const fmatvec::Vec &x, Function<fmatvec::Vec(fmatvec::Vec)> *function);
119// };
120}
121#endif // NUMERICSNEWTONMEHTODFUNCTION_H_
Definition: function.h:53
base class for square Jacobians used for the newton method
Definition: newton_method_jacobian_functions.h:31
NewtonJacobianFunction()
constructor
Definition: newton_method_jacobian_functions.cc:29
class to compute the Jacobian matrix for the newton method numerically
Definition: newton_method_jacobian_functions.h:60
NumericalNewtonJacobianFunction()
constructor
Definition: newton_method_jacobian_functions.cc:33
namespace MBSim
Definition: bilateral_constraint.cc:30