00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef NUMERICS_NUMERICSMULTIDIMENSIONALNEWTONMETHOD_H_
00021 #define NUMERICS_NUMERICSMULTIDIMENSIONALNEWTONMETHOD_H_
00022
00023 #include <fmatvec/fmatvec.h>
00024
00025 #include <map>
00026
00027 #include <mbsim/numerics/functions/newton_method_jacobian_functions.h>
00028 #include <mbsim/numerics/functions/criteria_functions.h>
00029 #include <mbsim/numerics/functions/damping_functions.h>
00030
00031 namespace fmatvec {
00032 bool operator<(const fmatvec::Index & i1, const fmatvec::Index & i2);
00033 }
00034
00035 namespace MBSim {
00036
00041 class MultiDimensionalNewtonMethod {
00042 public:
00046 MultiDimensionalNewtonMethod();
00047
00048 virtual ~MultiDimensionalNewtonMethod() {
00049 }
00050
00051
00052 int getNumberOfIterations() const {
00053 return iter;
00054 }
00055 int getNumberOfMaximalIterations() const {
00056 return itermax;
00057 }
00058 int getInfo() const {
00059 return info;
00060 }
00061 void setMaximumNumberOfIterations(int itmax_) {
00062 itermax = itmax_;
00063 }
00064 void setFunction(Function<fmatvec::Vec(fmatvec::Vec)> *function_) {
00065 function = function_;
00066 }
00067 void setJacobianFunction(NewtonJacobianFunction * jacobian_) {
00068 jacobian = jacobian_;
00069 }
00070 void setDampingFunction(DampingFunction * damping_) {
00071 damping = damping_;
00072 }
00073 void setCriteriaFunction(CriteriaFunction * criteria_) {
00074 criteria = criteria_;
00075 }
00076 CriteriaFunction * getCriteriaFunction() {
00077 return criteria;
00078 }
00079 void setLinearAlgebra(int linAlg_) {
00080 linAlg = linAlg_;
00081 }
00082
00083 void setJacobianUpdateFreq(int JacobianUpdateFreq_) {
00084 jacobianUpdateFreq = JacobianUpdateFreq_;
00085 }
00086
00087
00092 fmatvec::Vec solve(const fmatvec::Vec & initialValue);
00093
00094 private:
00095
00099 Function<fmatvec::Vec(fmatvec::Vec)> *function;
00100
00104 NewtonJacobianFunction *jacobian;
00105
00106
00107
00108
00109 DampingFunction *damping;
00110
00111
00112
00113
00114
00115
00116 CriteriaFunction *criteria;
00117
00121 int itermax;
00122
00123
00124
00125
00126 int iter;
00127
00128
00129
00130
00131 int info;
00132
00138 int linAlg;
00139
00143 int jacobianUpdateFreq;
00144
00145 };
00146 }
00147 #endif