Yes, please. It will not affect performance, but will improve clarity

19.07.2013, â 0:59, Alex Leontiev <notifications@github.com> íàïèñàë(à):

> In modules/optim/src/lpsolver.cpp:
> 
> > +    //sanity check (size, type, no. of channels)
> > +    CV_Assert(Func.type()==CV_64FC1 || Func.type()==CV_32FC1);
> > +    CV_Assert(Constr.type()==CV_64FC1 || Constr.type()==CV_32FC1);
> > +    CV_Assert((Func.rows==1 && (Constr.cols-Func.cols==1))||
> > +            (Func.cols==1 && (Constr.cols-Func.rows==1)));
> > +
> > +    //copy arguments for we will shall modify them
> > +    Mat_<double> bigC=Mat_<double>(1,(Func.rows==1?Func.cols:Func.rows)+1),
> > +        bigB=Mat_<double>(Constr.rows,Constr.cols+1);
> > +    if(Func.rows==1){
> > +        Func.convertTo(bigC.colRange(1,bigC.cols),CV_64FC1);
> > +    }else{
> > +        dprintf(("hi from other branch\n"));
> > +        Mat_<double> slice=bigC.colRange(1,bigC.cols);
> > +        MatIterator_<double> slice_iterator=slice.begin();
> > +        switch(Func.type()){
> Vadim, are you sure this line works? It gives me an error, stating that Func.t() is of type cv::MatExpr (Mat) and as such does not have .convertTo() method.
> The simple solution would be to do something like
> Mat FuncT=Func.t();
> Func.convertTo(bigC.colRange(...),CV_64FC1);
> Now, while I've been thinking about this, I did not employ this solution because as far as I understand openCV matrix management system, the "Mat FuncT=Func.t();" line will make a DEEP copy of Func and I'm simply too greedy to let this happen:)
> Anyway, that's a minor issue and I will do as you say, if you insist.
> 
> —
> Reply to this email directly or view it on GitHub.