Class COptQuestSplineCorrectionMatrixVariable


public class COptQuestSplineCorrectionMatrixVariable extends COptQuestManifoldVariable
A spline correction matrix variable. Its value is a baseline matrix, initial, plus a correction on a smooth surface through a grid of knots. Use a spline correction matrix variable to keep a known table and change it smoothly.

The surface is a centripetal Catmull-Rom spline. It is smooth, and it passes through its knots. The knots form a knotRows by knotCols grid at evenly spaced rows and columns, with knots at all four edges.

In every solution that the engine generates, every entry is from min to max. The engine first moves each entry of initial into [min, max].

Variable names: <name>@<row>,<col> for each entry, with 1-based row and column numbers, row by row. Each name contains a comma, so write it in brackets in an expression: [<name>@1,2].

In most programs, you add this variable with OptQuestModel.AddSplineCorrectionMatrixVariable and read its values with OptQuestSolution.GetValue(String) and the generated names. Construct this class only when you add the variable with COptQuestOptimization.AddVariable(COptQuestVariable).

See Also:
  • OptQuestModel.AddSplineCorrectionMatrixVariable(String, double[][], int, int, double, double)
  • Constructor Details

    • COptQuestSplineCorrectionMatrixVariable

      public COptQuestSplineCorrectionMatrixVariable(String name, double[][] initial, int knotRows, int knotCols, double min, double max) throws COptQuestException
      Creates a spline correction matrix variable.
      Parameters:
      name - base name of the variable
      initial - the baseline matrix; the variable has the same number of rows and columns
      knotRows - number of knot rows; the surface is smoother down the columns with fewer knot rows. A value less than 2 is used as 2, and a value greater than the number of rows is used as that number.
      knotCols - number of knot columns; the surface is smoother along the rows with fewer knot columns. A value less than 2 is used as 2, and a value greater than the number of columns is used as that number.
      min - lower bound of every entry
      max - upper bound of every entry
      Throws:
      COptQuestException - if an error occurs while the variable is created
  • Method Details

    • getInputVariables

      public List<COptQuestVariable> getInputVariables()
      Returns an empty list, because a spline correction matrix variable has no ordinary input variables.

      The values of a spline correction matrix variable are in the list that getProjectedInputVariables() returns. That list has one variable <name>@<row>,<col> for each entry.

      Returns:
      an empty list
    • getOutputVariables

      public List<COptQuestUserControlledVariable> getOutputVariables()
      Returns an empty list, because a spline correction matrix variable has no output variables.

      The values of a spline correction matrix variable are in the list that getProjectedInputVariables() returns. That list has one variable <name>@<row>,<col> for each entry.

      Returns:
      an empty list
    • getProjectedInputVariables

      public List<COptQuestUserControlledVariable> getProjectedInputVariables()
      Description copied from class: COptQuestManifoldVariable
      Returns the decision values of this manifold variable that are not ordinary decision variables.

      For example, an angle variable returns angle@theta, and a mixture variable returns one mix@<component> name for each component. In every solution that the engine generates, and in every suggested solution, these values are inside the set of the variable. Your evaluator reads them as inputs: OptQuestSolution.GetInputNames() returns them.

      A constraint that uses one of these names is checked after the evaluation, like a constraint on an output. Your evaluator can receive values that break the constraint, and the solution is then infeasible.

      Specified by:
      getProjectedInputVariables in class COptQuestManifoldVariable
      Returns:
      fixed-size or immutable list of these variables; never null