QuadTerm
- java.lang.Object
-  
  - com.dashoptimization.objects.Expression
-  
    - com.dashoptimization.objects.AbstractExpression
-  
      - com.dashoptimization.objects.QuadTerm
 
 
 
-  
   
 public final class QuadTerm extends AbstractExpression A quadratic term.- Since:
- 43.00
 
-  
    
   -  
         Method SummaryModifier and Type Method Description QuadTermdiv(double arg)Create a new expression that represents the quotient ofthisandarg.QuadTermdiv(ConstantExpression arg)Expressiondiv(Expression arg)Create a new expression that represents the quotient ofthisandarg.doubleevaluate(double[] solution)Compute the value of this expression with respect to the given solution vector (which is not required to be feasible).voidextract(double factor, PostfixExtractor extractor)Extract this expression into postfix notation.booleanextract(double factor, XPRSprob.RowCreator creator)Extract this expression into a row.doublegetCoefficient()VariablegetVariable1()VariablegetVariable2()QuadTermmul(double arg)Create a new expression that represents the product ofthisandarg.QuadTermmul(ConstantExpression arg)Expressionmul(Expression arg)Create a new expression that represents the product ofthisandarg.static QuadTermqTerm(Variable variable1, Variable variable2)Convenience function to create a single quadratic term.static QuadTermqTerm(Variable variable1, Variable variable2, double coefficient)Convenience function to create a single quadratic term.java.lang.StringtoString()static java.lang.StringtoString(Variable v1, Variable v2, double coef)Convert a quadratic term to a string.QuadTermuminus()Create a new expression that represents the unary minus of this one.-  
           Methods inherited from class com.dashoptimization.objects.AbstractExpressioneq, eq, geq, geq, in, leq, leq
 -  
           Methods inherited from class com.dashoptimization.objects.Expressionminus, minus, plus, plus
 
-  
           
 
-  
         
-  
    
   -  
         Method Detail-  getVariable1public Variable getVariable1() 
 -  getVariable2public Variable getVariable2() 
 -  getCoefficientpublic double getCoefficient() 
 -  extractpublic boolean extract(double factor, XPRSprob.RowCreator creator)Extract this expression into a row. This is for internal use only, you should never have to call this function explicitly.- Specified by:
- 
          extractin classExpression
- Parameters:
- 
          factor- Factor by which to multiply the expression during extraction.
- 
          creator- The creator to which this expression should be extracted.
- Returns:
- 
          trueif the low-level representation does requires normalization (sorting, removal of dups, ...). In some special cases we know that this is not required and can returnfalseto save the overhead.
- Since:
- 43.00
 
 -  extractpublic void extract(double factor, PostfixExtractor extractor)Extract this expression into postfix notation.- Specified by:
- 
          extractin classExpression
- Parameters:
- 
          factor- Factor by which to multiply the expression during extraction.
- 
          extractor- The extractor to which the expression is extract.
- Since:
- 43.00
 
 -  evaluatepublic double evaluate(double[] solution) Compute the value of this expression with respect to the given solution vector (which is not required to be feasible).- Specified by:
- 
          evaluatein classExpression
- Parameters:
- 
          solution- Solution values for which the expression is evaluated.
- Since:
- 43.00
 
 -  qTermpublic static QuadTerm qTerm(Variable variable1, Variable variable2, double coefficient) Convenience function to create a single quadratic term.- Parameters:
- 
          variable1- First variable for term.
- 
          variable2- Second variable for term.
- 
          coefficient- Coefficient for term.
- Returns:
- The newly created term.
- Since:
- 43.00
 
 -  qTermpublic static QuadTerm qTerm(Variable variable1, Variable variable2) Convenience function to create a single quadratic term. Creates the term1 * variable1 * variable2.- Parameters:
- 
          variable1- First variable for term.
- 
          variable2- Second variable for term.
- Returns:
- The newly created term.
- Since:
- 43.00
 
 -  toStringpublic java.lang.String toString() Used in these examples: - GlobalRHSParametrics
- IISExample
- Knapsack
- Trimloss
 - Overrides:
- 
          toStringin classjava.lang.Object
- Since:
- 43.00
 
 -  toStringpublic static java.lang.String toString(Variable v1, Variable v2, double coef) Convert a quadratic term to a string. Note that while theQuadTermclass does not allowXpressProblem.NULL_VARIABLEas either of the variables, this function allows those variables to indicate constant or linear terms.Used in these examples: - GlobalRHSParametrics
- IISExample
- Knapsack
- Trimloss
 - Parameters:
- 
          v1- First variable in quadratic term.
- 
          v2- Second variable in quadratic term.
- 
          coef- Coeffcient for quadratic term.
- Returns:
- 
          String representation of 
          coef*v1*v2.
- Since:
- 43.00
 
 -  uminuspublic QuadTerm uminus() Create a new expression that represents the unary minus of this one.- Overrides:
- 
          uminusin classExpression
- Returns:
- 
          Expression representing 
          -this.
- Since:
- 43.00
 
 -  mulpublic Expression mul(Expression arg) Create a new expression that represents the product ofthisandarg.- Overrides:
- 
          mulin classExpression
- Parameters:
- 
          arg- Factor.
- Returns:
- 
          Product of 
          thisandarg.
- Since:
- 43.00
 
 -  mulpublic QuadTerm mul(ConstantExpression arg) - Since:
- 43.00
 
 -  mulpublic QuadTerm mul(double arg) Description copied from class:ExpressionCreate a new expression that represents the product ofthisandarg.- Overrides:
- 
          mulin classExpression
- Parameters:
- 
          arg- Factor.
- Returns:
- 
          Product of 
          thisandarg.
- Since:
- 43.00
 
 -  divpublic Expression div(Expression arg) Create a new expression that represents the quotient ofthisandarg.- Overrides:
- 
          divin classExpression
- Parameters:
- 
          arg- Divisor.
- Returns:
- 
          Quotient of 
          thisandarg.
- Since:
- 43.00
 
 -  divpublic QuadTerm div(ConstantExpression arg) - Since:
- 43.00
 
 -  divpublic QuadTerm div(double arg) Create a new expression that represents the quotient ofthisandarg.- Overrides:
- 
          divin classExpression
- Parameters:
- 
          arg- Divisor.
- Returns:
- 
          Quotient of 
          thisandarg.
- Since:
- 43.00
 
 
-  
 
-  
         
© 2001-2024 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.
 
