MCPcopy Create free account
hub / github.com/ImageEngine/cortex / convertRowIndex

Function convertRowIndex

src/IECorePython/ObjectMatrixBinding.cpp:117–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117size_t convertRowIndex( const ObjectMatrix &m, tuple index )
118{
119 int64_t row = extract<int64_t>( index[0] );
120 if( row < 0 )
121 {
122 row += m.numRows();
123 }
124 if( row >= (int64_t)m.numRows() || row < 0 )
125 {
126 PyErr_SetString( PyExc_IndexError, "Index out of range" );
127 throw_error_already_set();
128 }
129 return row;
130}
131
132size_t convertColumnIndex( const ObjectMatrix &m, tuple index )
133{

Callers 2

getItemFunction · 0.85
setItemFunction · 0.85

Calls 1

numRowsMethod · 0.80

Tested by

no test coverage detected