AGX Dynamics  2.37.3.2
SparseTypes.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #include <agx/Vector.h>
20 #include <agx/NlmcpCallback.h>
21 
22 namespace 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>;
66  : IndexedRangeReal( agx::InvalidIndex,
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 
102  agx::UInt endNlAddScope();
103 
107  agx::UInt getScopePermutedMatrixRow() const;
108 
112  agx::UInt getScopeIterativeRow() const;
113 
119  agx::Bool isBoundedByNlCallback( agx::UInt row, agx::UInt searchDepth ) const;
120 
125  void sort();
126 
130  const NlmcpCallbacks& getCallbacks() const;
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 }
bool Bool
Definition: Integer.h:48
IndexedRangeReal(agx::UInt idx, agx::RangeReal rr, Trace trace)
Definition: SparseTypes.h:52
agx::RangeReal range
Definition: SparseTypes.h:60
AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex
IndexedRangeReal(agx::UInt idx, agx::RangeReal rr)
Definition: SparseTypes.h:45
Interface class for solver callbacks.
Definition: NlmcpCallback.h:42
Essentially a sparse array of bounds.
Definition: SparseTypes.h:73
uint32_t UInt
Definition: Integer.h:34
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Data type to bind an index and ranges associated with it.
Definition: SparseTypes.h:29