Crevice  0.1
 All Classes Functions Variables Pages
Solver.cc
1 /*
2  * File: Solver.cc
3  * Author: zfsdt
4  *
5  * Created on 15. September 2012, 18:00
6  */
7 
8 #include "Solver.h"
9 #include "problem/Problem.h"
10 
15  this->optionsString = new std::map<const std::string, std::string > ();
16  this->optionsDouble = new std::map<const std::string, double>();
17 }
18 
23  delete this->optionsDouble;
24  delete this->optionsString;
25 }
26 
32 double Solver::getOptionDouble(const std::string &name) {
33  return this->optionsDouble->at(name);
34 }
35 
41 std::string Solver::getOptionString(const std::string &name) {
42  return this->optionsString->at(name);
43 }
44 
50 void Solver::setOptionDouble(const std::string &name, const double &value) {
51  if (this->optionsDouble->count(name)) {
52  this->optionsDouble->find(name)->second = value;
53  } else {
54  this->optionsDouble->insert(
55  std::pair<const std::string, double>(name, value));
56  }
57 }
58 
64 void Solver::setOptionString(const std::string &name, const std::string &value) {
65  if (this->optionsString->count(name)) {
66  this->optionsString->find(name)->second = value;
67  } else {
68  this->optionsString->insert(
69  std::pair<const std::string, std::string>(name, value));
70  }
71 }
72 
73 Solver::result Solver::solve(Problem problem, const DoubleVector* variableValues) {
74  return Solver::FAILURE;
75 }