#include <BoxedMurtyAlgorithm.h>
|
| static agx::Real | getComplementarityError (const agx::IndexSet &indexSet, const agx::SparseRangeReal &bounds, const agx::RealValarray &z, const agx::RealValarray &w) |
| | Computes the complementarity error of a current solution. More...
|
| |
| static agx::Bool | isFeasible (const SparseRangeReal &bounds, const RealValarray &z, const Real threshold) |
| | Checks if the solution z is feasible, i.e., within bounds. More...
|
| |
| static agx::Bool | saveAsHdf5 (const agx::String &filename, const SparseMatrix &m, RealValarray &z, RealValarray &q, RealValarray &signs, const agx::SparseRangeReal &bounds) |
| | Save matrix, solution, right hand side, sign convention and bounds to a unique problem in filename. More...
|
| |
| template<typename T > |
| static bool | ValidateCast (const Referenced *object) |
| |
|
| virtual | ~BoxedMurtyAlgorithm () |
| |
| void | allocateObserverVector () const |
| |
| Real | calculateResidual (const RealValarray &z, const RealValarray &w, const SparseRangeReal &bounds, const IndexSet &indexSet) const |
| |
| void | debugCheckSolution (const RealValarray &z, const SparseRangeReal &) const |
| | Asserts if z has invalid values. More...
|
| |
| void | deleteUsingDeleteHandler () const |
| |
| void | forceToBound (RealValarray &v, const agx::SparseRangeReal &bounds, const agx::IndexSet &indexSet) const |
| | Write the elements v[i] for which i is at a bound. More...
|
| |
| void | getSlack (agx::SparseMatrix &m, agx::RealValarray &z, const agx::RealValarray &q, const agx::RealValarray &signs, agx::RealValarray &slack) const |
| | Computes slack w = M z + q. More...
|
| |
| void | linearSolve (agx::SparseMatrix &m, agx::RealValarray &z, const agx::RealValarray &q, const agx::RealValarray &signs) const |
| | Solves: M z = -q for z. More...
|
| |
| void | solveInitial (agx::NlMixedCp::McpAlgorithm::Args &args) const |
| | Performs linear solve and stores the solution into args.z0 AND args.z. More...
|
| |
| void | solvePp (agx::SparseMatrix &m, agx::SparseInverse &sparseInverse, const RealValarray &z0, const agx::SparseRangeReal &bounds, const IndexSet &indexSet, const RealValarray &signs, RealValarray &z) const |
| | Solve principle problem given sparse matrix, initial solution, bounds and current index set. More...
|
| |
| void | solvePp (agx::SparseMatrix &m, const agx::SparseRangeReal &bounds, const IndexSet &indexSet, const RealValarray &signs, const RealValarray &q, RealValarray &z, RealValarray &workspace) |
| | Solve principle problem given sparse matrix, initial solution, bounds and current index set. More...
|
| |
| virtual agx::UInt | switchIndices (const agx::RealValarray &z, const agx::RealValarray &w, const agx::SparseRangeReal &bounds, agx::IndexSet &indexSet, agx::Real tolerance=agx::Real(1E-8)) const |
| | Switch indices in the index set given current solution and slack. More...
|
| |
Definition at line 24 of file BoxedMurtyAlgorithm.h.
◆ BoxedMurtyAlgorithm()
| agx::BoxedMurtyAlgorithm::BoxedMurtyAlgorithm |
( |
Real |
globalTolerance, |
|
|
UInt |
maxNumIterations, |
|
|
bool |
gatherStatistics |
|
) |
| |
◆ ~BoxedMurtyAlgorithm()
| virtual agx::BoxedMurtyAlgorithm::~BoxedMurtyAlgorithm |
( |
| ) |
|
|
protectedvirtual |
◆ allocateObserverVector()
| void agx::Referenced::allocateObserverVector |
( |
| ) |
const |
|
protectedinherited |
◆ as() [1/2]
template<typename T >
| T* agx::Referenced::as |
( |
| ) |
|
|
inherited |
◆ as() [2/2]
template<typename T >
| const T* agx::Referenced::as |
( |
| ) |
const |
|
inherited |
◆ asSafe() [1/2]
template<typename T >
| T* agx::Referenced::asSafe |
( |
| ) |
|
|
inherited |
◆ asSafe() [2/2]
template<typename T >
| const T* agx::Referenced::asSafe |
( |
| ) |
const |
|
inherited |
◆ calculateResidual()
◆ clearStats()
| void agx::NlMixedCp::McpAlgorithm::clearStats |
( |
size_t |
numEquations | ) |
|
|
inherited |
Ensure that the solver statistics can report data for the given number of equations.
All previously reported statistics are set to zero.
- Parameters
-
| numEquations | The number of equations to gather statistics for. |
◆ debugCheckSolution()
Asserts if z has invalid values.
◆ deleteUsingDeleteHandler()
| void agx::Referenced::deleteUsingDeleteHandler |
( |
| ) |
const |
|
protectedinherited |
◆ forceToBound()
Write the elements v[i] for which i is at a bound.
◆ getComplementarityError()
Computes the complementarity error of a current solution.
- Parameters
-
| indexSet | - index set |
| bounds | - bounded variables |
| z | - current solution |
| w | - current slack |
- Returns
- normalized error
◆ getDeleteHandler()
◆ getGlobalTolerance()
| agx::Real agx::NlMixedCp::McpAlgorithm::getGlobalTolerance |
( |
| ) |
const |
|
inherited |
- Returns
- the tolerance (accuracy) of the solution
◆ getMaxNumIterations()
| agx::UInt agx::NlMixedCp::McpAlgorithm::getMaxNumIterations |
( |
| ) |
const |
|
inherited |
- Returns
- the maximum number of iterations this algorithm may perform to reach the given tolerance of the solution
◆ getReferenceCount()
| int agx::Referenced::getReferenceCount |
( |
| ) |
const |
|
inherited |
- Returns
- the number pointers currently referencing this object.
◆ getSlack()
Computes slack w = M z + q.
- Parameters
-
| m | - sparse matrix |
| z | - current solution (NOTE: multiplied with signs before matrix multiply, but and later restored, hence not const) |
| q | - right hand side |
| signs | - sign convention (-1 for constraints 1 for bodies) |
| [out] | slack | - output slack |
◆ getStats() [1/2]
- Returns
- The solver statistics for the current solve algorithm.
◆ getStats() [2/2]
- Returns
- The solver statistics for the current solve algorithm.
◆ is()
template<typename T >
| bool agx::Referenced::is |
( |
| ) |
const |
|
inherited |
◆ isFeasible()
Checks if the solution z is feasible, i.e., within bounds.
- Parameters
-
| bounds | - bounded equations in z |
| z | - current solution |
| threshold | - feasible threshold |
- Returns
- true if z is feasible, otherwise false
◆ linearSolve()
Solves: M z = -q for z.
- Parameters
-
| m | - sparse matrix |
| [out] | z | - solution |
| q | - right hand side |
| signs | - sign convention (-1 for constraints 1 for bodies) |
◆ reference()
| void agx::Referenced::reference |
( |
void * |
ptr = nullptr | ) |
const |
|
inherited |
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
This method should be used with care, always balanced with the same number of calls to unreference.
◆ resizeStats()
| void agx::NlMixedCp::McpAlgorithm::resizeStats |
( |
size_t |
numEquations | ) |
|
|
inherited |
Ensure that the solver statistics can report data for the given number of equations.
Any new allocations will be initialized to zero.
- Parameters
-
| numEquations | The number of equations to gather statistics for. |
◆ saveAsHdf5()
Save matrix, solution, right hand side, sign convention and bounds to a unique problem in filename.
- Parameters
-
| filename | - name of file to save the problem to |
| m | - matrix |
| z | - solution |
| q | - rhs |
| signs | - sign convention (-1 of constraints 1 for bodies) |
| bounds | - bounds |
- Returns
- true if successful, otherwise false
◆ setDeleteHandler()
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
◆ setGlobalTolerance()
| void agx::NlMixedCp::McpAlgorithm::setGlobalTolerance |
( |
agx::Real |
globalTolerance | ) |
|
|
inherited |
Assign the tolerance (accuracy) of the solution.
◆ setMaxNumIterations()
| void agx::NlMixedCp::McpAlgorithm::setMaxNumIterations |
( |
agx::UInt |
maxNumIterations | ) |
|
|
inherited |
Assign the maximum number of iterations this algorithm may perform to reach the given tolerance of the solution.
◆ solve()
◆ solveInitial()
Performs linear solve and stores the solution into args.z0 AND args.z.
◆ solvePp() [1/2]
Solve principle problem given sparse matrix, initial solution, bounds and current index set.
- Parameters
-
| m | - sparse matrix (support solve and for unit solve) |
| sparseInverse | - sparse inverse with storage of columns of the inverse |
| z0 | - initial, linear solution |
| bounds | - bounded variables |
| indexSet | - current state of the index set |
| signs | - sign convention (-1 for constraints 1 for bodies) |
| [out] | z | - solution |
◆ solvePp() [2/2]
Solve principle problem given sparse matrix, initial solution, bounds and current index set.
- Parameters
-
| m | - sparse matrix (support solve and for unit solve) |
| bounds | - bounded variables |
| indexSet | - current state of the index set |
| signs | - sign convention (-1 for constraints 1 for bodies) |
| q | - right hand side |
| [out] | z | - solution |
| workspace | Temporary vector used for storage and to avoid reallocations |
◆ switchIndices()
|
|
protectedvirtualinherited |
Switch indices in the index set given current solution and slack.
- Parameters
-
| z | - solution |
| w | - slack |
| bounds | - bounded equations |
| indexSet | - Output variable: with index set |
| tolerance | - tolerance of switch condition |
- Returns
- number of switched indices
Reimplemented in agx::BoxedKellerAlgorithm.
◆ unreference()
| void agx::Referenced::unreference |
( |
void * |
ptr = nullptr | ) |
const |
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
This method should be used with care, always balanced with the same number of calls to reference.
Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().
◆ unreference_nodelete()
| void agx::Referenced::unreference_nodelete |
( |
| ) |
const |
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
◆ ValidateCast()
template<typename T >
| static bool agx::Referenced::ValidateCast |
( |
const Referenced * |
object | ) |
|
|
staticinherited |
◆ m_globalTolerance
| agx::Real agx::NlMixedCp::McpAlgorithm::m_globalTolerance |
|
protectedinherited |
◆ m_maxNumIterations
| agx::UInt agx::NlMixedCp::McpAlgorithm::m_maxNumIterations |
|
protectedinherited |
◆ m_mutex
| Mutex agx::Referenced::m_mutex |
|
mutableprotectedinherited |
◆ m_observers
|
|
mutableprotectedinherited |
◆ m_refCount
|
|
mutableprotectedinherited |
◆ m_stats
The documentation for this class was generated from the following file: