48 switch ( returnvalue )
74 const mxArray* prhs[],
int idx
85 if ( mxIsEmpty( prhs[ idx ] ) )
96 snprintf(msg, 199,
"ERROR (qpOASES): Empty argument %d not allowed!", idx+1);
104 if ( ( mxGetM( prhs[ idx ] ) == m ) && ( mxGetN( prhs[ idx ] ) == n ) )
106 *input = (
real_t*) mxGetPr( prhs[ idx ] );
112 snprintf(msg, 199,
"ERROR (qpOASES): Input dimension mismatch for argument %d ([%ld,%ld] ~= [%d,%d]).",
113 idx+1, (
long int)mxGetM(prhs[idx]), (
long int)mxGetN(prhs[idx]), m, n);
130 for ( i=0; i<nC; ++i )
131 for ( j=0; j<nV; ++j )
132 A[i*nV + j] = A_for[j*nC + i];
143 mxArray* optionName = mxGetField( optionsPtr,0,optionString );
145 if( !mxIsEmpty(optionName) )
147 if ( ( mxGetM( optionName ) != 1 ) || ( mxGetN( optionName ) != 1 ) )
148 mexErrMsgTxt(
"ERROR (qpOASES_options): Option has to be a numerical constant." );
150 *optionValue = mxGetPr( optionName );
167 if ( *optionValue > 0.0 )
168 nWSRin = (int)*optionValue;
172 optionValueInt = (int)*optionValue;
179 optionValueInt = (int)*optionValue;
185 optionValueInt = (int)*optionValue;
191 optionValueInt = (int)*optionValue;
197 optionValueInt = (int)*optionValue;
203 optionValueInt = (int)*optionValue;
209 optionValueInt = (int)*optionValue;
221 optionValueInt = (int)*optionValue;
236 options->
epsNum = *optionValue;
239 options->
epsDen = *optionValue;
262 optionValueInt = (int)*optionValue;
299 plhs[0] = mxCreateDoubleMatrix( nV, nP, mxREAL );
303 plhs[1] = mxCreateDoubleMatrix( 1, nP, mxREAL );
307 plhs[2] = mxCreateDoubleMatrix( 1, nP, mxREAL );
311 plhs[3] = mxCreateDoubleMatrix( 1, nP, mxREAL );
315 plhs[4] = mxCreateDoubleMatrix( nV+nC, nP, mxREAL );
327 int nlhs, mxArray* plhs[],
int nV,
int nC = 0
331 double* x = mxGetPr( plhs[0] );
336 double* obj = mxGetPr( plhs[1] );
341 double* status = mxGetPr( plhs[2] );
346 double* nWSRout = mxGetPr( plhs[3] );
347 nWSRout[k] = (
real_t) nWSRin;
351 double*
y = mxGetPr( plhs[4] );
returnValue getPrimalSolution(real_t *const xOpt) const
Implements the online active set strategy for box-constrained QPs.
BooleanType enableFarBounds
real_t getStatus(returnValue returnvalue)
returnValue setupOptions(Options *options, const mxArray *optionsPtr, int &nWSRin)
Allows to pass back messages to the calling function.
BooleanType enableFullLITests
returnValue smartDimensionCheck(real_t **input, unsigned int m, unsigned int n, BooleanType emptyAllowed, const mxArray *prhs[], int idx)
BooleanType enableEqualities
returnValue convertFortranToC(const real_t *const A_for, int nV, int nC, real_t *const A)
BooleanType enableRamping
BooleanType enableFlippingBounds
returnValue getDualSolution(real_t *const yOpt) const
void allocateOutputs(int nlhs, mxArray *plhs[], int nV, int nC=0, int nP=1)
Provides a generic way to set and pass user-specified options.
int enableDriftCorrection
BooleanType enableRegularisation
void obtainOutputs(int k, QProblemB *qp, returnValue returnvalue, int nWSRin, int nlhs, mxArray *plhs[], int nV, int nC=0)
real_t terminationTolerance
int numRegularisationSteps
int enableCholeskyRefactorisation
BooleanType hasOptionsValue(const mxArray *optionsPtr, const char *const optionString, double **optionValue)
BooleanType enableNZCTests
SubjectToStatus initialStatusBounds