AGX Dynamics 2.40.0.0
Loading...
Searching...
No Matches
agx::SparseRangeReal Class Reference

Essentially a sparse array of bounds. More...

#include <SparseTypes.h>

+ Inheritance diagram for agx::SparseRangeReal:

Public Member Functions

 SparseRangeReal ()
 Default constructor.
 
agx::Bool add (agx::NlmcpCallback *callback, agx::UInt localRow, agx::UInt numRows)
 Add nl-callback to receive callbacks during solves.
 
void beginNlAddScope (agx::UInt permutedMatrixRow, agx::UInt iterativeRow)
 Begin scope where NlmcpCallback instances are added given permuted matrix row.
 
agx::UInt endNlAddScope ()
 End 'add new nl-callbacks' scope.
 
const NlmcpCallbacksgetCallbacks () const
 
agx::UInt getScopeIterativeRow () const
 
agx::UInt getScopePermutedMatrixRow () const
 
agx::Bool isBoundedByNlCallback (agx::UInt row, agx::UInt searchDepth) const
 
int load_hdf5 (const agx::String &filename, const agx::String &name)
 read the array to file in hdf5 format, with given name.
 
int load_hdf5 (void *group, const agx::String &name)
 read the array from an hdf5 stream, here disguised as the void * pointer

 
int save_hdf5 (const agx::String &filename, const agx::String &name) const
 write the array to file in hdf5 format, with given name.
 
int save_hdf5 (void *group, const agx::String &name) const
 write the array to an hdf5 stream, here disguised as the void * pointer

 
void sort ()
 Sort given 'index' in IndexedRangeReal and updates indices of added nl-callbacks.
 
- Public Member Functions inherited from agx::Vector< IndexedRangeReal >
 Vector (const ByteAllocator &allocator=ByteAllocator())
 
 Vector (const Vector< IndexedRangeReal, ByteAllocator > &other)
 
 Vector (const_iterator first, const_iterator end, const ByteAllocator &allocator=ByteAllocator())
 
 Vector (size_t size, const IndexedRangeReal &value=IndexedRangeReal(), const ByteAllocator &allocator=ByteAllocator())
 
 Vector (std::initializer_list< IndexedRangeReal > values, const ByteAllocator &allocator=ByteAllocator())
 
 Vector (Vector< IndexedRangeReal, ByteAllocator > &&other)
 
 ~Vector ()
 
ByteAllocatorallocator ()
 
const ByteAllocatorallocator () const
 
IndexedRangeRealat (size_t index) const
 
IndexedRangeRealback () const
 
iterator begin ()
 
const_iterator begin () const
 
void clear (ClearPolicy policy=SHRINK_BUFFER_AVERAGED)
 Remove all elements, optionally with maintained buffer allocation.
 
bool contains (const IndexedRangeReal &element) const
 
bool contains (const T2 &element) const
 Test if the vector contains a certain element.
 
iterator end ()
 
const_iterator end () const
 
iterator erase (iterator position)
 STL erase functionality.
 
iterator erase (iterator start, iterator end)
 
void erase (size_t index)
 Erase elements using indices instead of iterators.
 
void erase (size_t start, size_t end)
 
iterator eraseFast (const_iterator position)
 Fast erase, replacing the erased element with the last element.
 
void eraseFast (size_t index)
 
size_t find (const T2 &element) const
 Find the index to a matching element, return size() if not found.
 
bool findAndErase (const T2 &element, bool searchMultiple=false)
 Find and erase an element.
 
IndexedRangeRealfront () const
 
IndexedRangeRealincrement (size_t numElements=1)
 Resize using a increment.
 
void insert (const_iterator it, InputIterator first, InputIterator last)
 
void insert (const_iterator it, std::initializer_list< IndexedRangeReal > ilist)
 
iterator insert (iterator position, const IndexedRangeReal &value)
 
void insert (size_t index, const IndexedRangeReal &value)
 
bool operator!= (const Vector< IndexedRangeReal, ByteAllocator > &other) const
 
Vector< IndexedRangeReal, ByteAllocator > & operator= (const Vector< IndexedRangeReal, ByteAllocator > &other)
 
bool operator== (const Vector< IndexedRangeReal, ByteAllocator > &other) const
 Compare with other vector, return true if same size and all pairs are equal.
 
IndexedRangeRealoperator[] (size_t i) const
 
void pop_back ()
 
IndexedRangeRealptr ()
 Get access to the internal data buffer.
 
const IndexedRangeRealptr () const
 
void push_back (const IndexedRangeReal &value)
 
void push_back (const T2 &value)
 
void push_back (IndexedRangeReal &&value)
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
void reserve (size_t size)
 Reserve capacity in the vector.
 
void reserveAtLeast (size_t size)
 Reserve capacity in the vector.
 
