| 1 | #ifndef __GSL_VECTOR_COMPLEX_H__ |
| 2 | #define __GSL_VECTOR_COMPLEX_H__ |
| 3 | |
| 4 | #define GSL_VECTOR_REAL(z, i) ((z)->data[2*(i)*(z)->stride]) |
| 5 | #define GSL_VECTOR_IMAG(z, i) ((z)->data[2*(i)*(z)->stride + 1]) |
| 6 | |
| 7 | #if GSL_RANGE_CHECK |
| 8 | #define GSL_VECTOR_COMPLEX(zv, i) (((i) >= (zv)->size ? (gsl_error ("index out of range", __FILE__, __LINE__, GSL_EINVAL), 0):0 , *GSL_COMPLEX_AT((zv),(i)))) |
| 9 | #else |
| 10 | #define GSL_VECTOR_COMPLEX(zv, i) (*GSL_COMPLEX_AT((zv),(i))) |
| 11 | #endif |
| 12 | |
| 13 | #define GSL_COMPLEX_AT(zv,i) ((gsl_complex*)&((zv)->data[2*(i)*(zv)->stride])) |
| 14 | #define GSL_COMPLEX_FLOAT_AT(zv,i) ((gsl_complex_float*)&((zv)->data[2*(i)*(zv)->stride])) |
| 15 | #define GSL_COMPLEX_LONG_DOUBLE_AT(zv,i) ((gsl_complex_long_double*)&((zv)->data[2*(i)*(zv)->stride])) |
| 16 | |
| 17 | #endif /* __GSL_VECTOR_COMPLEX_H__ */ |
| 18 | |