Skip to content

Commit cdea91e

Browse files
committed
core: change variable naming to pyArray
1 parent 92c3de2 commit cdea91e

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

include/eigenpy/details.hpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -279,27 +279,27 @@ namespace eigenpy
279279
struct EigenFromPy
280280
{
281281
/// \brief Determine if pyObj can be converted into a MatType object
282-
static void* convertible(PyArrayObject* pyObj)
282+
static void* convertible(PyArrayObject* pyArray)
283283
{
284-
if (!PyArray_Check(pyObj))
284+
if (!PyArray_Check(pyArray))
285285
return 0;
286286

287287
if(MatType::IsVectorAtCompileTime)
288288
{
289289
// Special care of scalar matrix of dimension 1x1.
290-
if(PyArray_DIMS(pyObj)[0] == 1 && PyArray_DIMS(pyObj)[1] == 1)
291-
return pyObj;
290+
if(PyArray_DIMS(pyArray)[0] == 1 && PyArray_DIMS(pyArray)[1] == 1)
291+
return pyArray;
292292

293-
if(PyArray_DIMS(pyObj)[0] > 1 && PyArray_DIMS(pyObj)[1] > 1)
293+
if(PyArray_DIMS(pyArray)[0] > 1 && PyArray_DIMS(pyArray)[1] > 1)
294294
{
295295
#ifndef NDEBUG
296296
std::cerr << "The number of dimension of the object does not correspond to a vector" << std::endl;
297297
#endif
298298
return 0;
299299
}
300300

301-
if(((PyArray_DIMS(pyObj)[0] == 1) && (MatType::ColsAtCompileTime == 1))
302-
|| ((PyArray_DIMS(pyObj)[1] == 1) && (MatType::RowsAtCompileTime == 1)))
301+
if(((PyArray_DIMS(pyArray)[0] == 1) && (MatType::ColsAtCompileTime == 1))
302+
|| ((PyArray_DIMS(pyArray)[1] == 1) && (MatType::RowsAtCompileTime == 1)))
303303
{
304304
#ifndef NDEBUG
305305
if(MatType::ColsAtCompileTime == 1)
@@ -311,9 +311,9 @@ namespace eigenpy
311311
}
312312
}
313313

314-
if (PyArray_NDIM(pyObj) != 2)
314+
if (PyArray_NDIM(pyArray) != 2)
315315
{
316-
if ( (PyArray_NDIM(pyObj) !=1) || (! MatType::IsVectorAtCompileTime) )
316+
if ( (PyArray_NDIM(pyArray) !=1) || (! MatType::IsVectorAtCompileTime) )
317317
{
318318
#ifndef NDEBUG
319319
std::cerr << "The number of dimension of the object is not correct." << std::endl;
@@ -322,10 +322,10 @@ namespace eigenpy
322322
}
323323
}
324324

325-
if (PyArray_NDIM(pyObj) == 2)
325+
if (PyArray_NDIM(pyArray) == 2)
326326
{
327-
const int R = (int)PyArray_DIMS(pyObj)[0];
328-
const int C = (int)PyArray_DIMS(pyObj)[1];
327+
const int R = (int)PyArray_DIMS(pyArray)[0];
328+
const int C = (int)PyArray_DIMS(pyArray)[1];
329329

330330
if( (MatType::RowsAtCompileTime!=R)
331331
&& (MatType::RowsAtCompileTime!=Eigen::Dynamic) )
@@ -336,7 +336,7 @@ namespace eigenpy
336336
}
337337

338338
// Check if the Scalar type of the obj_ptr is compatible with the Scalar type of MatType
339-
if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(pyObj), 0)) == NPY_INT)
339+
if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(pyArray), 0)) == NPY_INT)
340340
{
341341
if(!FromTypeToType<int,typename MatType::Scalar>::value)
342342
{
@@ -346,7 +346,7 @@ namespace eigenpy
346346
return 0;
347347
}
348348
}
349-
else if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(pyObj), 0)) == NPY_LONG)
349+
else if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(pyArray), 0)) == NPY_LONG)
350350
{
351351
if(!FromTypeToType<long,typename MatType::Scalar>::value)
352352
{
@@ -356,7 +356,7 @@ namespace eigenpy
356356
return 0;
357357
}
358358
}
359-
else if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(pyObj), 0)) == NPY_FLOAT)
359+
else if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(pyArray), 0)) == NPY_FLOAT)
360360
{
361361
if(!FromTypeToType<float,typename MatType::Scalar>::value)
362362
{
@@ -366,7 +366,7 @@ namespace eigenpy
366366
return 0;
367367
}
368368
}
369-
else if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(pyObj), 0)) == NPY_DOUBLE)
369+
else if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(pyArray), 0)) == NPY_DOUBLE)
370370
{
371371
if(!FromTypeToType<double,typename MatType::Scalar>::value)
372372
{
@@ -376,7 +376,7 @@ namespace eigenpy
376376
return 0;
377377
}
378378
}
379-
else if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(pyObj), 0))
379+
else if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(pyArray), 0))
380380
!= NumpyEquivalentType<typename MatType::Scalar>::type_code)
381381
{
382382
#ifndef NDEBUG
@@ -387,9 +387,9 @@ namespace eigenpy
387387
}
388388

389389
#ifdef NPY_1_8_API_VERSION
390-
if (!(PyArray_FLAGS(pyObj)))
390+
if (!(PyArray_FLAGS(pyArray)))
391391
#else
392-
if (!(PyArray_FLAGS(obj_ptr) & NPY_ALIGNED))
392+
if (!(PyArray_FLAGS(pyArray) & NPY_ALIGNED))
393393
#endif
394394
{
395395
#ifndef NDEBUG
@@ -398,7 +398,7 @@ namespace eigenpy
398398
return 0;
399399
}
400400

401-
return pyObj;
401+
return pyArray;
402402
}
403403

404404
/// \brief Allocate memory and copy pyObj in the new storage

0 commit comments

Comments
 (0)