The typemap is a mapping from C types to Perl internal types.
There are many predefined types, but as you can imagine, it
would be impossible to list them all. It looks like
double ** isn't in the typemap (which doesn't
quite surprise me). So, you have to either extend the typemap,
or use the appropriate Perl internal types.
I don't know how to extend the typemap. My knowledge of XS
is extremely limited.