# SuanShu, a Java numerical and statistical library

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

## Class AbsoluteErrorPenalty

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

public class AbsoluteErrorPenalty
extends MultiplierPenalty
This penalty function sums up the absolute error penalties. It applies to equality constrained problems.

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

Function.EvaluationException

• ### Fields inherited from class com.numericalmethod.suanshu.optimization.multivariate.constrained.general.penaltymethod.MultiplierPenalty

constraints, weights
• ### Constructor Summary

Constructors
Constructor and Description
AbsoluteErrorPenalty(EqualityConstraints constraints)
Construct an absolute error penalty function from a collection of equality constraints.
AbsoluteErrorPenalty(EqualityConstraints constraints, double weight)
Construct an absolute error penalty function from a collection of equality constraints.
AbsoluteErrorPenalty(EqualityConstraints constraints, double[] weights)
Construct an absolute error penalty function from a collection of equality constraints.
• ### Method Summary

All Methods
Modifier and Type Method and Description
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.MultiplierPenalty

dimensionOfDomain
• ### 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

• #### AbsoluteErrorPenalty

public AbsoluteErrorPenalty(EqualityConstraints constraints,
double[] weights)
Construct an absolute error penalty function from a collection of equality constraints.
Parameters:
constraints - a collection of equality constraints
weights - the weights assigned to the constraints
• #### AbsoluteErrorPenalty

public AbsoluteErrorPenalty(EqualityConstraints constraints,
double weight)
Construct an absolute error penalty function from a collection of equality constraints. This assigns the same weight to all constraints.
Parameters:
constraints - a collection of equality constraints
weight - the same weight assigned to all constraints
• #### AbsoluteErrorPenalty

public AbsoluteErrorPenalty(EqualityConstraints constraints)
Construct an absolute error penalty function from a collection of equality constraints. We assign the same default weight to all constraints.
Parameters:
constraints - a collection of equality constraints
• ### 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)