19 #ifndef __INC_OPTIMIZER 20 #define __INC_OPTIMIZER 41 std::vector<std::pair<std::string, CMatrix> >
allPoses;
55 std::vector<OptimizerContainer>
data;
71 void setValue(
double *x);
72 bool writeToFile(std::string filename, std::string buffer);
73 std::string readFromFile(std::string filename);
74 void setData(std::vector<double> &
values);
75 void callback(
int nparam,
double *x,
double *fj);
77 bool isEqual(std::vector<double> &first, std::vector<double> &second,
double eps = 0.1);
79 void loadData(std::string filename,
unsigned int startId = 0);
80 void loadDofs(std::string filename);
81 void loadGoals(std::string filename);
82 void loadValueSetters(std::string filename);
84 int getValue(TiXmlElement *node, std::string item);
88 COptimizer() : counter(0), trim(0.0), examplesMax(100000),dofs(0),counterMod(10000),useRandom(false),useShowResult(false),doQuit(false),epsilon(1.0e-8) {}
90 static void rosenbrockCallback(
int nparam,
double *x,
double *fj,
void *extraparams);
92 void load(std::string cfg, std::string data,
unsigned int start = 0);
94 virtual std::string generateOutput();
96 void run(
const std::vector<double> &initialValues);
100 void setIterations(
unsigned int iterations) { this->iterations = iterations; }
102 void setQuit(
bool doQuit) { this->doQuit = doQuit; }
103 void setDataMax(
unsigned int examplesMax) { this->examplesMax = examplesMax; }
104 void setShowResult(
bool useShowResult) { this->useShowResult = useShowResult; }
105 void setShowModulo(
unsigned int counterMod) { this->counterMod = counterMod; }
std::vector< std::vector< double > > examples
void setShowModulo(unsigned int counterMod)
std::vector< std::pair< std::string, CMatrix > > optimizedPoses
std::vector< std::vector< std::pair< std::string, CMatrix > > > timelineOfPoses
void setIterations(unsigned int iterations)
std::vector< double > values
std::vector< double > result
Data Storage Class (Attribute-Value Pairs)
void setRandomStart(bool useRandom)
void setQuit(bool doQuit)
void setEpsilon(double eps)
void setDataMax(unsigned int examplesMax)
void setTrimming(double trim)
void setShowResult(bool useShowResult)
std::vector< ValueSetter > valueSetters
std::vector< double > distances
std::vector< std::pair< std::string, CMatrix > > allPoses
std::vector< OptimizerGoalGlobal * > globalFunctions
std::vector< OptimizerContainer > data
std::vector< OptimizerGoal * > functions