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

Essentially a sparse array of bounds. More...

#include <SparseTypes.h>

+ Inheritance diagram for agx::SparseRangeReal:

Public Types

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...
 
typedef const IndexedRangeReal * const_iterator
 
typedef const IndexedRangeReal * const_pointer
 
typedef const IndexedRangeReal & const_reference
 
typedef std::reverse_iterator
< const_iterator > 
const_reverse_iterator
 
typedef ptrdiff_t difference_type
 
typedef IndexedRangeReal * iterator
 
typedef
std::random_access_iterator_tag 
iterator_category
 
typedef IndexedRangeReal * pointer
 
typedef IndexedRangeReal & reference
 
typedef std::reverse_iterator
< iterator > 
reverse_iterator
 
typedef size_t size_type
 
typedef IndexedRangeReal Type
 
typedef IndexedRangeReal value_type
 

Public Member Functions

 SparseRangeReal ()
 Default constructor. More...
 
agx::Bool add (agx::NlmcpCallback *callback, agx::UInt localRow, agx::UInt numRows)
 Add nl-callback to receive callbacks during solves. More...
 
ByteAllocator & allocator ()
 
const ByteAllocator & allocator () const
 
IndexedRangeReal & at (size_t index) const
 
IndexedRangeReal & back () const
 
iterator begin ()
 
const_iterator begin () const
 
void beginNlAddScope (agx::UInt permutedMatrixRow, agx::UInt iterativeRow)
 Begin scope where NlmcpCallback instances are added given permuted matrix row. More...
 
size_t capacity () const
 Returns the size of the memory are used by the container to store its elements. More...
 
void clear (ClearPolicy policy=SHRINK_BUFFER_AVERAGED)
 Remove all elements, optionally with maintained buffer allocation. More...
 
bool contains (const T2 &element) const
 Test if the vector contains a certain element. More...
 
bool contains (const IndexedRangeReal &element) const
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
agx::UInt endNlAddScope ()
 End 'add new nl-callbacks' scope. More...
 
iterator erase (iterator position)
 STL erase functionality. More...
 
iterator erase (iterator start, iterator end)
 
void erase (size_t index)
 Erase elements using indices instead of iterators. More...
 
void erase (size_t start, size_t end)
 
iterator eraseFast (const_iterator position)
 Fast erase, replacing the erased element with the last element. More...
 
void eraseFast (size_t index)
 
size_t find (const T2 &element) const
 Find the index to a matching element, return size() if not found. More...
 
bool findAndErase (const T2 &element, bool searchMultiple=false)
 Find and erase an element. More...
 
IndexedRangeReal & front () const
 
const NlmcpCallbacks & getCallbacks () const
 
agx::UInt getScopeIterativeRow () const
 
agx::UInt getScopePermutedMatrixRow () const
 
IndexedRangeReal * increment (size_t numElements=1)
 Resize using a increment. More...
 
iterator insert (iterator position, const IndexedRangeReal &value)
 
void insert (size_t index, const IndexedRangeReal &value)
 
void insert (const_iterator it, InputIterator first, InputIterator last)
 
void insert (const_iterator it, std::initializer_list< IndexedRangeReal > ilist)
 
agx::Bool isBoundedByNlCallback (agx::UInt row, agx::UInt searchDepth) const
 
int load_hdf5 (void *group, const agx::String &name)
 read the array from an hdf5 stream, here disguised as the void * pointer More...
 
int load_hdf5 (const agx::String &filename, const agx::String &name)
 read the array to file in hdf5 format, with given name. More...
 
bool operator!= (const Vector< IndexedRangeReal, ByteAllocator > &other) const
 
bool operator== (const Vector< IndexedRangeReal, ByteAllocator > &other) const
 Compare with other vector, return true if same size and all pairs are equal. More...
 
IndexedRangeReal & operator[] (size_t i) const
 
void pop_back ()
 
IndexedRangeReal * ptr ()
 Get access to the internal data buffer. More...
 
const IndexedRangeReal * ptr () const
 
void push_back (const T2 &value)
 
