I have (hopefully) hacked the R package MASS to make it capable of performing robust linear fits on complex number data. It uses external c and FORTRAN code to perform some linear algebra which I've modified / replaced to accommodate complex numbers.
While trying to compile a c source file via R CMD SHLIB, I getting errors such as:
error: invalid operands to binary - (have ‘Rcomplex’ {aka ‘struct <anonymous>’} and ‘Rcomplex’ {aka ‘struct <anonymous>’})
Clearly, the compiler is not understanding that the Rcomplex type should be treated as a double complex type. This isn't completely unexpected, since Writing R Extensions mentions that this can happen for certain compilers with certain configurations. However, I haven't been able to find any information on how to change the configuration so that it does work.
I've tried changing the optimization level to no avail, and including various header files in addition to complex.h, Complex.h, Rmath.h, and R.h has not worked either.
Does anyone know what I could be missing?