java.lang.Object
dev.nm.solver.multivariate.constrained.general.penaltymethod.PenaltyFunction
dev.nm.solver.multivariate.constrained.general.penaltymethod.MultiplierPenalty
All Implemented Interfaces:
Function<Vector,Double>, RealScalarFunction
Direct Known Subclasses:
AbsoluteErrorPenalty, CourantPenalty, FletcherPenalty

public abstract class MultiplierPenalty extends PenaltyFunction
A multiplier penalty function allows different weights to be assigned to the constraints.
  • Field Details

    • weights

      protected final double[] weights
      the weights for the constraints
    • constraints

      protected final Constraints constraints
      the constraint/cost functions
  • Constructor Details

    • MultiplierPenalty

      public MultiplierPenalty(Constraints constraints, double[] weights)
      Construct a multiplier penalty function from a collection of constraints.
      Parameters:
      constraints - a collection of constraints
      weights - the weights assigned to the constraints
    • MultiplierPenalty

      public MultiplierPenalty(Constraints constraints, double weight)
      Construct a multiplier penalty function from a collection of constraints. We assign the same weight to all constraints.
      Parameters:
      constraints - a collection of equality constraints
      weight - the same weight assigned to all constraints
    • MultiplierPenalty

      public MultiplierPenalty(Constraints constraints)
      Construct a multiplier penalty function from a collection of constraints. We assign the same default weight, 1.0, to all constraints.
      Parameters:
      constraints - a collection of constraints
  • Method Details

    • dimensionOfDomain

      public int dimensionOfDomain()
      Description copied from interface: Function
      Get the number of variables the function has. For example, for a univariate function, the domain dimension is 1; for a bivariate function, the domain dimension is 2.
      Returns:
      the number of variables