void resize (size_t size)
 Resize the vector, which then enables direct addressing using the bracket '[]' operator.
 
void resize (size_t size, const IndexedRangeReal &value)
 
void shrink_to_fit ()
 Reduce the capacity of the vector to the actual size (number of elements)
 
void swap (Vector &other)
 
- Public Member Functions inherited from agx::Container
size_t capacity () const
 Returns the size of the memory are used by the container to store its elements.
 
bool empty () const
 
void * ptr ()
 
const void * ptr () const
 
size_t size () const
 

Additional Inherited Members

- Public Types inherited from agx::Vector< IndexedRangeReal >
typedef const IndexedRangeRealconst_iterator
 
typedef const IndexedRangeRealconst_pointer
 
typedef const IndexedRangeRealconst_reference
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef ptrdiff_t difference_type
 
typedef IndexedRangeRealiterator
 
typedef std::random_access_iterator_tag iterator_category
 
typedef IndexedRangeRealpointer
 
typedef IndexedRangeRealreference
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef size_t size_type
 
typedef IndexedRangeReal Type
 
typedef IndexedRangeReal value_type
 
- Public Types inherited from agx::Container
enum  ClearPolicy { SHRINK_BUFFER , SHRINK_BUFFER_AVERAGED , MAINTAIN_BUFFER }
 agxData::Values from this enumeration is passed to the subclasses' 'clear' method in order to control what should become of the container's memory. More...
 
- Protected Member Functions inherited from agx::Container
 Container ()
 
 Container (const Container &other)
 
 Container (Container &&other)
 
 ~Container ()
 
- Protected Attributes inherited from agx::Container
void * m_buffer
 
size_t m_capacity
 
size_t m_size
 

Detailed Description

Essentially a sparse array of bounds.

Definition at line 73 of file SparseTypes.h.

Constructor & Destructor Documentation

◆ SparseRangeReal()

agx::SparseRangeReal::SparseRangeReal ( )

Default constructor.

Member Function Documentation

◆ add()

agx::Bool agx::SparseRangeReal::add ( agx::NlmcpCallback callback,
agx::UInt  localRow,
agx::UInt  numRows 
)

Add nl-callback to receive callbacks during solves.

Parameters
callback- callback
localRow- local start row of the non-linear bound
numRows- number of rows the nl-callback handles
Returns
true if added - otherwise false

◆ beginNlAddScope()

void agx::SparseRangeReal::beginNlAddScope ( agx::UInt  permutedMatrixRow,
agx::UInt  iterativeRow 
)

Begin scope where NlmcpCallback instances are added given permuted matrix row.

When a new callback is added the local row is given which will be an offset of permutedMatrixRow.

◆ endNlAddScope()

agx::UInt agx::SparseRangeReal::endNlAddScope ( )

End 'add new nl-callbacks' scope.

It's not valid to add callbacks after calling this method.

Returns
number of added callbacks

◆ getCallbacks()

const NlmcpCallbacks & agx::SparseRangeReal::getCallbacks ( ) const
Returns
the added nl-callbacks

◆ getScopeIterativeRow()

agx::UInt agx::SparseRangeReal::getScopeIterativeRow ( ) const
Returns
current scope iterative start row - if not in a scope, InvalidIndex is returned.

◆ getScopePermutedMatrixRow()

agx::UInt agx::SparseRangeReal::getScopePermutedMatrixRow ( ) const
Returns
current scope permuted matrix start row - if not in a scope, InvalidIndex is returned.

◆ isBoundedByNlCallback()

agx::Bool agx::SparseRangeReal::isBoundedByNlCallback ( agx::UInt  row,
agx::UInt  searchDepth 
) const
Parameters
row- permuted matrix row
searchDepth- number of callbacks to check from back of array
Returns
true if the given row is bounded by a nl-callback - otherwise false

◆ load_hdf5() [1/2]

int agx::SparseRangeReal::load_hdf5 ( const agx::String filename,
const agx::String name 
)

read the array to file in hdf5 format, with given name.

◆ load_hdf5() [2/2]

int agx::SparseRangeReal::load_hdf5 ( void *  group,
const agx::String name 
)

read the array from an hdf5 stream, here disguised as the void * pointer

◆ save_hdf5() [1/2]

int agx::SparseRangeReal::save_hdf5 ( const agx::String filename,
const agx::String name 
) const

write the array to file in hdf5 format, with given name.

◆ save_hdf5() [2/2]

int agx::SparseRangeReal::save_hdf5 ( void *  group,
const agx::String name 
) const

write the array to an hdf5 stream, here disguised as the void * pointer

◆ sort()

void agx::SparseRangeReal::sort ( )

Sort given 'index' in IndexedRangeReal and updates indices of added nl-callbacks.


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