getqexpnextterm
void *getqexpnextterm(XPRMctx ctx, void *quadctx, mmquad_qexp q, void *prev, XPRMmpvar *v1, XPRMmpvar *v2, double *coeff);
ctx
|
Mosel's execution context
|
quadctx
|
Context of
mmquad
|
q
|
Reference to a quadratic expression
|
prev
|
Last value returned by this function. Should be
NULL for the first call
|
v1,v2
|
Pointers to return the decision variable references for the current term
|
coeff
|
Pointer to return the coefficient of the current term
|
void dispqexp(XPRMcontext ctx, mmquad_qexp q) { void *prev; XPRMmpvar v1,v2; double coeff; int nlin,ct; mq->getqexpstat(ctx, quadctx, q, &nlin, NULL, NULL, NULL); ct=0; prev=mq->getqexpnextterm(ctx, quadctx, q, NULL, &v1, &v2, &coeff); mm->printf(ctx, "%g ", coeff); while(prev!=NULL) { prev=mq->getqexpnextterm(ctx, quadctx, q, prev, &v1, &v2, &coeff); if(ct<nlin) { mm->printf(ctx,"%+g %p", coeff, v2); ct++; } else mm->printf(ctx,"%+g %p * %p", coeff, v1, v2); } mm->printf(ctx,"\n"); }
If this function is called repeatedly, after the constant term it returns next all linear terms and then the quadratic terms.
© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.