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 ) {}
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 ];
206 int solve(
bool warm =
false );
255 Real computeResidual()
const;
270 size_t m_numIterations;
275 # pragma warning(pop)