SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.optimization.multivariate.constrained.general.penaltymethod

Class SumOfPenalties

• All Implemented Interfaces:
Function<Vector,Double>, RealScalarFunction

public class SumOfPenalties
extends PenaltyFunction
This penalty function sums up the costs from a set of constituent penalty functions. This builds a new composite penalty function from existing simpler ones. It applies to any constrained optimization problems.

• Nested classes/interfaces inherited from interface com.numericalmethod.suanshu.analysis.function.Function

Function.EvaluationException
• Constructor Summary

Constructors
Constructor and Description
SumOfPenalties(PenaltyFunction... penalties)
Construct a sum-of-penalties penalty function from a set of penalty functions.
• Method Summary

All Methods
Modifier and Type Method and Description
int dimensionOfDomain()
Get the number of variables the function has.
Double evaluate(Vector x)
Evaluate the function f at x, where x is from the domain.
• Methods inherited from class com.numericalmethod.suanshu.optimization.multivariate.constrained.general.penaltymethod.PenaltyFunction

dimensionOfRange
• Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• Constructor Detail

• SumOfPenalties

public SumOfPenalties(PenaltyFunction... penalties)
Construct a sum-of-penalties penalty function from a set of penalty functions. The penalties must have the same dimension.
Parameters:
penalties - the constituent penalty functions
• Method Detail

• evaluate

public Double evaluate(Vector x)
Description copied from interface: Function
Evaluate the function f at x, where x is from the domain.
Parameters:
x - x
Returns:
f(x)
• 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