AGX Dynamics  2.35.0.1
LSquareComplianceMatrix.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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/Integer.h>
20 #include <agx/Real.h>
21 
22 namespace agx
23 {
28  {
29  public:
36  : m_data( data )
37  , m_size( size )
38  {
39  }
40 
46  inline Real& operator[]( UInt32 col )
47  {
48  agxAssert( col < m_size );
49  return m_data[ col ];
50  }
51 
57  inline Real operator[]( UInt32 col ) const
58  {
59  agxAssert( col < m_size );
60  return m_data[ col ];
61  }
62 
66  inline UInt32 size() const
67  {
68  return m_size;
69  }
70 
71  private:
72  Real* m_data;
73  UInt32 m_size;
74  };
75 
85  {
86  public:
94  : m_data( data )
95  , m_size( size )
96  , m_ld( ld )
97  {
98  }
99 
106  {
107  agxAssert( row < m_size );
108  return LSquareComplianceMatrixRow{ m_data + row * m_ld, row + 1u };
109  }
110 
114  inline UInt32 size() const { return m_size; }
115 
116  private:
117  Real* m_data;
118  UInt32 m_size;
119  UInt32 m_ld;
120  };
121 }
Interface to a row in the compliance matrix.
Real & operator[](UInt32 col)
Write access to value in given column.
LSquareComplianceMatrixRow(Real *data, UInt32 size)
Construct given row data and number of accessible columns.
Real operator[](UInt32 col) const
Read access to value in given column.
Interface to the lower triangle of the compliance matrix block in the system matrix.
LSquareComplianceMatrix(Real *data, UInt32 size, UInt32 ld)
Construct given data, number of rows/columns and leading dimension.
LSquareComplianceMatrixRow operator[](UInt32 row) const
Read/write access to given row number.
#define agxAssert(expr)
Definition: debug.h:143
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
uint32_t UInt32
Definition: Integer.h:40
double Real
Definition: Real.h:42