Skip to main content
Namespace: Phoenix.Optimization

Overview

Class to hold contraint information

Inheritance

OptConstraint

Declaration

Description

Class to hold contraint information

Public Member Functions

Properties

Properties inherited from IVariableName

Constructor & Destructor Documentation

OptConstraint()

Copy constructor to create a new constraint from an existing constraint Parameters:
  • constraint - Constraint to be copied

OptConstraint()

Create a new constraint with the given name, lower and upper bound. At least one bound must be specified. If a bound is not specified, it should be set to NaN. Parameters:
  • name - Name of the constraint.
  • lowerBound - Lower bound of the constraint, or NaN if no lower constraint.
  • upperBound - Upper bound of the constraint, or NaN if no upper constraint.

Member Function Documentation

Compare

Compares to values to see which violates the constraint worse. Parameters:
  • x - Test value 1
  • y - Test value 2
Returns: -1 if x violates less, 0 if they violate the same, 1 if x violates it more

Equals

Determines whether the specified Object is equal to the current Object. Parameters:
  • obj - The object to compare with the current object.
Returns:
  • true if the specified Object is equal to the current Object; otherwise, false.

Equals

Determines whether the specified OptConstraint is equal to the current OptConstraint. Parameters:
  • constraint - The OptConstraint object to compare with the current OptConstraint.
Returns:
  • true if the specified OptConstraint is equal to the current OptConstraint; otherwise, false.

GetConstraintViolation

Given a particular value, returns an amount by which the constraint is violated. If the constraint is not violated, returns 0. If it is violated, always returns a positive value. Parameters:
  • p - The value to test
Returns:
  • The value of the constraint violation

GetHashCode

Serves as a hash function for OptConstraint. Returns:
  • A hash code for the current OptConstraint.

operator!=

Determines whether the specified OptConstraint instances are considered not equal. Parameters:
  • a - The first OptConstraint to compare.
  • b - The second OptConstraint to compare.
Returns:
  • true if the OptConstraints are not considered equal; otherwise, false.

operator==

Determines whether the specified OptConstraint instances are considered equal. Parameters:
  • a - The first OptConstraint to compare.
  • b - The second OptConstraint to compare.
Returns:
  • true if the OptConstraints are considered equal; otherwise, false.

LowerBound

Lower bound of the constraint or NaN if no lower bound exists.

Name

Name of the constraint Implements IVariableName.

UpperBound

Upper bound of constraint or NaN if no upper bound exists.

Property Documentation

LowerBound

Lower bound of the constraint or NaN if no lower bound exists.

Name

Name of the constraint Implements IVariableName.

UpperBound

Upper bound of constraint or NaN if no upper bound exists.