Table of Contents

Class NonhomogeneousBoundaryConstraint

Namespace
NanoQL.Numerics
Assembly
NanoQL.dll

A constraint imposing the i-th argument to be in [lowᵢ, highᵢ], for every i.

public sealed class NonhomogeneousBoundaryConstraint : Constraint
Inheritance
NonhomogeneousBoundaryConstraint
Inherited Members

Remarks

It copies its bounds. As in QuantLib, an argument compares as outside its bounds only when it is below lowᵢ or above highᵢ, so a NaN satisfies the constraint.

Constructors

NonhomogeneousBoundaryConstraint(ReadOnlySpan<double>, ReadOnlySpan<double>)

Initializes a new instance of the NonhomogeneousBoundaryConstraint class.

public NonhomogeneousBoundaryConstraint(ReadOnlySpan<double> low, ReadOnlySpan<double> high)

Parameters

low ReadOnlySpan<double>

The lower bound of each argument, which it copies.

high ReadOnlySpan<double>

The upper bound of each argument, which it copies.

Exceptions

NanoQLException

The bounds have different sizes.

Methods

LowerBoundCore(Vector)

The lower bound for the given parameters, which LowerBound(Vector) checks: by default none.

protected override Vector LowerBoundCore(Vector parameters)

Parameters

parameters Vector

The parameters.

Returns

Vector

A new vector, the most negative double in each element by default.

Test(Vector)

Whether the parameters satisfy the constraint.

public override bool Test(Vector p)

Parameters

p Vector

The parameters.

Returns

bool

true when they do.

Exceptions

NanoQLException

The parameters have another size than the bounds.

UpperBoundCore(Vector)

The upper bound for the given parameters, which UpperBound(Vector) checks: by default none.

protected override Vector UpperBoundCore(Vector parameters)

Parameters

parameters Vector

The parameters.

Returns

Vector

A new vector, the largest double in each element by default.