AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agx::NlMixedCp Class Reference

Class that implements a method to solve linear- or nonlinear complementary problems. More...

#include <MixedLCP.h>

+ Inheritance diagram for agx::NlMixedCp:

Classes

class  McpAlgorithm
 Interface class for algorithm to solve general mixed complementarity problem. More...
 

Public Types

typedef agx::ref_ptr
< McpAlgorithm > 
McpAlgorithmRef
 

Public Member Functions

 NlMixedCp (agx::NlMixedCp::McpAlgorithm *mcpAlgorithm)
 
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
 
const
agx::NlMixedCp::McpAlgorithm * 
getAlgorithm () const
 
agx::SparseMatrix & getMatrix ()
 
const agx::SparseMatrix & getMatrix () const
 
agx::RealValarray & getQ ()
 
const agx::RealValarray & getQ () const
 
int getReferenceCount () const
 
agx::RealValarray & getSigns ()
 
const agx::RealValarray & getSigns () const
 
agx::RealValarray & getSolution ()
 
const agx::RealValarray & getSolution () const
 
agx::SparseRangeReal & getSparseBounds ()
 
const agx::SparseRangeReal & getSparseBounds () const
 
template<typename T >
bool is () const
 Subclass test. 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...
 
virtual void setSize (agx::UInt numEquations)
 Set the size of the system. More...
 
virtual agx::UInt solve (agx::Bool warm=false, agx::StabilityReport *stabilityReport=nullptr, agx::INlSolveDataH5 *nlSolveDataH5=nullptr)
 Solves the system, returns the total number of iterations made in the inner (mcp) loop. 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...
 

Static Public Member Functions

static NlMixedCpRef create (agx::Solver::NlMcpConfig config, bool gatherStatistics)
 Creates default solver assuming symmetric-, sparse- and lower triangle matrix. More...
 
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

virtual ~NlMixedCp ()
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Static Protected Member Functions

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...
 

Protected Attributes

Solver::NlMcpConfig m_config
 
agx::IndexSet m_indexSet
 
agx::SparseInverse m_inv
 
agx::SparseMatrix m_matrix
 
agx::UInt m_maxNumOuterIterations
 
agx::NlMixedCp::McpAlgorithmRef m_mcp
 
Mutex m_mutex
 
ObserverContainer m_observers
 
agx::Real m_outerGlobalTolerance
 
agx::RealValarray m_q
 
AtomicValue m_refCount
 
agx::RealValarray m_signs
 
agx::SparseRangeReal m_sparseBounds
 
agx::RealValarray m_z
 
agx::RealValarray m_z0
 

Detailed Description

Class that implements a method to solve linear- or nonlinear complementary problems.

Definition at line 107 of file MixedLCP.h.

Member Typedef Documentation

Constructor & Destructor Documentation

agx::NlMixedCp::NlMixedCp ( agx::NlMixedCp::McpAlgorithm *  mcpAlgorithm)
virtual agx::NlMixedCp::~NlMixedCp ( )
protectedvirtual

Member Function Documentation

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().

template<typename T >
const T* agx::Referenced::as ( ) const
inherited
template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
static NlMixedCpRef agx::NlMixedCp::create ( agx::Solver::NlMcpConfig  config,
bool  gatherStatistics 
)
static

Creates default solver assuming symmetric-, sparse- and lower triangle matrix.

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
const agx::NlMixedCp::McpAlgorithm* agx::NlMixedCp::getAlgorithm ( ) const
static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
agx::SparseMatrix& agx::NlMixedCp::getMatrix ( )
Returns
the matrix
const agx::SparseMatrix& agx::NlMixedCp::getMatrix ( ) const
Returns
the matrix
agx::RealValarray& agx::NlMixedCp::getQ ( )
Returns
the negative right hand side q (Hx + q = w)
const agx::RealValarray& agx::NlMixedCp::getQ ( ) const
Returns
the negative right hand side q (Hx + q = w)
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
agx::RealValarray& agx::NlMixedCp::getSigns ( )
Returns
the signs, should be -1 for constraints +1 for bodies
const agx::RealValarray& agx::NlMixedCp::getSigns ( ) const
Returns
the signs, should be -1 for constraints +1 for bodies
agx::RealValarray& agx::NlMixedCp::getSolution ( )
Returns
the current solution
const agx::RealValarray& agx::NlMixedCp::getSolution ( ) const
Returns
the current solution
agx::SparseRangeReal& agx::NlMixedCp::getSparseBounds ( )
Returns
sparse bounds object used by the NLMCP
const agx::SparseRangeReal& agx::NlMixedCp::getSparseBounds ( ) const
Returns
sparse bounds object used by the NLMCP
template<typename T >
bool agx::Referenced::is ( ) const
inherited
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.

Referenced by agxData::Val< UInt >::Val().

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

virtual void agx::NlMixedCp::setSize ( agx::UInt  numEquations)
virtual

Set the size of the system.

Calling this method will clear all data.

virtual agx::UInt agx::NlMixedCp::solve ( agx::Bool  warm = false,
agx::StabilityReport *  stabilityReport = nullptr,
agx::INlSolveDataH5 *  nlSolveDataH5 = nullptr 
)
virtual

Solves the system, returns the total number of iterations made in the inner (mcp) loop.

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.

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.

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

Solver::NlMcpConfig agx::NlMixedCp::m_config
protected

Definition at line 443 of file MixedLCP.h.

agx::IndexSet agx::NlMixedCp::m_indexSet
protected

Definition at line 451 of file MixedLCP.h.

agx::SparseInverse agx::NlMixedCp::m_inv
protected

Definition at line 452 of file MixedLCP.h.

agx::SparseMatrix agx::NlMixedCp::m_matrix
protected

Definition at line 445 of file MixedLCP.h.

agx::UInt agx::NlMixedCp::m_maxNumOuterIterations
protected

Definition at line 453 of file MixedLCP.h.

agx::NlMixedCp::McpAlgorithmRef agx::NlMixedCp::m_mcp
protected

Definition at line 444 of file MixedLCP.h.

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

agx::Real agx::NlMixedCp::m_outerGlobalTolerance
protected

Definition at line 454 of file MixedLCP.h.

agx::RealValarray agx::NlMixedCp::m_q
protected

Definition at line 446 of file MixedLCP.h.

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.

agx::RealValarray agx::NlMixedCp::m_signs
protected

Definition at line 450 of file MixedLCP.h.

agx::SparseRangeReal agx::NlMixedCp::m_sparseBounds
protected

Definition at line 449 of file MixedLCP.h.

agx::RealValarray agx::NlMixedCp::m_z
protected

Definition at line 447 of file MixedLCP.h.

agx::RealValarray agx::NlMixedCp::m_z0
protected

Definition at line 448 of file MixedLCP.h.


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