DippyPythonUtils.h

Go to the documentation of this file.
00001 #ifndef DIPPY_PYTHONUTILS_INCLUDED
00002 #define DIPPY_PYTHONUTILS_INCLUDED
00003 
00004 #include "Python.h"
00005 
00006 #include "Decomp.h"
00007 #include "DecompAlgo.h"
00008 
00009 #include <map>
00010 #include <vector>
00011 using namespace std;
00012 
00013 // Some convenience functions for converting between Python objects and
00014 // C/C++ data structures
00015 
00023 PyObject* pyTupleList_FromDoubleArray(const double* values, PyObject* pList);
00024 
00033 PyObject* pyTupleList_FromNode(DecompAlgo* algo, DecompStatus decompStatus);
00034 
00042 void pyColDict_AsPairedVector(PyObject* pColDict, vector< pair<int, double> >& vector, map<PyObject*, int> indices);
00043 
00052 int pyColDict_AsPackedArrays(PyObject* pColDict, map<PyObject*, int> indices, int** inds, double** vals);
00053 
00054 int pyColDict_AsPackedArrays(PyObject* pColDict, map<PyObject*, int> indices, int** inds, double** vals, DecompVarType & varType);
00055 
00063 CoinPackedMatrix* pyConstraints_AsPackedMatrix(PyObject* pRowList,
00064       map<PyObject*, int> rowIndices, map<PyObject*, int> colIndices);
00065 
00069 void addTupleToPyList(PyObject* pList, PyObject* key, PyObject* value);
00070 
00074 void insertTupleToPyList(PyObject* pList, unsigned position, PyObject* key, PyObject* value);
00075 
00076 #endif

Generated on 3 Jun 2015 for Dip-All by  doxygen 1.6.1