<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>numpy C++ swig class example</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

<P><FONT SIZE=2>I am using the numpy.i interface file and have gotten the cookbook/swig example to work from scipy.<BR>
Are there any examples of appyling the numpy.i to a C++ header file. I would like to generate a lightweight<BR>
Array2D class that just uses doubles and would have the following header file<BR>
<BR>
Array2D.h<BR>
=========<BR>
class Array2D {<BR>
  public:<BR>
    int _nrow;<BR>
    int _ncol;<BR>
    double* data;<BR>
  Array2DD(int nrow, int ncol, double *data);<BR>
}<BR>
<BR>
<BR>
<BR>
// I would expect the have the following Array2D.i interface file<BR>
%module array2DD<BR>
<BR>
%{<BR>
#define SWIG_FILE_WITH_INIT<BR>
#include "Array2D.h"<BR>
%}<BR>
<BR>
%include "numpy.i"<BR>
<BR>
%init %{<BR>
import_array();<BR>
%}<BR>
<BR>
%ignore Array2D();<BR>
%ignore Array2D(long nrow, long ncol);<BR>
%apply (int DIM1, int DIM2, double* IN_ARRAY2) {(int nrow, int ncol, double *data)}<BR>
%include "Array2D.h"<BR>
</FONT>
</P>

</BODY>
</HTML>