AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
SparseTypes.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19#include <agx/Vector.h>
20#include <agx/NlmcpCallback.h>
21
22namespace agx
23{
25
30 {
31 struct Trace
32 {
33 enum Buffer
34 {
39 };
40
43 };
44
46 : IndexedRangeReal( idx,
47 rr,
49 {
50 }
51
53 : index( idx ),
54 range( rr ),
55 trace( trace )
56 {
57 }
58
62
63 private:
64 friend class Vector<IndexedRangeReal>;
67 RangeReal() )
68 {
69 }
70 };
71
73 class SparseRangeReal : public Vector<IndexedRangeReal>
74 {
75 public:
80
88 agx::Bool add( agx::NlmcpCallback* callback, agx::UInt localRow, agx::UInt numRows );
89
95 void beginNlAddScope( agx::UInt permutedMatrixRow, agx::UInt iterativeRow );
96
103
108
113
120
125 void sort();
126
131
132 public:
134 int save_hdf5(void *group, const agx::String & name) const;
136 int save_hdf5(const agx::String & filename , const agx::String & name) const;
138 int load_hdf5(void *group, const agx::String & name);
140 int load_hdf5(const agx::String & filename , const agx::String & name);
141
142 private:
143 struct NlAddScopeData
144 {
145 NlAddScopeData()
146 : directRow( agx::InvalidIndex ),
147 iterativeRow( agx::InvalidIndex ),
148 numCallbacks( agx::InvalidIndex )
149 {
150 }
151
152 agx::UInt directRow;
153 agx::UInt iterativeRow;
154 agx::UInt numCallbacks;
155 };
156
157 private:
158 agx::NlmcpCallbacks m_nlCallbacks;
159 NlAddScopeData m_nlAddScopeData;
160 };
161}
Interface class for solver callbacks.
Definition: NlmcpCallback.h:43
Essentially a sparse array of bounds.
Definition: SparseTypes.h:74
agx::UInt getScopePermutedMatrixRow() const
const NlmcpCallbacks & getCallbacks() const
void beginNlAddScope(agx::UInt permutedMatrixRow, agx::UInt iterativeRow)
Begin scope where NlmcpCallback instances are added given permuted matrix row.
int save_hdf5(void *group, const agx::String &name) const
write the array to an hdf5 stream, here disguised as the void * pointer
SparseRangeReal()
Default constructor.
agx::Bool add(agx::NlmcpCallback *callback, agx::UInt localRow, agx::UInt numRows)
Add nl-callback to receive callbacks during solves.
agx::UInt getScopeIterativeRow() const
agx::Bool isBoundedByNlCallback(agx::UInt row, agx::UInt searchDepth) const
void sort()
Sort given 'index' in IndexedRangeReal and updates indices of added nl-callbacks.
int load_hdf5(const agx::String &filename, const agx::String &name)
read the array to file in hdf5 format, with given name.
agx::UInt endNlAddScope()
End 'add new nl-callbacks' scope.
int save_hdf5(const agx::String &filename, const agx::String &name) const
write 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
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool Bool
Definition: Integer.h:40
uint64_t UInt
Definition: Integer.h:27
AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex
Data type to bind an index and ranges associated with it.
Definition: SparseTypes.h:30
IndexedRangeReal(agx::UInt idx, agx::RangeReal rr)
Definition: SparseTypes.h:45
agx::RangeReal range
Definition: SparseTypes.h:60
IndexedRangeReal(agx::UInt idx, agx::RangeReal rr, Trace trace)
Definition: SparseTypes.h:52