cisst-saw
Loading...
Searching...
No Matches
vctPythonUtilities.h File Reference
#include <Python.h>
#include <numpy/numpyconfig.h>
#include <numpy/arrayobject.h>
#include <typeinfo>
#include <cisstConfig.h>
#include <cisstCommon/cmnAssert.h>
#include <cisstCommon/cmnPortability.h>
#include <cisstVector/vctFixedSizeConstVectorBase.h>
#include <cisstVector/vctDynamicConstVectorBase.h>
#include <cisstVector/vctFixedSizeConstMatrixBase.h>
#include <cisstVector/vctDynamicConstMatrixBase.h>
#include <cisstVector/vctDynamicConstNArrayBase.h>
#include <cisstVector/vctTransformationTypes.h>

Go to the source code of this file.

Macros

#define NPY_NO_DEPRECATED_API   NPY_1_7_API_VERSION
#define cast_array(A)
#define PyArray_REFCOUNT(obj)

Functions

bool vctThrowUnlessIsPyArray (PyObject *input)
template<class _elementType>
bool vctThrowUnlessIsSameTypeArray (PyObject *CMN_UNUSED(input))
template<>
bool vctThrowUnlessIsSameTypeArray< bool > (PyObject *input)
template<>
bool vctThrowUnlessIsSameTypeArray< char > (PyObject *input)
template<>
bool vctThrowUnlessIsSameTypeArray< unsigned char > (PyObject *input)
template<>
bool vctThrowUnlessIsSameTypeArray< short > (PyObject *input)
template<>
bool vctThrowUnlessIsSameTypeArray< unsigned short > (PyObject *input)
template<>
bool vctThrowUnlessIsSameTypeArray< int > (PyObject *input)
template<>
bool vctThrowUnlessIsSameTypeArray< unsigned int > (PyObject *input)
template<>
bool vctThrowUnlessIsSameTypeArray< long int > (PyObject *input)
template<>
bool vctThrowUnlessIsSameTypeArray< unsigned long int > (PyObject *input)
template<>
bool vctThrowUnlessIsSameTypeArray< float > (PyObject *input)
template<>
bool vctThrowUnlessIsSameTypeArray< double > (PyObject *input)
template<class _elementType>
int vctPythonType (void)
template<>
int vctPythonType< bool > (void)
template<>
int vctPythonType< char > (void)
template<>
int vctPythonType< unsigned char > (void)
template<>
int vctPythonType< short > (void)
template<>
int vctPythonType< unsigned short > (void)
template<>
int vctPythonType< int > (void)
template<>
int vctPythonType< unsigned int > (void)
template<>
int vctPythonType< long int > (void)
template<>
int vctPythonType< unsigned long int > (void)
template<>
int vctPythonType< double > (void)
bool vctThrowUnlessDimension1 (PyArrayObject *input)
bool vctThrowUnlessDimension2 (PyArrayObject *input)
template<vct::size_type _dimension>
bool vctThrowUnlessDimensionN (PyArrayObject *input)
bool vctThrowUnlessIsWritable (PyArrayObject *input)
template<vct::size_type _size, vct::stride_type _stride, class _elementType, class _dataPtrType>
bool vctThrowUnlessCorrectVectorSize (PyArrayObject *input, const vctFixedSizeConstVectorBase< _size, _stride, _elementType, _dataPtrType > &target)
template<class _vectorOwnerType, typename _elementType>
bool vctThrowUnlessCorrectVectorSize (PyArrayObject *CMN_UNUSED(input), const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &CMN_UNUSED(target))
template<vct::size_type _rows, vct::size_type _cols, vct::stride_type _rowStride, vct::stride_type _colStride, class _elementType, class _dataPtrType>
bool vctThrowUnlessCorrectMatrixSize (PyArrayObject *input, const vctFixedSizeConstMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > &target)
template<class _matrixOwnerType, typename _elementType>
bool vctThrowUnlessCorrectMatrixSize (PyArrayObject *CMN_UNUSED(input), const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &CMN_UNUSED(target))
bool vctThrowUnlessOwnsData (PyArrayObject *input)
template<vct::size_type _size, vct::stride_type _stride, class _elementType, class _dataPtrType>
bool vctThrowUnlessOwnsData (PyArrayObject *CMN_UNUSED(input), const vctFixedSizeConstVectorBase< _size, _stride, _elementType, _dataPtrType > &CMN_UNUSED(target))
template<class _vectorOwnerType, typename _elementType>
bool vctThrowUnlessOwnsData (PyArrayObject *input, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &CMN_UNUSED(target))
template<vct::size_type _rows, vct::size_type _cols, vct::stride_type _rowStride, vct::stride_type _colStride, class _elementType, class _dataPtrType>
bool vctThrowUnlessOwnsData (PyArrayObject *CMN_UNUSED(input), const vctFixedSizeConstMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > &CMN_UNUSED(target))
template<class _matrixOwnerType, typename _elementType>
bool vctThrowUnlessOwnsData (PyArrayObject *input, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &CMN_UNUSED(target))
bool vctThrowUnlessNotReferenced (PyObject *input)
template<vct::size_type _size, vct::stride_type _stride, class _elementType, class _dataPtrType>
bool vctThrowUnlessNotReferenced (PyObject *CMN_UNUSED(input), const vctFixedSizeConstVectorBase< _size, _stride, _elementType, _dataPtrType > &CMN_UNUSED(target))
template<class _vectorOwnerType, typename _elementType>
bool vctThrowUnlessNotReferenced (PyObject *input, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &CMN_UNUSED(target))
template<vct::size_type _rows, vct::size_type _cols, vct::stride_type _rowStride, vct::stride_type _colStride, class _elementType, class _dataPtrType>
bool vctThrowUnlessNotReferenced (PyObject *CMN_UNUSED(input), const vctFixedSizeConstMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > &CMN_UNUSED(target))
template<class _matrixOwnerType, typename _elementType>
bool vctThrowUnlessNotReferenced (PyObject *input, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &CMN_UNUSED(target))