void push_back (const IndexedRangeReal &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. More...
 
void reserveAtLeast (size_t size)
 Reserve capacity in the vector. More...
 
void resize (size_t size)
 Resize the vector, which then enables direct addressing using the bracket '[]' operator. More...
 
void resize (size_t size, const IndexedRangeReal &value)
 
int save_hdf5 (void *group, const agx::String &name) const
 write the array to an hdf5 stream, here disguised as the void * pointer More...
 
int save_hdf5 (const agx::String &filename, const agx::String &name) const
 write the array to file in hdf5 format, with given name. More...
 
void shrink_to_fit ()
 Reduce the capacity of the vector to the actual size (number of elements) More...
 
size_t size () const
 
void sort ()
 Sort given 'index' in IndexedRangeReal and updates indices of added nl-callbacks. More...
 
void swap (Vector &other)
 

Protected Attributes

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.

Member Typedef Documentation

Definition at line 63 of file Vector.h.

Definition at line 58 of file Vector.h.

Definition at line 60 of file Vector.h.

typedef std::reverse_iterator<const_iterator> agx::Vector< IndexedRangeReal , ByteAllocator >::const_reverse_iterator
inherited

Definition at line 138 of file Vector.h.

typedef ptrdiff_t agx::Vector< IndexedRangeReal , ByteAllocator >::difference_type
inherited

Definition at line 65 of file Vector.h.

Definition at line 62 of file Vector.h.

typedef std::random_access_iterator_tag agx::Vector< IndexedRangeReal , ByteAllocator >::iterator_category
inherited

Definition at line 64 of file Vector.h.

Definition at line 57 of file Vector.h.

Definition at line 59 of file Vector.h.

typedef std::reverse_iterator<iterator> agx::Vector< IndexedRangeReal , ByteAllocator >::reverse_iterator
inherited

Definition at line 137 of file Vector.h.

typedef size_t agx::Vector< IndexedRangeReal , ByteAllocator >::size_type
inherited

Definition at line 61 of file Vector.h.

Definition at line 55 of file Vector.h.

Definition at line 56 of file Vector.h.

Member Enumeration Documentation

agxData::Values from this enumeration is passed to the subclasses' 'clear' method in order to control what should become of the container's memory.

Enumerator
SHRINK_BUFFER 

Buffer is deallocated and replaced by an newly allocated empty buffer.

SHRINK_BUFFER_AVERAGED 

Buffer is shrunk if a smoothing average (which is updated each clear call) goes below a threshold.

MAINTAIN_BUFFER 

Buffer is maintained (normal stl behavior).

Definition at line 42 of file Container.h.

Constructor & Destructor Documentation

agx::SparseRangeReal::SparseRangeReal ( )

Default constructor.

Member Function Documentation

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
ByteAllocator & agx::Vector< IndexedRangeReal , ByteAllocator >::allocator ( )
inherited
const ByteAllocator & agx::Vector< IndexedRangeReal , ByteAllocator >::allocator ( ) const
inherited
IndexedRangeReal & agx::Vector< IndexedRangeReal , ByteAllocator >::at ( size_t  index) const
inherited
IndexedRangeReal & agx::Vector< IndexedRangeReal , ByteAllocator >::back ( ) const
inherited
const_iterator agx::Vector< IndexedRangeReal , ByteAllocator >::begin ( ) const
inherited
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.

size_t agx::Container::capacity ( ) const
inherited

Returns the size of the memory are used by the container to store its elements.

Some types of containers, e.g. the agx::Vector, will not do a reallocation until the size of the container reaches the capacity. However, this is not the case for e.g., agx::HashTable, which may perform a reallocation earlier.

Returns
The size of the allocated memory area, in number of elements.

Definition at line 135 of file Container.h.

References agx::Container::m_capacity.

Referenced by agx::Vector< T, Allocator >::operator=().

Remove all elements, optionally with maintained buffer allocation.

bool agx::Vector< IndexedRangeReal , ByteAllocator >::contains ( const T2 &  element) const
inherited

Test if the vector contains a certain element.

bool agx::Vector< IndexedRangeReal , ByteAllocator >::contains ( const IndexedRangeReal &  element) const
inherited
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
iterator agx::Vector< IndexedRangeReal , ByteAllocator >::erase ( iterator  position)
inherited

STL erase functionality.

iterator agx::Vector< IndexedRangeReal , ByteAllocator >::erase ( iterator  start,
iterator  end 
)
inherited
void agx::Vector< IndexedRangeReal , ByteAllocator >::erase ( size_t  index)
inherited

Erase elements using indices instead of iterators.

void agx::Vector< IndexedRangeReal , ByteAllocator >::erase ( size_t  start,
size_t  end 
)
inherited
iterator agx::Vector< IndexedRangeReal , ByteAllocator >::eraseFast ( const_iterator  position)
inherited

Fast erase, replacing the erased element with the last element.

void agx::Vector< IndexedRangeReal , ByteAllocator >::eraseFast ( size_t  index)
inherited
size_t agx::Vector< IndexedRangeReal , ByteAllocator >::find ( const T2 &  element) const
inherited

Find the index to a matching element, return size() if not found.

bool agx::Vector< IndexedRangeReal , ByteAllocator >::findAndErase ( const T2 &  element,
bool  searchMultiple = false 
)
inherited

Find and erase an element.

Parameters
element- Element to search for
searchMultipleSet to true if search should continue after element is found, otherwise the search terminates on first match.
Returns
true if the element was found, else false
IndexedRangeReal & agx::Vector< IndexedRangeReal , ByteAllocator >::front ( ) const
inherited
const NlmcpCallbacks& agx::SparseRangeReal::getCallbacks ( ) const
Returns
the added nl-callbacks
agx::UInt agx::SparseRangeReal::getScopeIterativeRow ( ) const
Returns
current scope iterative start row - if not in a scope, InvalidIndex is returned.
agx::UInt agx::SparseRangeReal::getScopePermutedMatrixRow ( ) const
Returns
current scope permuted matrix start row - if not in a scope, InvalidIndex is returned.
IndexedRangeReal * agx::Vector< IndexedRangeReal , ByteAllocator >::increment ( size_t  numElements = 1)
inherited

Resize using a increment.

iterator agx::Vector< IndexedRangeReal , ByteAllocator >::insert ( iterator  position,
const IndexedRangeReal &  value 
)
inherited
void agx::Vector< IndexedRangeReal , ByteAllocator >::insert ( size_t  index,
const IndexedRangeReal &  value 
)
inherited
void agx::Vector< IndexedRangeReal , ByteAllocator >::insert ( const_iterator  it,
InputIterator  first,
InputIterator  last 
)
inherited
void agx::Vector< IndexedRangeReal , ByteAllocator >::insert ( const_iterator  it,
std::initializer_list< IndexedRangeReal >  ilist 
)
inherited
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
int agx::SparseRangeReal::load_hdf5 ( void *  group,
const agx::String &  name 
)

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

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

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

bool agx::Vector< IndexedRangeReal , ByteAllocator >::operator!= ( const Vector< IndexedRangeReal , ByteAllocator > &  other) const
inherited
bool agx::Vector< IndexedRangeReal , ByteAllocator >::operator== ( const Vector< IndexedRangeReal , ByteAllocator > &  other) const
inherited

Compare with other vector, return true if same size and all pairs are equal.

IndexedRangeReal & agx::Vector< IndexedRangeReal , ByteAllocator >::operator[] ( size_t  i) const
inherited
void agx::Vector< IndexedRangeReal , ByteAllocator >::pop_back ( )
inherited

Get access to the internal data buffer.

const IndexedRangeReal * agx::Vector< IndexedRangeReal , ByteAllocator >::ptr ( ) const
inherited
void agx::Vector< IndexedRangeReal , ByteAllocator >::push_back ( const T2 &  value)
inherited
void agx::Vector< IndexedRangeReal , ByteAllocator >::push_back ( const IndexedRangeReal &  value)
inherited
void agx::Vector< IndexedRangeReal , ByteAllocator >::push_back ( IndexedRangeReal &&  value)
inherited
void agx::Vector< IndexedRangeReal , ByteAllocator >::reserve ( size_t  size)
inherited

Reserve capacity in the vector.

void agx::Vector< IndexedRangeReal , ByteAllocator >::reserveAtLeast ( size_t  size)
inherited

Reserve capacity in the vector.

Let vector grow in same way as push_back() does.

void agx::Vector< IndexedRangeReal , ByteAllocator >::resize ( size_t  size)
inherited

Resize the vector, which then enables direct addressing using the bracket '[]' operator.

void agx::Vector< IndexedRangeReal , ByteAllocator >::resize ( size_t  size,
const IndexedRangeReal &  value 
)
inherited
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

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.

void agx::Vector< IndexedRangeReal , ByteAllocator >::shrink_to_fit ( )
inherited

Reduce the capacity of the vector to the actual size (number of elements)

size_t agx::Container::size ( ) const
inherited
Returns
The number of elements in the container.

Definition at line 134 of file Container.h.

References agx::Container::m_size.

Referenced by agxCollide::GroupFooCollider< ShapeType >::_calculateContacts(), agxData::Array< T >::Array(), agx::HashVector< agx::UInt32, agx::ref_ptr< RenderProxy > >::back(), agx::SetVector< const agxPowerLine::Unit * >::back(), agx::WireContactConstraint::calculateD(), agx::WireContactConstraint::calculateRHS(), agx::GlobalResult::Transaction::commit(), agxData::BufferT< T >::commit(), agxSDK::copyVectors(), agx::createMissingTiers(), agxCollide::Space::disableForContacts(), agxSDK::LinkedSegmentIterator< T >::end(), agx::ConstraintImplementation::findSecondaryConstraintGivenType(), agxSDK::MergeSplitThresholds::get(), agx::WireContactConstraint::getForceOnParticle(), agxSDK::MultiCollisionFilterContactHandler::getGeometryContact(), agxModel::HeightController::getHeight(), agx::WireContactConstraint::getInvMass(), agx::WireContactConstraint::getJacobian(), agx::WireContactConstraint::getMass(), agx::ConstraintImplementation::BodyView::getNumBodies(), agxSDK::LinkedStructure::getNumSegments(), agxIO::MeshReader::getNumTriangles(), agxSDK::MergeSplitThresholds::getNumValues(), agxSDK::LinkedStructure::getSegment(), agxSDK::CollisionGroupFilter::hasMemberGroup(), agxSDK::CollisionGroupFilter::match(), agx::Vector< T, Allocator >::operator!=(), agx::VectorPOD< T, Allocator >::operator!=(), agx::Vector< T, Allocator >::operator=(), agx::HashSetImplementation< CellPtr, HashFn< CellPtr >, ByteAllocator >::operator=(), agx::QuadraticProbingHashTableImplementation< SymmetricMaterialPair, agx::ContactMaterialRef, HashFn< SymmetricMaterialPair >, ByteAllocator >::operator=(), agx::VectorPOD< T, Allocator >::operator=(), agx::Vector< T, Allocator >::operator==(), agx::VectorPOD< T, Allocator >::operator==(), agx::HashVector< agx::UInt32, agx::ref_ptr< RenderProxy > >::operator[](), agx::SetVector< const agxPowerLine::Unit * >::operator[](), agxOSG::RenderStateManager::parseUniform(), agx::HashVector< agx::UInt32, agx::ref_ptr< RenderProxy > >::purge(), agx::SetVector< const agxPowerLine::Unit * >::purge(), agx::HashVector< agx::UInt32, agx::ref_ptr< RenderProxy > >::push_back(), agx::SetVector< const agxPowerLine::Unit * >::push_back(), agxIO::ArgumentParser::read1(), agxIO::ArgumentParser::read2(), agxIO::ArgumentParser::read3(), agx::HashSetImplementation< CellPtr, HashFn< CellPtr >, ByteAllocator >::rebuild(), agx::QuadraticProbingHashTableImplementation< SymmetricMaterialPair, agx::ContactMaterialRef, HashFn< SymmetricMaterialPair >, ByteAllocator >::rebuild(), agxRender::HeightFieldProxy::setHeights(), agxUtil::ConvexHull2D::size(), agx::HashVector< agx::UInt32, agx::ref_ptr< RenderProxy > >::size(), agx::SetVector< const agxPowerLine::Unit * >::size(), agxVehicle::utils::splitNonconsecutive(), agxWire::transformPointToShape(), agxWire::transformPointToWorld(), agxWire::transformVectorToShape(), agxWire::transformVectorToWorld(), agxModel::triangleIterator(), agx::Event::trigger(), and agxStream::StoreObjects< T >::~StoreObjects().

void agx::SparseRangeReal::sort ( )

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

void agx::Vector< IndexedRangeReal , ByteAllocator >::swap ( Vector< IndexedRangeReal > &  other)
inherited

Member Data Documentation


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