207
char gsl_matrix_char_get(const gsl_matrix_char * m, const size_t i, const size_t j);
208
void gsl_matrix_char_set(gsl_matrix_char * m, const size_t i, const size_t j, const char x);
210
char * gsl_matrix_char_ptr(gsl_matrix_char * m, const size_t i, const size_t j);
211
const char * gsl_matrix_char_const_ptr(const gsl_matrix_char * m, const size_t i, const size_t j);
213
208
void gsl_matrix_char_set_zero (gsl_matrix_char * m);
214
209
void gsl_matrix_char_set_identity (gsl_matrix_char * m);
215
210
void gsl_matrix_char_set_all (gsl_matrix_char * m, char x);
256
251
int gsl_matrix_char_get_col(gsl_vector_char * v, const gsl_matrix_char * m, const size_t j);
257
252
int gsl_matrix_char_set_row(gsl_matrix_char * m, const size_t i, const gsl_vector_char * v);
258
253
int gsl_matrix_char_set_col(gsl_matrix_char * m, const size_t j, const gsl_vector_char * v);
254
/***********************************************************************/
260
256
/* inline functions if you are using GCC */
258
INLINE_DECL char gsl_matrix_char_get(const gsl_matrix_char * m, const size_t i, const size_t j);
259
INLINE_DECL void gsl_matrix_char_set(gsl_matrix_char * m, const size_t i, const size_t j, const char x);
260
INLINE_DECL char * gsl_matrix_char_ptr(gsl_matrix_char * m, const size_t i, const size_t j);
261
INLINE_DECL const char * gsl_matrix_char_const_ptr(const gsl_matrix_char * m, const size_t i, const size_t j);
262
263
#ifdef HAVE_INLINE
265
266
gsl_matrix_char_get(const gsl_matrix_char * m, const size_t i, const size_t j)
267
268
#if GSL_RANGE_CHECK
270
GSL_ERROR_VAL("first index out of range", GSL_EINVAL, 0) ;
272
else if (j >= m->size2)
274
GSL_ERROR_VAL("second index out of range", GSL_EINVAL, 0) ;
269
if (GSL_RANGE_COND(1))
273
GSL_ERROR_VAL("first index out of range", GSL_EINVAL, 0) ;
275
else if (j >= m->size2)
277
GSL_ERROR_VAL("second index out of range", GSL_EINVAL, 0) ;
277
281
return m->data[i * m->tda + j] ;
282
286
gsl_matrix_char_set(gsl_matrix_char * m, const size_t i, const size_t j, const char x)
284
288
#if GSL_RANGE_CHECK
287
GSL_ERROR_VOID("first index out of range", GSL_EINVAL) ;
289
else if (j >= m->size2)
291
GSL_ERROR_VOID("second index out of range", GSL_EINVAL) ;
289
if (GSL_RANGE_COND(1))
293
GSL_ERROR_VOID("first index out of range", GSL_EINVAL) ;
295
else if (j >= m->size2)
297
GSL_ERROR_VOID("second index out of range", GSL_EINVAL) ;
294
301
m->data[i * m->tda + j] = x ;
299
306
gsl_matrix_char_ptr(gsl_matrix_char * m, const size_t i, const size_t j)
301
308
#if GSL_RANGE_CHECK
304
GSL_ERROR_NULL("first index out of range", GSL_EINVAL) ;
306
else if (j >= m->size2)
308
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) ;
311
321
return (char *) (m->data + (i * m->tda + j)) ;
316
326
gsl_matrix_char_const_ptr(const gsl_matrix_char * m, const size_t i, const size_t j)
318
328
#if GSL_RANGE_CHECK
321
GSL_ERROR_NULL("first index out of range", GSL_EINVAL) ;
323
else if (j >= m->size2)
325
GSL_ERROR_NULL("second index out of range", GSL_EINVAL) ;
329
if (GSL_RANGE_COND(1))
333
GSL_ERROR_NULL("first index out of range", GSL_EINVAL) ;
335
else if (j >= m->size2)
337
GSL_ERROR_NULL("second index out of range", GSL_EINVAL) ;
328
341
return (const char *) (m->data + (i * m->tda + j)) ;