Macro Definition Documentation

◆ cast_array

#define cast_array ( A)
Value:
reinterpret_cast<PyArrayObject *>(A)

◆ NPY_NO_DEPRECATED_API

#define NPY_NO_DEPRECATED_API   NPY_1_7_API_VERSION

◆ PyArray_REFCOUNT

#define PyArray_REFCOUNT ( obj)
Value:
Py_REFCNT(obj)

Function Documentation

◆ vctPythonType()

template<class _elementType>
int vctPythonType ( void )

◆ vctPythonType< bool >()

template<>
int vctPythonType< bool > ( void )

◆ vctPythonType< char >()

template<>
int vctPythonType< char > ( void )

◆ vctPythonType< double >()

template<>
int vctPythonType< double > ( void )

◆ vctPythonType< int >()

template<>
int vctPythonType< int > ( void )

◆ vctPythonType< long int >()

template<>
int vctPythonType< long int > ( void )

◆ vctPythonType< short >()

template<>
int vctPythonType< short > ( void )

◆ vctPythonType< unsigned char >()

template<>
int vctPythonType< unsigned char > ( void )

◆ vctPythonType< unsigned int >()

template<>
int vctPythonType< unsigned int > ( void )

◆ vctPythonType< unsigned long int >()

template<>
int vctPythonType< unsigned long int > ( void )

◆ vctPythonType< unsigned short >()

template<>
int vctPythonType< unsigned short > ( void )

◆ vctThrowUnlessCorrectMatrixSize() [1/2]

template<class _matrixOwnerType, typename _elementType>
bool vctThrowUnlessCorrectMatrixSize ( PyArrayObject * CMN_UNUSEDinput,
const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > & CMN_UNUSEDtarget )

◆ vctThrowUnlessCorrectMatrixSize() [2/2]

template<vct::size_type _rows, vct::size_type _cols, vct::stride_type _rowStride, vct::stride_type _colStride, class _elementType, class _dataPtrType>
bool vctThrowUnlessCorrectMatrixSize ( PyArrayObject * input,
const vctFixedSizeConstMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > & target )

◆ vctThrowUnlessCorrectVectorSize() [1/2]

template<class _vectorOwnerType, typename _elementType>
bool vctThrowUnlessCorrectVectorSize ( PyArrayObject * CMN_UNUSEDinput,
const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > & CMN_UNUSEDtarget )

◆ vctThrowUnlessCorrectVectorSize() [2/2]

template<vct::size_type _size, vct::stride_type _stride, class _elementType, class _dataPtrType>
bool vctThrowUnlessCorrectVectorSize ( PyArrayObject * input,
const vctFixedSizeConstVectorBase< _size, _stride, _elementType, _dataPtrType > & target )

◆ vctThrowUnlessDimension1()

bool vctThrowUnlessDimension1 ( PyArrayObject * input)

◆ vctThrowUnlessDimension2()

bool vctThrowUnlessDimension2 ( PyArrayObject * input)

◆ vctThrowUnlessDimensionN()

template<vct::size_type _dimension>
bool vctThrowUnlessDimensionN ( PyArrayObject * input)

◆ vctThrowUnlessIsPyArray()

bool vctThrowUnlessIsPyArray ( PyObject * input)

◆ vctThrowUnlessIsSameTypeArray()

template<class _elementType>
bool vctThrowUnlessIsSameTypeArray ( PyObject * CMN_UNUSEDinput)

◆ vctThrowUnlessIsSameTypeArray< bool >()

