Created skeleton for simplex method.

Added LPSolver class together with two nested classes: LPFunction and
LPConstraints. These represent function to be maximized and constraints
imposed respectively. They are implementations of interfaces Function
and Constraints respectively (latter ones are nested classes of Solver
interface, which is generic interface for all optimization algorithms to
be implemented within this project).

The next step is to implement the simplex algorithm! First, we shall
implement it for the case of constraints of the form Ax<=b and x>=0.
Then, we shall extend the sets of problems that can be handled by the
conversion to the one we've handled already. Finally, we shale
concentrate on numerical stability and efficiency.
This commit is contained in:
Alex Leontiev
2013-06-24 20:27:11 +03:00
parent f41b8b90ff
commit b216c0940c
4 changed files with 68 additions and 21 deletions

View File

@@ -1,2 +1,22 @@
#include "precomp.hpp"
#include "opencv2/optim.hpp"
namespace cv{namespace optim{
double LPSolver::solve(const Function& F,const Constraints& C, OutputArray result)const{
printf("call to solve\n");
//TODO: sanity check and throw exception, if appropriate
//TODO: copy A,b,z
//TODO: run simplex algo
return 0.0;
}
double LPSolver::LPFunction::calc(InputArray args)const{
printf("call to LPFunction::calc()\n");
return 0.0;
}
}}