Let me think about this...


2013/7/11 Vadim Pisarevsky <notifications@github.com>

> In modules/optim/src/lpsolver.cpp:
>
> > +int solveLP(const Mat& Func, const Mat& Constr, Mat& z){
> > +    dprintf(("call to solveLP\n"));
> > +
> > +    //sanity check (size, type, no. of channels)
> > +    CV_Assert(Func.type()==CV_64FC1);
> > +    CV_Assert(Constr.type()==CV_
> 64FC1);
> > +    CV_Assert(Func.rows==1);
> > +    CV_Assert(Constr.cols-Func.cols==1);
> > +
> > +    //copy arguments for we will shall modify them
> > +    Mat_<double> bigC=Mat_<double>(1,Func.cols+1),
> > +        bigB=Mat_<double>(Constr.rows,Constr.cols+1);
> > +    Func.copyTo(bigC.colRange(1,bigC.cols));
> > +    Constr.copyTo(bigB.colRange(1,bigB.cols));
> > +    double v=0;
> > +    vector<int> N,B;
>
> basic solution is stored as vector of int's (vector of var indices) and
> therefore you always need to run find() algorithm to check if certain var
> belongs to the basic solution or not. May be, it makes sense to have byte
> mask vector instead?
>
> vector<uchar> basic_solution_mask(var_num);
> ...
> if (basic_solution_mask[i]) { ... } else {...}
>
> If you decide to make this modification, please, do not use vector<bool> -
> it's slow custom implementation of a vector and it's not recommended to use.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Itseez/opencv/pull/1108/files#r5141301>
> .
>