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(Function1<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
00080
00085 fmatvec::Vec solve(const fmatvec::Vec & initialValue);
00086
00087 private:
00088
00092 Function1<fmatvec::Vec, fmatvec::Vec> *function;
00093
00097 NewtonJacobianFunction *jacobian;
00098
00099
00100
00101
00102 DampingFunction *damping;
00103
00104
00105
00106
00107
00108
00109 CriteriaFunction *criteria;
00110
00114 int itermax;
00115
00116
00117
00118
00119 int iter;
00120
00121
00122
00123
00124 int info;
00125
00126 };
00127 }
00128 #endif