class CvLevMarq

#include <calib3d_c.h>

class CvLevMarq
{
public:
    // enums

    enum
    {
        DONE      =0,
        STARTED   =1,
        CALC_J    =2,
        CHECK_ERR =3,
    };

    // fields

    bool completeSymmFlag;
    CvTermCriteria criteria;
    cv::Ptr<CvMat> err;
    double errNorm;
    int iters;
    cv::Ptr<CvMat> J;
    cv::Ptr<CvMat> JtErr;
    cv::Ptr<CvMat> JtJ;
    cv::Ptr<CvMat> JtJN;
    cv::Ptr<CvMat> JtJV;
    cv::Ptr<CvMat> JtJW;
    int lambdaLg10;
    cv::Ptr<CvMat> mask;
    cv::Ptr<CvMat> param;
    double prevErrNorm;
    cv::Ptr<CvMat> prevParam;
    int solveMethod;
    int state;

    // construction

    CvLevMarq();

    CvLevMarq(
        int nparams,
        int nerrs,
        CvTermCriteria criteria = cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 30, DBL_EPSILON),
        bool completeSymmFlag = false
        );

    // methods

    void
    clear();

    void
    init(
        int nparams,
        int nerrs,
        CvTermCriteria criteria = cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 30, DBL_EPSILON),
        bool completeSymmFlag = false
        );

    void
    step();

    bool
    update(
        const CvMat*& param,
        CvMat*& J,
        CvMat*& err
        );

    bool
    updateAlt(
        const CvMat*& param,
        CvMat*& JtJ,
        CvMat*& JtErr,
        double*& errNorm
        );
};