Try our new documentation site (beta).
Filter Content By
Version
Text Search
${sidebar_list_label} - Back
Filter by Language
GRBQuadExpr.addTerm()
Add a single term into a quadratic expression.
void | addTerm ( | double | coeff, |
GRBVar | var ) |
-
Add a single linear term (
coeff*var
) into a quadratic
expression.
Arguments:
coeff: Coefficient for new term.
var: Variable for new term.
void | addTerm ( | double | coeff, |
GRBVar | var1, | ||
GRBVar | var2 ) |
-
Add a single quadratic term (
coeff*var1*var2
) into a quadratic
expression.
Arguments:
coeff: Coefficient for new quadratic term.
var1: First variable for new quadratic term.
var2: Second variable for new quadratic term.
![](/wp-content/plugins/hd_documentations/content/images/documentation-ampl-guide.webp?x70725)
![](/wp-content/plugins/hd_documentations/content/images/documentation-cloud.webp?x70725)
![](/wp-content/plugins/hd_documentations/content/images/documentation-example-tour.webp?x70725)
![](/wp-content/plugins/hd_documentations/content/images/documentation-quick-start.webp?x70725)
![](/wp-content/plugins/hd_documentations/content/images/documentation-reference-manuals.webp?x70725)
![](/wp-content/plugins/hd_documentations/content/images/documentation-remote-services.webp?x70725)
![](/wp-content/plugins/hd_documentations/content/images/quickstart-os-linux.webp?x70725)
![](/wp-content/plugins/hd_documentations/content/images/quickstart-os-mac-osx.webp?x70725)
![](/wp-content/plugins/hd_documentations/content/images/quickstart-os-windows.webp?x70725)