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

« back to all changes in this revision

Viewing changes to vector/gsl_vector_char.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:
23
23
#include <stdlib.h>
24
24
#include <gsl/gsl_types.h>
25
25
#include <gsl/gsl_errno.h>
 
26
#include <gsl/gsl_inline.h>
26
27
#include <gsl/gsl_check_range.h>
27
28
#include <gsl/gsl_block_char.h>
28
29
 
122
123
 
123
124
/* Operations */
124
125
 
125
 
char gsl_vector_char_get (const gsl_vector_char * v, const size_t i);
126
 
void gsl_vector_char_set (gsl_vector_char * v, const size_t i, char x);
127
 
 
128
 
char *gsl_vector_char_ptr (gsl_vector_char * v, const size_t i);
129
 
const char *gsl_vector_char_const_ptr (const gsl_vector_char * v, const size_t i);
130
 
 
131
126
void gsl_vector_char_set_zero (gsl_vector_char * v);
132
127
void gsl_vector_char_set_all (gsl_vector_char * v, char x);
133
128
int gsl_vector_char_set_basis (gsl_vector_char * v, size_t i);
165
160
int gsl_vector_char_isneg (const gsl_vector_char * v);
166
161
int gsl_vector_char_isnonneg (const gsl_vector_char * v);
167
162
 
 
163
INLINE_DECL char gsl_vector_char_get (const gsl_vector_char * v, const size_t i);
 
164
INLINE_DECL void gsl_vector_char_set (gsl_vector_char * v, const size_t i, char x);
 
165
INLINE_DECL char * gsl_vector_char_ptr (gsl_vector_char * v, const size_t i);
 
166
INLINE_DECL const char * gsl_vector_char_const_ptr (const gsl_vector_char * v, const size_t i);
 
167
 
168
168
#ifdef HAVE_INLINE
169
169
 
170
 
extern inline
 
170
INLINE_FUN
171
171
char
172
172
gsl_vector_char_get (const gsl_vector_char * v, const size_t i)
173
173
{
174
174
#if GSL_RANGE_CHECK
175
 
  if (i >= v->size)
 
175
  if (GSL_RANGE_COND(i >= v->size))
176
176
    {
177
177
      GSL_ERROR_VAL ("index out of range", GSL_EINVAL, 0);
178
178
    }
180
180
  return v->data[i * v->stride];
181
181
}
182
182
 
183
 
extern inline
 
183
INLINE_FUN
184
184
void
185
185
gsl_vector_char_set (gsl_vector_char * v, const size_t i, char x)
186
186
{
187
187
#if GSL_RANGE_CHECK
188
 
  if (i >= v->size)
 
188
  if (GSL_RANGE_COND(i >= v->size))
189
189
    {
190
190
      GSL_ERROR_VOID ("index out of range", GSL_EINVAL);
191
191
    }
193
193
  v->data[i * v->stride] = x;
194
194
}
195
195
 
196
 
extern inline
 
196
INLINE_FUN
197
197
char *
198
198
gsl_vector_char_ptr (gsl_vector_char * v, const size_t i)
199
199
{
200
200
#if GSL_RANGE_CHECK
201
 
  if (i >= v->size)
 
201
  if (GSL_RANGE_COND(i >= v->size))
202
202
    {
203
203
      GSL_ERROR_NULL ("index out of range", GSL_EINVAL);
204
204
    }
206
206
  return (char *) (v->data + i * v->stride);
207
207
}
208
208
 
209
 
extern inline
 
209
INLINE_FUN
210
210
const char *
211
211
gsl_vector_char_const_ptr (const gsl_vector_char * v, const size_t i)
212
212
{
213
213
#if GSL_RANGE_CHECK
214
 
  if (i >= v->size)
 
214
  if (GSL_RANGE_COND(i >= v->size))
215
215
    {
216
216
      GSL_ERROR_NULL ("index out of range", GSL_EINVAL);
217
217
    }
218
218
#endif
219
219
  return (const char *) (v->data + i * v->stride);
220
220
}
221
 
 
222
 
 
223
221
#endif /* HAVE_INLINE */
224
222
 
225
223
__END_DECLS