eigenlldb.EigenMatrixChildProvider Class Reference

Public Member Functions

def __init__ (self, valobj, internal_dict)
 
def num_children (self)
 
def get_child_index (self, name)
 
def get_child_at_index (self, index)
 

Private Member Functions

def _cols (self)
 
def _rows (self)
 

Private Attributes

 _valobj
 
 _scalar_type
 
 _scalar_size
 
 _rows_compile_time
 
 _cols_compile_time
 
 _row_major
 
 _fixed_storage
 

Constructor & Destructor Documentation

◆ __init__()

def eigenlldb.EigenMatrixChildProvider.__init__ (   self,
  valobj,
  internal_dict 
)
40  def __init__(self, valobj, internal_dict):
41  self._valobj = valobj
42  valtype = valobj.GetType().GetCanonicalType()
43 
44  scalar_type = valtype.GetTemplateArgumentType(0)
45  if not scalar_type.IsValid():
46  # In the case that scalar_type is invalid on LLDB 9.0 on Windows with CLion
47  storage = valobj.GetChildMemberWithName("m_storage")
48  data = storage.GetChildMemberWithName("m_data")
49  data_type = data.GetType()
50  if data_type.IsPointerType():
51  scalar_type = data.GetType().GetPointeeType()
52  else:
53  scalar_type = data.GetChildMemberWithName("array").GetType().GetArrayElementType()
54  self._scalar_type = scalar_type
55  self._scalar_size = self._scalar_type.GetByteSize()
56 
57  name = valtype.GetName()
58  template_begin = name.find("<")
59  template_end = name.find(">")
60  template_args = name[(template_begin + 1):template_end].split(",")
61  self._rows_compile_time = int(template_args[1])
62  self._cols_compile_time = int(template_args[2])
63  self._row_major = (int(template_args[3]) & 1) != 0
64 
65  max_rows = int(template_args[4])
66  max_cols = int(template_args[5])
67  self._fixed_storage = (max_rows != -1 and max_cols != -1)
68 
return int(ret)+1
void split(const DoubleVector &in_vector, Vector< DoubleVector * > &out_vector_pt)
Definition: double_vector.cc:1413

Member Function Documentation

◆ _cols()

def eigenlldb.EigenMatrixChildProvider._cols (   self)
private
98  def _cols(self):
99  if self._cols_compile_time == -1:
100  storage = self._valobj.GetChildMemberWithName("m_storage")
101  cols = storage.GetChildMemberWithName("m_cols")
102  return cols.GetValueAsUnsigned()
103  else:
104  return self._cols_compile_time
105 

References eigenlldb.EigenMatrixChildProvider._cols_compile_time, eigenlldb.EigenMatrixChildProvider._valobj, and eigenlldb.EigenSparseMatrixChildProvider._valobj.

Referenced by eigenlldb.EigenMatrixChildProvider.num_children().

◆ _rows()

def eigenlldb.EigenMatrixChildProvider._rows (   self)
private
106  def _rows(self):
107  if self._rows_compile_time == -1:
108  storage = self._valobj.GetChildMemberWithName("m_storage")
109  rows = storage.GetChildMemberWithName("m_rows")
110  return rows.GetValueAsUnsigned()
111  else:
112  return self._rows_compile_time
113 
114 

References eigenlldb.EigenMatrixChildProvider._rows_compile_time, eigenlldb.EigenMatrixChildProvider._valobj, and eigenlldb.EigenSparseMatrixChildProvider._valobj.

Referenced by eigenlldb.EigenMatrixChildProvider.num_children().

◆ get_child_at_index()

def eigenlldb.EigenMatrixChildProvider.get_child_at_index (   self,
  index 
)
75  def get_child_at_index(self, index):
76  storage = self._valobj.GetChildMemberWithName("m_storage")
77  data = storage.GetChildMemberWithName("m_data")
78  offset = self._scalar_size * index
79 
80  if self._row_major:
81  row = index // self._cols()
82  col = index % self._cols()
83  else:
84  row = index % self._rows()
85  col = index // self._rows()
86  if self._fixed_storage:
87  data = data.GetChildMemberWithName("array")
88  if self._cols() == 1:
89  name = '[{}]'.format(row)
90  elif self._rows() == 1:
91  name = '[{}]'.format(col)
92  else:
93  name = '[{},{}]'.format(row, col)
94  return data.CreateChildAtOffset(
95  name, offset, self._scalar_type
96  )
97 
std::string format(const std::string &str, const std::vector< std::string > &find, const std::vector< std::string > &replace)
Definition: openglsupport.cpp:217

◆ get_child_index()

def eigenlldb.EigenMatrixChildProvider.get_child_index (   self,
  name 
)
72  def get_child_index(self, name):
73  pass
74 

◆ num_children()

def eigenlldb.EigenMatrixChildProvider.num_children (   self)
69  def num_children(self):
70  return self._cols() * self._rows()
71 

References eigenlldb.EigenMatrixChildProvider._cols(), and eigenlldb.EigenMatrixChildProvider._rows().

Member Data Documentation

◆ _cols_compile_time

eigenlldb.EigenMatrixChildProvider._cols_compile_time
private

◆ _fixed_storage

eigenlldb.EigenMatrixChildProvider._fixed_storage
private

◆ _row_major

eigenlldb.EigenMatrixChildProvider._row_major
private

◆ _rows_compile_time

eigenlldb.EigenMatrixChildProvider._rows_compile_time
private

◆ _scalar_size

eigenlldb.EigenMatrixChildProvider._scalar_size
private

◆ _scalar_type

eigenlldb.EigenMatrixChildProvider._scalar_type
private

◆ _valobj


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