21 # pragma warning(push) 22 # pragma warning( disable: 4512 ) // Disable warning about assignment operator could not be generated due to reference members. 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 ) {}
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 ];
206 int solve(
bool warm =
false );
255 Real computeResidual()
const;
265 UIntRealPtrTable m_boundSolution;
270 size_t m_numIterations;
275 # pragma warning(pop) void allocate(size_t size)
Allocate buffer of given size.
std::valarray< agx::Int > IntValarray
#define AGXPHYSICS_EXPORT
Essentially a sparse array of bounds.
Vector containing 'raw' data.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
void deallocate()
Deallocates the buffer and resets internal parameters.
std::valarray< agx::Real > RealValarray
For this module, vectors are defined using valarray.
RowAllocator()
Constructor.
HashTable< UInt, Real *> UIntRealPtrTable
void allocate(size_t size, int val)
Allocate a buffer of given size with initial value val.
Inheritance with partial specialization due to bug with ref_ptr containers.
agx::SparseMatrix holds a matrix representation which contains the data.
size_t getIterations() const
Class to allocate an array of elements where some other structure works on pointer.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()