File indexing completed on 2025-01-19 09:56:49
0001 #ifndef __GSL_VECTOR_COMPLEX_H__
0002 #define __GSL_VECTOR_COMPLEX_H__
0003
0004 #define GSL_VECTOR_REAL(z, i) ((z)->data[2*(i)*(z)->stride])
0005 #define GSL_VECTOR_IMAG(z, i) ((z)->data[2*(i)*(z)->stride + 1])
0006
0007 #if GSL_RANGE_CHECK
0008 #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))))
0009 #else
0010 #define GSL_VECTOR_COMPLEX(zv, i) (*GSL_COMPLEX_AT((zv),(i)))
0011 #endif
0012
0013 #define GSL_COMPLEX_AT(zv,i) ((gsl_complex*)&((zv)->data[2*(i)*(zv)->stride]))
0014 #define GSL_COMPLEX_FLOAT_AT(zv,i) ((gsl_complex_float*)&((zv)->data[2*(i)*(zv)->stride]))
0015 #define GSL_COMPLEX_LONG_DOUBLE_AT(zv,i) ((gsl_complex_long_double*)&((zv)->data[2*(i)*(zv)->stride]))
0016
0017 #endif