00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef NUMERICS_MULTI_DIMENSIONAL_FIXPOINT_SOLVER_H_
00021 #define NUMERICS_MULTI_DIMENSIONAL_FIXPOINT_SOLVER_H_
00022
00023 #include <fmatvec/fmatvec.h>
00024
00025 #include <mbsim/numerics/functions/criteria_functions.h>
00026
00027 namespace MBSim {
00028
00034 class MultiDimensionalFixpointSolver {
00035 public:
00039 MultiDimensionalFixpointSolver();
00040
00041
00042
00043
00044
00045 MultiDimensionalFixpointSolver(Function<fmatvec::Vec(fmatvec::Vec)> *function_);
00046
00047 virtual ~MultiDimensionalFixpointSolver(){};
00048
00049
00056 void setFunction(Function<fmatvec::Vec(fmatvec::Vec)> *function_) {function = function_;}
00057 int getInfo() {
00058 return info;
00059 }
00060 std::vector<double> getNorms() {
00061 return norms;
00062 }
00063 double getNumberOfIterations() {
00064 return iter;
00065 }
00066 double getNumberOfMaximalIterations() {
00067 return itermax;
00068 }
00069 void setNumberOfMaximalIterations(int itermax_) {
00070 itermax = itermax_;
00071 }
00072 void setCriteriaFunction(CriteriaFunction * criteria_) {
00073 criteria = criteria_;
00074 }
00075
00076
00077 fmatvec::Vec solve(const fmatvec::Vec &initialGuess);
00078
00079 private:
00083 Function<fmatvec::Vec(fmatvec::Vec)> *function;
00084
00085
00086
00087
00088
00089
00090 CriteriaFunction *criteria;
00091
00095 int iter;
00096
00100 double itermax;
00101
00105 std::vector<double> norms;
00106
00110 int info;
00111 };
00112
00113 }
00114 #endif