AGX Dynamics  2.37.2.0
agx::BoxedHybridPivotAlgorithm Class Reference

#include <BoxedHybridPivotAlgorithm.h>

+ Inheritance diagram for agx::BoxedHybridPivotAlgorithm:

Public Member Functions

 BoxedHybridPivotAlgorithm (agx::Real globalTolerance, agx::UInt maxNumIterations, bool gatherStatistics)
 Construct given global tolerance and the maximum iterations. More...
 
- Public Member Functions inherited from agx::NlMixedCp::McpAlgorithm
 McpAlgorithm (agx::Real globalTolerance, agx::UInt maxNumIterations, bool gatherStatistics)
 Construct given minimum tolerance and maximum number of iterations. More...
 
void clearStats (size_t numEquations)
 Ensure that the solver statistics can report data for the given number of equations. More...
 
agx::Real getGlobalTolerance () const
 
agx::UInt getMaxNumIterations () const
 
const McpAlgorithmStats & getStats () const
 
McpAlgorithmStats & getStats ()
 
void resizeStats (size_t numEquations)
 Ensure that the solver statistics can report data for the given number of equations. More...
 
void setGlobalTolerance (agx::Real globalTolerance)
 Assign the tolerance (accuracy) of the solution. More...
 
void setMaxNumIterations (agx::UInt maxNumIterations)
 Assign the maximum number of iterations this algorithm may perform to reach the given tolerance of the solution. More...
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor. More...
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object. More...
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Protected Member Functions

virtual ~BoxedHybridPivotAlgorithm ()
 Reference counted object - protected destructor. More...
 
virtual agx::NlMixedCp::McpAlgorithm::SolveReport solve (agx::NlMixedCp::McpAlgorithm::Args &args) override
 Solves MCP using Keller's Principal Pivot Method. More...
 
- Protected Member Functions inherited from agx::NlMixedCp::McpAlgorithm
void debugCheckSolution (const RealValarray &z, const SparseRangeReal &) const
 Asserts if z has invalid values. More...
 
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...
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Protected Attributes

agx::BoxedMurtyAlgorithmRef m_blockPivot
 
agx::BoxedKellerAlgorithmRef m_keller
 
agx::Real m_localTolerance
 
- Protected Attributes inherited from agx::NlMixedCp::McpAlgorithm
agx::Real m_globalTolerance
 
agx::UInt m_maxNumIterations
 
McpAlgorithmStats m_stats
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::NlMixedCp::McpAlgorithm
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...
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Detailed Description

Definition at line 25 of file BoxedHybridPivotAlgorithm.h.

Constructor & Destructor Documentation

◆ BoxedHybridPivotAlgorithm()

agx::BoxedHybridPivotAlgorithm::BoxedHybridPivotAlgorithm ( agx::Real  globalTolerance,
agx::UInt  maxNumIterations,
bool  gatherStatistics 
)

Construct given global tolerance and the maximum iterations.

◆ ~BoxedHybridPivotAlgorithm()

virtual agx::BoxedHybridPivotAlgorithm::~BoxedHybridPivotAlgorithm ( )
protectedvirtual

Reference counted object - protected destructor.

Member Function Documentation

◆ solve()

virtual agx::NlMixedCp::McpAlgorithm::SolveReport agx::BoxedHybridPivotAlgorithm::solve ( agx::NlMixedCp::McpAlgorithm::Args &  args)
overrideprotectedvirtual

Solves MCP using Keller's Principal Pivot Method.

Implements agx::NlMixedCp::McpAlgorithm.

Member Data Documentation

◆ m_blockPivot

agx::BoxedMurtyAlgorithmRef agx::BoxedHybridPivotAlgorithm::m_blockPivot
protected

Definition at line 46 of file BoxedHybridPivotAlgorithm.h.

◆ m_keller

agx::BoxedKellerAlgorithmRef agx::BoxedHybridPivotAlgorithm::m_keller
protected

Definition at line 47 of file BoxedHybridPivotAlgorithm.h.

◆ m_localTolerance

agx::Real agx::BoxedHybridPivotAlgorithm::m_localTolerance
protected

Definition at line 45 of file BoxedHybridPivotAlgorithm.h.


The documentation for this class was generated from the following file: