Constraint
Formulation
The local formulation of the constraint's quadratic equation reads :
where :
- Hi,red : Symmetric matrix.
- bi,red : Column vector.
- ci : Scalar value.
Custom Constraint Type
Custom Quadratic Constraint Type
Create a public class which inherits from the IQuadraticConstraintType
interface and declare the three properties required to implement the interface. These three properties correspond to the local symmetric matrix Hi,red, the column vector bi and the scalar coefficient ci necessary to define a linear constraint from vector xred.
public class CostumQuadraticConstraintName : IQuadraticConstraintType
{
/// <inheritdoc/>
public DictionaryOfKeys LocalHi { get; }
/// <inheritdoc/>
public Dictionary<int, double> LocalKi { get; }
/// <inheritdoc/>
public double Si { get; }
...
}
Then, in the class constructor, instanciate and initialise the values of the properties. The parameters of the constructor should provide the information needed to fill in Hi,red, bi and ci.
public CostumQuadraticConstraintName()
{
...
}
Cusoum Linearised Constraint Type
Create a public class which inherits from the ILinearisedConstraintType
interface and declare the three properties required to implement the interface. These three properties correspond to the local symmetric matrix Hi,red, the column vector bi and the scalar coefficient ci necessary to define a linear constraint from vector xred.
public class CostumLinearisedConstraintName : ILinearisedConstraintType
{
/// <inheritdoc/>
public DictionaryOfKeys LocalHi { get; }
/// <inheritdoc/>
public Dictionary<int, double> LocalKi { get; }
/// <inheritdoc/>
public double Si { get; }
...
}
Then, leave the class constructor empty.
public CostumLinearisedConstraintName()
{
...
}
Finally, declare an update method for the properties of the costum linearised constraint type. The parameter xReduced of the method contains the updated value of the variables'components. The order of the components in xReduced follows the order in which the variables where are added in the ensuing LinearisedConstraint
. This method will be called at each iteration during the solving process with the updated values of xReduced.
void UpdateLocal(double[] xReduced);
{
/* Update the values of the properties using xReduced */
}
Implemented Constraint Types
Implemented Quadratic Constraints Types
The following energies can be found in BRIDGES.Solvers.GuidedProjection.QuadraticConstraintTypes
namespace.
Coherent Length
Constraint enforcing a scalar variable l to match with the distance between two point variables, pi and pj. For more information, see the dedicated page.
Lower Bound
Constraint enforcing a value variable l to be higher than a lower bound σ using a dummy value variable λ. For more information, see the dedicated page.
Upper Bound
Constraint enforcing a value variable l to be lower than an upper bound σ using a dummy value variable λ. For more information, see the dedicated page.
Vector Length
Constraint enforcing a vector variable v to have a given length l (computed with euclidean norm). For more information, see the dedicated page.
Implemented Linearised Constraint Types
The following energies can be found in BRIDGES.Solvers.GuidedProjection.LinearisedConstraintTypes
namespace.
No linearised constraints are defined yet