This is an archival dump of old wiki content --- see scipy.org for current material.
Please see http://scipy-cookbook.readthedocs.org/

Attachment 'C_arraytest.h'

Download

   1 /* Header to test of C modules for arrays for Python: C_test.c */
   2 
   3 /* ==== Prototypes =================================== */
   4 
   5 // .... Python callable Vector functions ..................
   6 static PyObject *vecfcn1(PyObject *self, PyObject *args);
   7 static PyObject *vecsq(PyObject *self, PyObject *args);
   8 
   9 /* .... C vector utility functions ..................*/
  10 PyArrayObject *pyvector(PyObject *objin);
  11 double *pyvector_to_Carrayptrs(PyArrayObject *arrayin);
  12 int  not_doublevector(PyArrayObject *vec);
  13 
  14 
  15 /* .... Python callable Matrix functions ..................*/
  16 static PyObject *rowx2(PyObject *self, PyObject *args);
  17 static PyObject *rowx2_v2(PyObject *self, PyObject *args);
  18 static PyObject *matsq(PyObject *self, PyObject *args);
  19 static PyObject *contigmat(PyObject *self, PyObject *args);
  20 
  21 /* .... C matrix utility functions ..................*/
  22 PyArrayObject *pymatrix(PyObject *objin);
  23 double **pymatrix_to_Carrayptrs(PyArrayObject *arrayin);
  24 double **ptrvector(long n);
  25 void free_Carrayptrs(double **v);
  26 int  not_doublematrix(PyArrayObject *mat);
  27 
  28 /* .... Python callable integer 2D array functions ..................*/
  29 static PyObject *intfcn1(PyObject *self, PyObject *args);
  30 
  31 /* .... C 2D int array utility functions ..................*/
  32 PyArrayObject *pyint2Darray(PyObject *objin);
  33 int **pyint2Darray_to_Carrayptrs(PyArrayObject *arrayin);
  34 int **ptrintvector(long n);
  35 void free_Cint2Darrayptrs(int **v);
  36 int  not_int2Darray(PyArrayObject *mat);

New Attachment

File to upload
Rename to
Overwrite existing attachment of same name

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.