XPRBexprsqr(XPRBexpr) Method |
Square an XPRBexpr.
Namespace: BCLAssembly: xprbdn (in xprbdn.dll) Version: 47.01.01+0ba4e76731516b80760698bbaa939494dae84e49
Syntaxpublic XPRBexpr sqr(
XPRBexpr q
)
Public Function sqr (
q As XPRBexpr
) As XPRBexpr
Parameters
- q XPRBexpr
- The XPRBexpr to square.
Return Value
XPRBexprThe resultant XPRBexpr expression if successful. This will throw a "Non-quadratic expression"
exception if the result is not quadratic.
ExampleXPRBprob prob = new XPRBprob("NewProb");
XPRBvar var = new XPRBvar("Variable");
XPRBvar var2 = new XPRBvar("Variable2");
XPRBexpr exp = new XPRBexpr(4.2*var + var2*var2);
XPRBexpr exp2;
...
exp.delTerm(var2);
exp2 = new XPRBexpr(XPRBexpr.sqr(exp));
See Also