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.pull/1192/head
parent
f41b8b90ff
commit
b216c0940c
4 changed files with 68 additions and 21 deletions
@ -1,3 +1,2 @@ |
||||
set(the_description "Generic optimization") |
||||
ocv_define_module(optim opencv_imgproc) |
||||
#ocv_define_module(optim core) |
||||
ocv_define_module(optim opencv_core) |
||||
|
@ -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; |
||||
} |
||||
|
||||
}} |
||||
|
Loading…
Reference in new issue