To generate the SWIG wrappers:
swig -c++ -python -I. solvers.i

SWIG will throw a warning about some overloaded functions shadowing others.  I
have done some investigating and found that, despite this warning, the correct
overloaded function is called.  To verify that this is still the case, you can
use the code below.

To verify that numpy/python/swig are inferring the correct types:

Stick this in a python routine:

from wave_solvers_cpp import bar

a = np.array([3.14159265358979323846264338327950,6,7,8], dtype=np.float32)
b = np.array([3.14159265358979323846264338327950,2,3,4], dtype=np.float64)

bar(a)
bar(b)
print 'a', a, a.dtype
print 'b', b, b.dtype

Stick this in a cpp header file:

void bar(double* Foo, int nFoo)
{
    std::cout << "Called double! " << std::endl;
    std::cout << Foo[0] << Foo[1] << Foo[2] << Foo[3] << std::endl << std::endl;
    Foo[2] = 3.14159265358979323846264338327950;
    Foo[0] = 10.;
};
void bar(float* Foo, int nFoo)
{
    std::cout << "Called float! " << std::endl;
    std::cout << Foo[0] << Foo[1] << Foo[2] << Foo[3] << std::endl << std::endl;
    Foo[2] = 3.14159265358979323846264338327950;
    Foo[0] = 10.;
};

And stick this in a swig interface (.i) file:

%apply ( float*  INPLACE_ARRAY1, int DIM1 ) {(float* Foo, int nFoo)};
%apply ( double* INPLACE_ARRAY1, int DIM1 ) {(double* Foo, int nFoo)};


One possible solution to this is to use the PyAMG numpy typemaps, which appear to be an older version.  PyAMG does not have this issue.