208
gsl_complex gsl_matrix_complex_get(const gsl_matrix_complex * m, const size_t i, const size_t j);
209
void gsl_matrix_complex_set(gsl_matrix_complex * m, const size_t i, const size_t j, const gsl_complex x);
211
gsl_complex * gsl_matrix_complex_ptr(gsl_matrix_complex * m, const size_t i, const size_t j);
212
const gsl_complex * gsl_matrix_complex_const_ptr(const gsl_matrix_complex * m, const size_t i, const size_t j);
214
208
void gsl_matrix_complex_set_zero (gsl_matrix_complex * m);
215
209
void gsl_matrix_complex_set_identity (gsl_matrix_complex * m);
216
210
void gsl_matrix_complex_set_all (gsl_matrix_complex * m, gsl_complex x);
249
244
int gsl_matrix_complex_get_col(gsl_vector_complex * v, const gsl_matrix_complex * m, const size_t j);
250
245
int gsl_matrix_complex_set_row(gsl_matrix_complex * m, const size_t i, const gsl_vector_complex * v);
251
246
int gsl_matrix_complex_set_col(gsl_matrix_complex * m, const size_t j, const gsl_vector_complex * v);
247
/***********************************************************************/
249
/* inline functions if you are using GCC */
251
INLINE_DECL gsl_complex gsl_matrix_complex_get(const gsl_matrix_complex * m, const size_t i, const size_t j);
252
INLINE_DECL void gsl_matrix_complex_set(gsl_matrix_complex * m, const size_t i, const size_t j, const gsl_complex x);
254
INLINE_DECL gsl_complex * gsl_matrix_complex_ptr(gsl_matrix_complex * m, const size_t i, const size_t j);
255
INLINE_DECL const gsl_complex * gsl_matrix_complex_const_ptr(const gsl_matrix_complex * m, const size_t i, const size_t j);
253
257
#ifdef HAVE_INLINE
257
261
gsl_matrix_complex_get(const gsl_matrix_complex * m,
258
262
const size_t i, const size_t j)
260
264
#if GSL_RANGE_CHECK
261
gsl_complex zero = {{0,0}};
265
if (GSL_RANGE_COND(1))
267
gsl_complex zero = {{0,0}};
265
GSL_ERROR_VAL("first index out of range", GSL_EINVAL, zero) ;
267
else if (j >= m->size2)
269
GSL_ERROR_VAL("second index out of range", GSL_EINVAL, zero) ;
271
GSL_ERROR_VAL("first index out of range", GSL_EINVAL, zero) ;
273
else if (j >= m->size2)
275
GSL_ERROR_VAL("second index out of range", GSL_EINVAL, zero) ;
272
279
return *(gsl_complex *)(m->data + 2*(i * m->tda + j)) ;
277
284
gsl_matrix_complex_set(gsl_matrix_complex * m,
278
285
const size_t i, const size_t j, const gsl_complex x)
280
287
#if GSL_RANGE_CHECK
283
GSL_ERROR_VOID("first index out of range", GSL_EINVAL) ;
285
else if (j >= m->size2)
287
GSL_ERROR_VOID("second index out of range", GSL_EINVAL) ;
288
if (GSL_RANGE_COND(1))
292
GSL_ERROR_VOID("first index out of range", GSL_EINVAL) ;
294
else if (j >= m->size2)
296
GSL_ERROR_VOID("second index out of range", GSL_EINVAL) ;
290
300
*(gsl_complex *)(m->data + 2*(i * m->tda + j)) = x ;
295
305
gsl_matrix_complex_ptr(gsl_matrix_complex * m,
296
306
const size_t i, const size_t j)
298
308
#if GSL_RANGE_CHECK
301
GSL_ERROR_NULL("first index out of range", GSL_EINVAL) ;
303
else if (j >= m->size2)
305
GSL_ERROR_NULL("second index out of range", GSL_EINVAL) ;
309
if (GSL_RANGE_COND(1))
313
GSL_ERROR_NULL("first index out of range", GSL_EINVAL) ;
315
else if (j >= m->size2)
317
GSL_ERROR_NULL("second index out of range", GSL_EINVAL) ;
308
321
return (gsl_complex *)(m->data + 2*(i * m->tda + j)) ;
312
325
const gsl_complex *
313
326
gsl_matrix_complex_const_ptr(const gsl_matrix_complex * m,
314
327
const size_t i, const size_t j)
316
329
#if GSL_RANGE_CHECK
319
GSL_ERROR_NULL("first index out of range", GSL_EINVAL) ;
321
else if (j >= m->size2)
323
GSL_ERROR_NULL("second index out of range", GSL_EINVAL) ;
330
if (GSL_RANGE_COND(1))
334
GSL_ERROR_NULL("first index out of range", GSL_EINVAL) ;
336
else if (j >= m->size2)
338
GSL_ERROR_NULL("second index out of range", GSL_EINVAL) ;
326
342
return (const gsl_complex *)(m->data + 2*(i * m->tda + j)) ;