Class GuidedProjectionAlgorithm
Class defining a Guided Projection Algorithm solver.
The algorithm is described in https://doi.org/10.1145/2601097.2601213.
Namespace: BRIDGES.Solvers.GuidedProjection
Assembly: BRIDGES.dll
Syntax
public sealed class GuidedProjectionAlgorithm : object
Constructors
| Improve this Doc View SourceGuidedProjectionAlgorithm(Double, Int32)
Initializes a new instance of the GuidedProjectionAlgorithm class.
Declaration
public GuidedProjectionAlgorithm(double epsilon, int maxIteration)
Parameters
Type | Name | Description |
---|---|---|
Double | epsilon | The weights of the distance to the previous iteration. |
Int32 | maxIteration | The iteration index after which the solver is stopped. |
Properties
| Improve this Doc View SourceIterationIndex
Gets the zero-based index of the current iteration.
Declaration
public int IterationIndex { get; }
Property Value
Type | Description |
---|---|
Int32 |
MaxIteration
Gets or sets the maximum number of iteration after which the solver is stopped.
Declaration
public int MaxIteration { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
X
Gets the vector containing all the components of the GuidedProjectionAlgorithm.
Declaration
public Vector X { get; }
Property Value
Type | Description |
---|---|
Vector |
Methods
| Improve this Doc View SourceAddConstraint(ILinearisedConstraintType, List<(VariableSet, Int32)>, Func<Int32, Double>)
Creates a new LinearisedConstraint with a varying weight and adds it to the list.
Declaration
public LinearisedConstraint AddConstraint(ILinearisedConstraintType constraintType, List<(VariableSet, int)> variables, Func<int, double> weightFunction)
Parameters
Type | Name | Description |
---|---|---|
ILinearisedConstraintType | constraintType | Quadratic constraint type defining the constraint locally. |
List<(, )<VariableSet, Int32>> | variables | Variables composing the local vector xReduced. |
Func<Int32, Double> | weightFunction | Function computing the weight from the iteration index. |
Returns
Type | Description |
---|---|
LinearisedConstraint | The new constraint. |
AddConstraint(ILinearisedConstraintType, List<(VariableSet, Int32)>, Double)
Creates a new LinearisedConstraint with a constant weight and adds it to the list.
Declaration
public LinearisedConstraint AddConstraint(ILinearisedConstraintType constraintType, List<(VariableSet, int)> variables, double weight = 1)
Parameters
Type | Name | Description |
---|---|---|
ILinearisedConstraintType | constraintType | Quadratic constraint type defining the constraint locally. |
List<(, )<VariableSet, Int32>> | variables | Variables composing the local vector xReduced. |
Double | weight | Weight for the constraint. |
Returns
Type | Description |
---|---|
LinearisedConstraint | The new constraint. |
AddConstraint(IQuadraticConstraintType, List<(VariableSet, Int32)>, Func<Int32, Double>)
Creates a new QuadraticConstraint with a varying weight and adds it to the list.
Declaration
public QuadraticConstraint AddConstraint(IQuadraticConstraintType constraintType, List<(VariableSet, int)> variables, Func<int, double> weightFunction)
Parameters
Type | Name | Description |
---|---|---|
IQuadraticConstraintType | constraintType | Quadratic constraint type defining the constraint locally. |
List<(, )<VariableSet, Int32>> | variables | Variables composing the local vector xReduced. |
Func<Int32, Double> | weightFunction | Function computing the weight from the iteration index. |
Returns
Type | Description |
---|---|
QuadraticConstraint | The new constraint. |
AddConstraint(IQuadraticConstraintType, List<(VariableSet, Int32)>, Double)
Creates a new QuadraticConstraint with a constant weight and adds it to the list.
Declaration
public QuadraticConstraint AddConstraint(IQuadraticConstraintType constraintType, List<(VariableSet, int)> variables, double weight = 1)
Parameters
Type | Name | Description |
---|---|---|
IQuadraticConstraintType | constraintType | Quadratic constraint type defining the constraint locally. |
List<(, )<VariableSet, Int32>> | variables | Variables composing the local vector xReduced. |
Double | weight | Weight for the constraint. |
Returns
Type | Description |
---|---|
QuadraticConstraint | The new constraint. |
AddEnergy(IEnergyType, List<(VariableSet, Int32)>, Func<Int32, Double>)
Creates a new Energy with a varying weight and adds it to the list.
Declaration
public Energy AddEnergy(IEnergyType energyType, List<(VariableSet, int)> variables, Func<int, double> weightFunction)
Parameters
Type | Name | Description |
---|---|---|
IEnergyType | energyType | Energy type defining the energy locally. |
List<(, )<VariableSet, Int32>> | variables | Variables composing the local vector xReduced. |
Func<Int32, Double> | weightFunction | Function computing the weight from the iteration index. |
Returns
Type | Description |
---|---|
Energy |
AddEnergy(IEnergyType, List<(VariableSet, Int32)>, Double)
Creates a new Energy with a constant weight and adds it to the list.
Declaration
public Energy AddEnergy(IEnergyType energyType, List<(VariableSet, int)> variables, double weight = 1)
Parameters
Type | Name | Description |
---|---|---|
IEnergyType | energyType | Energy type defining the energy locally. |
List<(, )<VariableSet, Int32>> | variables | Variables composing the local vector xReduced. |
Double | weight | Weight for the energy. |
Returns
Type | Description |
---|---|
Energy | The new energy. |
AddVariableSet(Int32, Int32)
Creates a new VariableSet and adds it after the other ones.
Declaration
public VariableSet AddVariableSet(int variableDimension, int setCapacity)
Parameters
Type | Name | Description |
---|---|---|
Int32 | variableDimension | The dimension of the variables contained in set. |
Int32 | setCapacity | The indicative number of variables that the new set can initially store. |
Returns
Type | Description |
---|---|
VariableSet | The newly created VariableSet. |
AddVariableSet(Int32)
Creates a new VariableSet and adds it after the other ones.
Declaration
public VariableSet AddVariableSet(int variableDimension)
Parameters
Type | Name | Description |
---|---|---|
Int32 | variableDimension | The dimension of the variables contained in set. |
Returns
Type | Description |
---|---|
VariableSet | The newly created VariableSet. |
InitialiseX()
Initialise the solver for the GuidedProjectionAlgorithm.
Declaration
public void InitialiseX()
RunIteration(Boolean)
Runs one iteration.
Declaration
public void RunIteration(bool useAsync)
Parameters
Type | Name | Description |
---|---|---|
Boolean | useAsync | Evaluates whether the iteration should use asynchronous programming or not. |