# SuanShu, a Java numerical and statistical library

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

## Class CourantPenalty

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

public class CourantPenalty
extends MultiplierPenalty
This penalty function sums up the squared error penalties. It applies to equality constrained problems.
"R. CourantPenalty, "Variational methods for the solution of problems of equilibrium and vibration," Bull. Amer. Math. Soc., 49, 1- 23. 1943."

• ### 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
CourantPenalty(EqualityConstraints constraints)
Construct a CourantPenalty penalty function from a collection of equality constraints.
CourantPenalty(EqualityConstraints constraints, double weight)
Construct a CourantPenalty penalty function from a collection of equality constraints.
CourantPenalty(EqualityConstraints constraints, double[] weights)
Construct a CourantPenalty 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

• #### CourantPenalty

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

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

public CourantPenalty(EqualityConstraints constraints)
Construct a CourantPenalty 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)