ABA_CONVAR is the common base class for constraints and variables, which are implemented in the derived classes ABA_CONSTRAINT and ABA_VARIABLE, respectively.
#include <convar.h>
Inheritance diagram for ABA_CONVAR::
|
This version of the function sub() associates a new subproblem with the constraint/variable.
Should provide a key for the constraint/variable that can be used to insert it into a hash table.
Should compare if the constraint/variable is identical (in a mathematical sense) with the constraint/variable cv.
The function should return a rank associated with the constraint/variable. The default implementation returns 0.
Constraints/Variables often have to be stored in a format different from the format used in the linear program. One reason is to save memory and the other reason is that if constraints and/or variable sets are dynamic, then we require a format to compute the coefficients of later activated variables/constraints.
The disadvantage of such a constraint format is that the computation of a single constraint coefficient can be very time consuming. Often it cannot be done in constant time. Hence we provide a mechanism which converts a constraint/variable to a format enabling efficient computation of coefficients. The following functions provide this feature.
A pointer to the subproblem associated with the constraint/variable. This may be also the 0-pointer.
The number of references to the pool slot the constraint is stored ABA_POOLSLOTREF.
If this member is true then the constraint/variable can be also removed from the active formulation after it is added the first time. For constraints/variables which should be never removed from the active formulation this member should be set to false.
The number of active subproblems of which the constraint/variable belongs to the set of active constraints/variables.
This flag is true if the constraint/variable is only locally valid, otherwise it is false.
Must be called if the constraint/variable is added to the active formulation of an active subproblem.
Is the counterpart to activate() and is also called within members of the class ABA_SUB to indicate that the constraint/variable does not belong any more to the active formulation of an active subproblem.
Returns the number of references to the pool slot ABA_POOLSLOTREF storing this constraint/variable.
Indicates that there is a new reference to the pool slot storing this constraint/variable.
Is the counterpart of the function addReference() and indicates the removal of a reference to this constraint.
If a constraint/variable has just been separated and added to the buffer of currently separated constraints/variables, then this item should not be removed before the buffer is emptied at the beginning of the next iteration. Hence, we provide a locking mechanism for constraints/variables by the following three functions.
ABA_CONVAR is the common base class for constraints and variables, which are implemented in the derived classes ABA_CONSTRAINT and ABA_VARIABLE, respectively.
Definition at line 79 of file convar.h.
The constructor.
The destructor.
Checks if the constraint/variable is active in at least one active subproblem.
In the parallel implementation this can be more than one subproblem when multithreading occurs. Only those subproblems are taken into account which are related to the pool in which the constraint/variable is stored.
true If the constraint/variable is active,
false otherwise.
Definition at line 467 of file convar.h.
true If the constraint/variable is only locally valid,
false otherwise.
Definition at line 499 of file convar.h.
true If the constraint/variable is globally valid,
false otherwise.
Definition at line 504 of file convar.h.
true If the constraint/variable can be also removed from the set of active constraints/var\-i\-a\-bles after it has been activated,
false otherwise.
true If the expanded format of a constraint/variable is available,
false otherwise.
Definition at line 524 of file convar.h.
Tries to generate the expanded format of the constraint/variable.
This will be only possible if the virtual function expand() is redefined for the specific constraint/variable.
Removes the expanded format of the constraint/variable.
This will be only possible if the virtual function compress() is redefined for the specific constraint/variable.
The function writes the constraint/variable on the stream out.
This function is used since the output operator cannot be declared virtual. The default implementation writes "ABA_CONVAR::print() is only a dummy." on the stream out. We do not declare this function pure virtual since it is not really required, mainly only for debugging. In this case a constraint/variable specific redefinition is strongly recommended.
Normally, the implementation out << *this should be sufficient.
Reimplemented in ABA_COLVAR, ABA_NUMCON, and ABA_ROWCON.
A pointer to the subproblem associated with the constraint/variable. Note, this can also be the 0-pointer.
Definition at line 514 of file convar.h.
This version of the function sub() associates a new subproblem with the constraint/variable.
Definition at line 519 of file convar.h.
Should provide a key for the constraint/variable that can be used to insert it into a hash table.
As usual for hashing, it is not required that any two items have different keys.
This function is required if the constraint/variable is stored in a pool of the class ABA_NONDUPLPOOL.
The default implementation shows a warning and calls exit(). This function is not a pure virtual function because in the default version of \ it is not required.
We do not use double as result type because typical problems in floating point arithmetic might give slightly different hash keys for two constraints that are equal from a mathematical point of view.
The redundant return statement is required to suppress compiler warnings.
An integer providing a hash key for the constraint/variable.
Should return the name of the constraint/variable.
This function is required to emulate a simple run time type information (RTTI) that is still missing in /. This function will be removed as soon as RTTI is supported sufficiently.
A user must take care that for each redefined version of this function in a derived class a unique name is returned. Otherwise fatal run time errors can occur. Therefore, we recommend to return always the name of the class.
This function is required if the constraint/variable is stored in a pool of the class ABA_NONDUPLPOOL.
The default implementation shows a warning and calls exit(). This function is not a pure virtual function because in the default version of \ it is not required.
The redundant return statement is required to suppress compiler warnings.
The name of the constraint/variable.
Should compare if the constraint/variable is identical (in a mathematical sense) with the constraint/variable cv.
Using RTTI or its emulation provided by the function name()| it is sufficient to implement this functions for constraints/variables of the same type.
This function is required if the constraint/variable is stored in a pool of the class ABA_NONDUPLPOOL.
The default implementation shows a warning and calls exit(). This function is not a pure virtual function because in the default version of \ it is not required.
The redundant return statement is required to suppress compiler warnings.
true If the constraint/variable represented by this object represents the same item as the constraint/variable cv,
false otherwise.
The function should return a rank associated with the constraint/variable. The default implementation returns 0.
The rank of the constraint/variable.
Must be called if the constraint/variable is added to the active formulation of an active subproblem.
This function is only called within member functions of the class ABA_SUB.
Definition at line 473 of file convar.h.
Is the counterpart to activate() and is also called within members of the class ABA_SUB to indicate that the constraint/variable does not belong any more to the active formulation of an active subproblem.
Returns the number of references to the pool slot ABA_POOLSLOTREF storing this constraint/variable.
We require the bookkeeping of the references in order to determine if a constraint/variable can be deleted without causing any harm.
Definition at line 478 of file convar.h.
Indicates that there is a new reference to the pool slot storing this constraint/variable.
The function is only called from members of the class ABA_POOLSLOTREF.
Definition at line 483 of file convar.h.
Is the counterpart of the function addReference() and indicates the removal of a reference to this constraint.
It is only called from members of the class ABA_POOLSLOTREF.
true if at least one lock is set on the constraint/variable
false otherwise.
Definition at line 488 of file convar.h.
Adds an additional lock to the constraint/variable.
Definition at line 494 of file convar.h.
Removes one lock from the constraint/variable.
Returns true if the constraint/variable can be destructed.
This is per default only possible if the reference counter is 0 and no lock is set. The function is declared virtual such that problem specific implementations are possible.
The default implementation of the function expand() is void. It should be redefined in derived classes.
Also the default implementation of the function compress() is void. It should be redefined in derived classes.
Definition at line 80 of file convar.h.
Definition at line 81 of file convar.h.
Definition at line 82 of file convar.h.
Definition at line 83 of file convar.h.
Definition at line 84 of file convar.h.
Definition at line 85 of file convar.h.
Definition at line 86 of file convar.h.
Definition at line 87 of file convar.h.
Definition at line 88 of file convar.h.
A pointer to the corresponding master of the optimization.
Definition at line 333 of file convar.h.
A pointer to the subproblem associated with the constraint/variable. This may be also the 0-pointer.
Definition at line 338 of file convar.h.
true, if expanded version of constraint/variables available.
Definition at line 342 of file convar.h.
The number of references to the pool slot the constraint is stored ABA_POOLSLOTREF.
Definition at line 347 of file convar.h.
If this member is true then the constraint/variable can be also removed from the active formulation after it is added the first time. For constraints/variables which should be never removed from the active formulation this member should be set to false.
Definition at line 356 of file convar.h.
The number of active subproblems of which the constraint/variable belongs to the set of active constraints/variables.
This value is always 0 after construction and has to be set and reset during the subproblem optimization. This member is mainly used to accelerate pool separation and to control that the same variable is not multiply included into a set of active variables.
Definition at line 368 of file convar.h.
The number of locks which have been set on the constraint/variable.
Definition at line 372 of file convar.h.
This flag is true if the constraint/variable is only locally valid, otherwise it is false.
Definition at line 377 of file convar.h.
The documentation for this class was generated from the following file: