~ubuntu-branches/debian/sid/gsl/sid

« back to all changes in this revision

Viewing changes to matrix/gsl_matrix_complex_double.h

  • Committer: Bazaar Package Importer
  • Author(s): Dirk Eddelbuettel
  • Date: 2008-12-16 06:17:55 UTC
  • mfrom: (1.3.2 upstream) (3.1.15 jaunty)
  • Revision ID: james.westby@ubuntu.com-20081216061755-9la7p0qwrhopk8pl
Tags: 1.12+dfsg-1
* New upstream version released today

* doc/*: As before, removed the 'non-free' documentation to create a 
  source package that complies with Debian's interpretation of what is free. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
205
205
 
206
206
/* Operations */
207
207
 
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);
210
 
 
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);
213
 
 
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);
233
227
int gsl_matrix_complex_isnull (const gsl_matrix_complex * m);
234
228
int gsl_matrix_complex_ispos (const gsl_matrix_complex * m);
235
229
int gsl_matrix_complex_isneg (const gsl_matrix_complex * m);
 
230
int gsl_matrix_complex_isnonneg (const gsl_matrix_complex * m);
236
231
 
237
232
int gsl_matrix_complex_add (gsl_matrix_complex * a, const gsl_matrix_complex * b);
238
233
int gsl_matrix_complex_sub (gsl_matrix_complex * a, const gsl_matrix_complex * b);
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
/***********************************************************************/
 
248
 
 
249
/* inline functions if you are using GCC */
 
250
 
 
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);
 
253
 
 
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);
252
256
 
253
257
#ifdef HAVE_INLINE
254
258
 
255
 
extern inline 
 
259
INLINE_FUN 
256
260
gsl_complex
257
261
gsl_matrix_complex_get(const gsl_matrix_complex * m, 
258
262
                     const size_t i, const size_t j)
259
263
{
260
264
#if GSL_RANGE_CHECK
261
 
  gsl_complex zero = {{0,0}};
 
265
  if (GSL_RANGE_COND(1)) 
 
266
    {
 
267
      gsl_complex zero = {{0,0}};
262
268
 
263
 
  if (i >= m->size1)
264
 
    {
265
 
      GSL_ERROR_VAL("first index out of range", GSL_EINVAL, zero) ;
266
 
    }
267
 
  else if (j >= m->size2)
268
 
    {
269
 
      GSL_ERROR_VAL("second index out of range", GSL_EINVAL, zero) ;
 
269
      if (i >= m->size1)
 
270
        {
 
271
          GSL_ERROR_VAL("first index out of range", GSL_EINVAL, zero) ;
 
272
        }
 
273
      else if (j >= m->size2)
 
274
        {
 
275
          GSL_ERROR_VAL("second index out of range", GSL_EINVAL, zero) ;
 
276
        }
270
277
    }
271
278
#endif
272
279
  return *(gsl_complex *)(m->data + 2*(i * m->tda + j)) ;
273
280
274
281
 
275
 
extern inline 
 
282
INLINE_FUN 
276
283
void
277
284
gsl_matrix_complex_set(gsl_matrix_complex * m, 
278
285
                     const size_t i, const size_t j, const gsl_complex x)
279
286
{
280
287
#if GSL_RANGE_CHECK
281
 
  if (i >= m->size1)
282
 
    {
283
 
      GSL_ERROR_VOID("first index out of range", GSL_EINVAL) ;
284
 
    }
285
 
  else if (j >= m->size2)
286
 
    {
287
 
      GSL_ERROR_VOID("second index out of range", GSL_EINVAL) ;
 
288
  if (GSL_RANGE_COND(1)) 
 
289
    {
 
290
      if (i >= m->size1)
 
291
        {
 
292
          GSL_ERROR_VOID("first index out of range", GSL_EINVAL) ;
 
293
        }
 
294
      else if (j >= m->size2)
 
295
        {
 
296
          GSL_ERROR_VOID("second index out of range", GSL_EINVAL) ;
 
297
        }
288
298
    }
289
299
#endif
290
300
  *(gsl_complex *)(m->data + 2*(i * m->tda + j)) = x ;
291
301
}
292
302
 
293
 
extern inline 
 
303
INLINE_FUN 
294
304
gsl_complex *
295
305
gsl_matrix_complex_ptr(gsl_matrix_complex * m, 
296
306
                             const size_t i, const size_t j)
297
307
{
298
308
#if GSL_RANGE_CHECK
299
 
  if (i >= m->size1)
300
 
    {
301
 
      GSL_ERROR_NULL("first index out of range", GSL_EINVAL) ;
302
 
    }
303
 
  else if (j >= m->size2)
304
 
    {
305
 
      GSL_ERROR_NULL("second index out of range", GSL_EINVAL) ;
 
309
  if (GSL_RANGE_COND(1)) 
 
310
    {
 
311
      if (i >= m->size1)
 
312
        {
 
313
          GSL_ERROR_NULL("first index out of range", GSL_EINVAL) ;
 
314
        }
 
315
      else if (j >= m->size2)
 
316
        {
 
317
          GSL_ERROR_NULL("second index out of range", GSL_EINVAL) ;
 
318
        }
306
319
    }
307
320
#endif
308
321
  return (gsl_complex *)(m->data + 2*(i * m->tda + j)) ;
309
322
310
323
 
311
 
extern inline 
 
324
INLINE_FUN 
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)
315
328
{
316
329
#if GSL_RANGE_CHECK
317
 
  if (i >= m->size1)
318
 
    {
319
 
      GSL_ERROR_NULL("first index out of range", GSL_EINVAL) ;
320
 
    }
321
 
  else if (j >= m->size2)
322
 
    {
323
 
      GSL_ERROR_NULL("second index out of range", GSL_EINVAL) ;
 
330
  if (GSL_RANGE_COND(1)) 
 
331
    {
 
332
      if (i >= m->size1)
 
333
        {
 
334
          GSL_ERROR_NULL("first index out of range", GSL_EINVAL) ;
 
335
        }
 
336
      else if (j >= m->size2)
 
337
        {
 
338
          GSL_ERROR_NULL("second index out of range", GSL_EINVAL) ;
 
339
        }
324
340
    }
325
341
#endif
326
342
  return (const gsl_complex *)(m->data + 2*(i * m->tda + j)) ;