Click or drag to resize

XPRBexprsqr(XPRBexpr) Method

Square an XPRBexpr.

Namespace: BCL
Assembly: xprbdn (in xprbdn.dll) Version: 47.01.01+0ba4e76731516b80760698bbaa939494dae84e49
Syntax
public XPRBexpr sqr(
	XPRBexpr q
)

Parameters

q  XPRBexpr
The XPRBexpr to square.

Return Value

XPRBexpr
The resultant XPRBexpr expression if successful. This will throw a "Non-quadratic expression" exception if the result is not quadratic.
Example
C#
XPRBprob 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