template<>
bool vctThrowUnlessIsSameTypeArray< bool > ( PyObject * input)

◆ vctThrowUnlessIsSameTypeArray< char >()

template<>
bool vctThrowUnlessIsSameTypeArray< char > ( PyObject * input)

◆ vctThrowUnlessIsSameTypeArray< double >()

template<>
bool vctThrowUnlessIsSameTypeArray< double > ( PyObject * input)

◆ vctThrowUnlessIsSameTypeArray< float >()

template<>
bool vctThrowUnlessIsSameTypeArray< float > ( PyObject * input)

◆ vctThrowUnlessIsSameTypeArray< int >()

template<>
bool vctThrowUnlessIsSameTypeArray< int > ( PyObject * input)

◆ vctThrowUnlessIsSameTypeArray< long int >()

template<>
bool vctThrowUnlessIsSameTypeArray< long int > ( PyObject * input)

◆ vctThrowUnlessIsSameTypeArray< short >()

template<>
bool vctThrowUnlessIsSameTypeArray< short > ( PyObject * input)

◆ vctThrowUnlessIsSameTypeArray< unsigned char >()

template<>
bool vctThrowUnlessIsSameTypeArray< unsigned char > ( PyObject * input)

◆ vctThrowUnlessIsSameTypeArray< unsigned int >()

template<>
bool vctThrowUnlessIsSameTypeArray< unsigned int > ( PyObject * input)

◆ vctThrowUnlessIsSameTypeArray< unsigned long int >()

template<>
bool vctThrowUnlessIsSameTypeArray< unsigned long int > ( PyObject * input)

◆ vctThrowUnlessIsSameTypeArray< unsigned short >()

template<>
bool vctThrowUnlessIsSameTypeArray< unsigned short > ( PyObject * input)

◆ vctThrowUnlessIsWritable()

bool vctThrowUnlessIsWritable ( PyArrayObject * input)

◆ vctThrowUnlessNotReferenced() [1/5]

template<vct::size_type _rows, vct::size_type _cols, vct::stride_type _rowStride, vct::stride_type _colStride, class _elementType, class _dataPtrType>
bool vctThrowUnlessNotReferenced ( PyObject * CMN_UNUSEDinput,
const vctFixedSizeConstMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > & CMN_UNUSEDtarget )

◆ vctThrowUnlessNotReferenced() [2/5]

template<vct::size_type _size, vct::stride_type _stride, class _elementType, class _dataPtrType>
bool vctThrowUnlessNotReferenced ( PyObject * CMN_UNUSEDinput,
const vctFixedSizeConstVectorBase< _size, _stride, _elementType, _dataPtrType > & CMN_UNUSEDtarget )

◆ vctThrowUnlessNotReferenced() [3/5]

bool vctThrowUnlessNotReferenced ( PyObject * input)

◆ vctThrowUnlessNotReferenced() [4/5]

template<class _matrixOwnerType, typename _elementType>
bool vctThrowUnlessNotReferenced ( PyObject * input,
const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > & CMN_UNUSEDtarget )

◆ vctThrowUnlessNotReferenced() [5/5]

template<class _vectorOwnerType, typename _elementType>
bool vctThrowUnlessNotReferenced ( PyObject * input,
const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > & CMN_UNUSEDtarget )

◆ vctThrowUnlessOwnsData() [1/5]

template<vct::size_type _rows, vct::size_type _cols, vct::stride_type _rowStride, vct::stride_type _colStride, class _elementType, class _dataPtrType>
bool vctThrowUnlessOwnsData ( PyArrayObject * CMN_UNUSEDinput,
const vctFixedSizeConstMatrixBase< _rows, _cols, _rowStride, _colStride, _elementType, _dataPtrType > & CMN_UNUSEDtarget )

◆ vctThrowUnlessOwnsData() [2/5]

template<vct::size_type _size, vct::stride_type _stride, class _elementType, class _dataPtrType>
bool vctThrowUnlessOwnsData ( PyArrayObject * CMN_UNUSEDinput,
const vctFixedSizeConstVectorBase< _size, _stride, _elementType, _dataPtrType > & CMN_UNUSEDtarget )

◆ vctThrowUnlessOwnsData() [3/5]

bool vctThrowUnlessOwnsData ( PyArrayObject * input)

◆ vctThrowUnlessOwnsData() [4/5]

template<class _matrixOwnerType, typename _elementType>
bool vctThrowUnlessOwnsData ( PyArrayObject * input,
const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > & CMN_UNUSEDtarget )

◆ vctThrowUnlessOwnsData() [5/5]

template<class _vectorOwnerType, typename _elementType>
bool vctThrowUnlessOwnsData ( PyArrayObject * input,
const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > & CMN_UNUSEDtarget )