21 # pragma warning(push)
22 # pragma warning( disable: 4512 )
30 #include <agxSabre/DenseTypes.h>
43 template<
typename T >
48 RowAllocator() : m_elements( nullptr ), m_size( 0 ), m_counter( 0 ), m_currentElement( 0 ) {}
61 memset( m_elements, val, m_size *
sizeof( T ) );
70 bool mustDeallocate = size > m_size;
77 if (
m_size == 0 || !mustDeallocate )
return;
81 m_elements =
new T[
m_size ];
102 inline T*
get(
size_t numElements )
105 T* elementsStart = ( m_elements + m_currentElement );
106 m_currentElement += numElements;
108 return elementsStart;
111 inline size_t&
count() {
return m_counter; }
117 size_t m_currentElement;
129 enum IdxType { EQUALITY = -1, FREE = 0, LOWER = 2, UPPER = 4, IGNORE_INDEX = 8 };
131 IdxSet() : m_empty( true ) {}
140 void reset(
const SparseRangeReal& bounds,
size_t size );
147 void update(
const SparseRangeReal& bounds );
152 inline bool empty()
const {
return m_empty; }
164 inline size_t getNumBoundedEquations()
const {
return m_atBounds.size(); }
169 inline const UIntVector& getAtBoundsVector()
const {
return m_atBounds; }
174 inline const UIntVector& getAtBoundsLocalVector()
const {
return m_atBoundsLocal; }
176 inline IdxType& operator() (
size_t i )
179 return (IdxType&)m_ix[ i ];
182 inline IdxType operator() (
size_t i )
const
185 return (IdxType)m_ix[ i ];
255 Real computeResidual()
const;
270 size_t m_numIterations;
275 # pragma warning(pop)
#define AGXPHYSICS_EXPORT
Inheritance with partial specialization due to bug with ref_ptr containers.
size_t getIterations() const
int solve(bool warm=false)
Solves this mixed LCP.
MLCP(SparseMatrix &H, const RealValarray &q, RealValarray &z, const SparseRangeReal &bounds, const IntValarray &signs=IntValarray())
Class to allocate an array of elements where some other structure works on pointer.
void allocate(size_t size)
Allocate buffer of given size.
void allocate(size_t size, int val)
Allocate a buffer of given size with initial value val.
void deallocate()
Deallocates the buffer and resets internal parameters.
T * get(size_t numElements)
RowAllocator()
Constructor.
agx::SparseMatrix holds a matrix representation which contains the data.
Essentially a sparse array of bounds.
Vector containing 'raw' data.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
std::valarray< agx::Int > IntValarray
VectorPOD< UInt > UIntVector
HashTable< UInt, Real * > UIntRealPtrTable
std::valarray< agx::Real > RealValarray
For this module, vectors are defined using valarray.