| 1 | /* vector/gsl_vector_int.h |
| 2 | * |
| 3 | * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Gerard Jungman, Brian Gough |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | #ifndef __GSL_VECTOR_INT_H__ |
| 21 | #define __GSL_VECTOR_INT_H__cxx . . $ `external/gsl/gsl_vector_int.h:21:9`! |
| 22 | |
| 23 | #include <stdlib.h> |
| 24 | #include "gsl_types.h"cxx . . $ `<file>/external/gsl/gsl_types.h`/ |
| 25 | #include "gsl_errno.h"cxx . . $ `<file>/external/gsl/gsl_errno.h`/ |
| 26 | #include "gsl_check_range.h"cxx . . $ `<file>/external/gsl/gsl_check_range.h`/ |
| 27 | #include "gsl_block_int.h"cxx . . $ `<file>/external/gsl/gsl_block_int.h`/ |
| 28 | |
| 29 | #undef __BEGIN_DECLScxx . . $ `external/gsl/gsl_block_int.h:32:10`! |
| 30 | #undef __END_DECLScxx . . $ `external/gsl/gsl_block_int.h:33:10`! |
| 31 | #ifdef __cplusplus |
| 32 | # define __BEGIN_DECLS extern "C" { |
| 33 | # define __END_DECLS } |
| 34 | #else |
| 35 | # define __BEGIN_DECLScxx . . $ `external/gsl/gsl_vector_int.h:35:10`! /* empty */ |
| 36 | # define __END_DECLScxx . . $ `external/gsl/gsl_vector_int.h:36:10`! /* empty */ |
| 37 | #endif |
| 38 | |
| 39 | __BEGIN_DECLScxx . . $ `external/gsl/gsl_vector_int.h:35:10`! |
| 40 | |
| 41 | typedef structcxx . . $ $anonymous_type_8a20c748c45d8e6_0# |
| 42 | { |
| 43 | size_t sizecxx . . $ $anonymous_type_8a20c748c45d8e6_0#size.; |
| 44 | size_t stridecxx . . $ $anonymous_type_8a20c748c45d8e6_0#stride.; |
| 45 | int *datacxx . . $ $anonymous_type_8a20c748c45d8e6_0#data.; |
| 46 | gsl_block_intcxx . . $ gsl_block_int# *blockcxx . . $ $anonymous_type_8a20c748c45d8e6_0#block.; |
| 47 | int ownercxx . . $ $anonymous_type_8a20c748c45d8e6_0#owner.; |
| 48 | } |
| 49 | gsl_vector_intcxx . . $ gsl_vector_int#; |
| 50 | |
| 51 | typedef structcxx . . $ $anonymous_type_8a20c748c45d8e6_1# |
| 52 | { |
| 53 | gsl_vector_intcxx . . $ gsl_vector_int# vectorcxx . . $ $anonymous_type_8a20c748c45d8e6_1#vector.; |
| 54 | } _gsl_vector_int_viewcxx . . $ _gsl_vector_int_view#; |
| 55 | |
| 56 | typedef _gsl_vector_int_viewcxx . . $ _gsl_vector_int_view# gsl_vector_int_viewcxx . . $ gsl_vector_int_view#; |
| 57 | |
| 58 | typedef structcxx . . $ $anonymous_type_8a20c748c45d8e6_2# |
| 59 | { |
| 60 | gsl_vector_intcxx . . $ gsl_vector_int# vectorcxx . . $ $anonymous_type_8a20c748c45d8e6_2#vector.; |
| 61 | } _gsl_vector_int_const_viewcxx . . $ _gsl_vector_int_const_view#; |
| 62 | |
| 63 | typedef const _gsl_vector_int_const_viewcxx . . $ _gsl_vector_int_const_view# gsl_vector_int_const_viewcxx . . $ gsl_vector_int_const_view#; |
| 64 | |
| 65 | |
| 66 | /* Allocation */ |
| 67 | |
| 68 | gsl_vector_intcxx . . $ gsl_vector_int# *gsl_vector_int_alloccxx . . $ gsl_vector_int_alloc(994edb625c4dea9d). (const size_t n); |
| 69 | gsl_vector_intcxx . . $ gsl_vector_int# *gsl_vector_int_calloccxx . . $ gsl_vector_int_calloc(994edb625c4dea9d). (const size_t n); |
| 70 | |
| 71 | gsl_vector_intcxx . . $ gsl_vector_int# *gsl_vector_int_alloc_from_blockcxx . . $ gsl_vector_int_alloc_from_block(f16e11a2316e6729). (gsl_block_intcxx . . $ gsl_block_int# * b, |
| 72 | const size_t offset, |
| 73 | const size_t n, |
| 74 | const size_t stride); |
| 75 | |
| 76 | gsl_vector_intcxx . . $ gsl_vector_int# *gsl_vector_int_alloc_from_vectorcxx . . $ gsl_vector_int_alloc_from_vector(1b7fc631ce3b9f40). (gsl_vector_intcxx . . $ gsl_vector_int# * v, |
| 77 | const size_t offset, |
| 78 | const size_t n, |
| 79 | const size_t stride); |
| 80 | |
| 81 | void gsl_vector_int_freecxx . . $ gsl_vector_int_free(b7a25a7be3062ab1). (gsl_vector_intcxx . . $ gsl_vector_int# * v); |
| 82 | |
| 83 | /* Views */ |
| 84 | |
| 85 | _gsl_vector_int_viewcxx . . $ _gsl_vector_int_view# |
| 86 | gsl_vector_int_view_arraycxx . . $ gsl_vector_int_view_array(aa66d2c8d4599da7). (int *v, size_t n); |
| 87 | |
| 88 | _gsl_vector_int_viewcxx . . $ _gsl_vector_int_view# |
| 89 | gsl_vector_int_view_array_with_stridecxx . . $ gsl_vector_int_view_array_with_stride(7fca70b109ff894d). (int *base, |
| 90 | size_t stride, |
| 91 | size_t n); |
| 92 | |
| 93 | _gsl_vector_int_const_viewcxx . . $ _gsl_vector_int_const_view# |
| 94 | gsl_vector_int_const_view_arraycxx . . $ gsl_vector_int_const_view_array(96bdec10138cf57c). (const int *v, size_t n); |
| 95 | |
| 96 | _gsl_vector_int_const_viewcxx . . $ _gsl_vector_int_const_view# |
| 97 | gsl_vector_int_const_view_array_with_stridecxx . . $ gsl_vector_int_const_view_array_with_stride(d6606b6e85c46434). (const int *base, |
| 98 | size_t stride, |
| 99 | size_t n); |
| 100 | |
| 101 | _gsl_vector_int_viewcxx . . $ _gsl_vector_int_view# |
| 102 | gsl_vector_int_subvectorcxx . . $ gsl_vector_int_subvector(4ef66589e1b8d019). (gsl_vector_intcxx . . $ gsl_vector_int# *v, |
| 103 | size_t i, |
| 104 | size_t n); |
| 105 | |
| 106 | _gsl_vector_int_viewcxx . . $ _gsl_vector_int_view# |
| 107 | gsl_vector_int_subvector_with_stridecxx . . $ gsl_vector_int_subvector_with_stride(50acab86bb379ae6). (gsl_vector_intcxx . . $ gsl_vector_int# *v, |
| 108 | size_t i, |
| 109 | size_t stride, |
| 110 | size_t n); |
| 111 | |
| 112 | _gsl_vector_int_const_viewcxx . . $ _gsl_vector_int_const_view# |
| 113 | gsl_vector_int_const_subvectorcxx . . $ gsl_vector_int_const_subvector(4e64b8fe3e5106b8). (const gsl_vector_intcxx . . $ gsl_vector_int# *v, |
| 114 | size_t i, |
| 115 | size_t n); |
| 116 | |
| 117 | _gsl_vector_int_const_viewcxx . . $ _gsl_vector_int_const_view# |
| 118 | gsl_vector_int_const_subvector_with_stridecxx . . $ gsl_vector_int_const_subvector_with_stride(9bbec13045957c99). (const gsl_vector_intcxx . . $ gsl_vector_int# *v, |
| 119 | size_t i, |
| 120 | size_t stride, |
| 121 | size_t n); |
| 122 | |
| 123 | /* Operations */ |
| 124 | |
| 125 | int gsl_vector_int_getcxx . . $ gsl_vector_int_get(fa1446e9487562e8). (const gsl_vector_intcxx . . $ gsl_vector_int# * v, const size_t i); |
| 126 | void gsl_vector_int_setcxx . . $ gsl_vector_int_set(fca978cbf2d25c68). (gsl_vector_intcxx . . $ gsl_vector_int# * v, const size_t i, int x); |
| 127 | |
| 128 | int *gsl_vector_int_ptrcxx . . $ gsl_vector_int_ptr(7839758406000501). (gsl_vector_intcxx . . $ gsl_vector_int# * v, const size_t i); |
| 129 | const int *gsl_vector_int_const_ptrcxx . . $ gsl_vector_int_const_ptr(d8ad399743416ad9). (const gsl_vector_intcxx . . $ gsl_vector_int# * v, const size_t i); |
| 130 | |
| 131 | void gsl_vector_int_set_zerocxx . . $ gsl_vector_int_set_zero(b7a25a7be3062ab1). (gsl_vector_intcxx . . $ gsl_vector_int# * v); |
| 132 | void gsl_vector_int_set_allcxx . . $ gsl_vector_int_set_all(f6917379cbef2672). (gsl_vector_intcxx . . $ gsl_vector_int# * v, int x); |
| 133 | int gsl_vector_int_set_basiscxx . . $ gsl_vector_int_set_basis(1acc17914ec628cc). (gsl_vector_intcxx . . $ gsl_vector_int# * v, size_t i); |
| 134 | |
| 135 | int gsl_vector_int_freadcxx . . $ gsl_vector_int_fread(bba9507cb43bd814). (FILEcxx . . $ FILE# * stream, gsl_vector_intcxx . . $ gsl_vector_int# * v); |
| 136 | int gsl_vector_int_fwritecxx . . $ gsl_vector_int_fwrite(3ee866453e83b1b8). (FILEcxx . . $ FILE# * stream, const gsl_vector_intcxx . . $ gsl_vector_int# * v); |
| 137 | int gsl_vector_int_fscanfcxx . . $ gsl_vector_int_fscanf(bba9507cb43bd814). (FILEcxx . . $ FILE# * stream, gsl_vector_intcxx . . $ gsl_vector_int# * v); |
| 138 | int gsl_vector_int_fprintfcxx . . $ gsl_vector_int_fprintf(54d74fde6a582a10). (FILEcxx . . $ FILE# * stream, const gsl_vector_intcxx . . $ gsl_vector_int# * v, |
| 139 | const char *format); |
| 140 | |
| 141 | int gsl_vector_int_memcpycxx . . $ gsl_vector_int_memcpy(5856f1218d232a74). (gsl_vector_intcxx . . $ gsl_vector_int# * dest, const gsl_vector_intcxx . . $ gsl_vector_int# * src); |
| 142 | |
| 143 | int gsl_vector_int_reversecxx . . $ gsl_vector_int_reverse(e0edec2980ea0ee2). (gsl_vector_intcxx . . $ gsl_vector_int# * v); |
| 144 | |
| 145 | int gsl_vector_int_swapcxx . . $ gsl_vector_int_swap(58a4b6da143c95c2). (gsl_vector_intcxx . . $ gsl_vector_int# * v, gsl_vector_intcxx . . $ gsl_vector_int# * w); |
| 146 | int gsl_vector_int_swap_elementscxx . . $ gsl_vector_int_swap_elements(b2a5832843c6784c). (gsl_vector_intcxx . . $ gsl_vector_int# * v, const size_t i, const size_t j); |
| 147 | |
| 148 | int gsl_vector_int_maxcxx . . $ gsl_vector_int_max(9a0d803dba03e7a6). (const gsl_vector_intcxx . . $ gsl_vector_int# * v); |
| 149 | int gsl_vector_int_mincxx . . $ gsl_vector_int_min(9a0d803dba03e7a6). (const gsl_vector_intcxx . . $ gsl_vector_int# * v); |
| 150 | void gsl_vector_int_minmaxcxx . . $ gsl_vector_int_minmax(36db50c7049b9911). (const gsl_vector_intcxx . . $ gsl_vector_int# * v, int * min_out, int * max_out); |
| 151 | |
| 152 | size_t gsl_vector_int_max_indexcxx . . $ gsl_vector_int_max_index(27f7319d540fbece). (const gsl_vector_intcxx . . $ gsl_vector_int# * v); |
| 153 | size_t gsl_vector_int_min_indexcxx . . $ gsl_vector_int_min_index(27f7319d540fbece). (const gsl_vector_intcxx . . $ gsl_vector_int# * v); |
| 154 | void gsl_vector_int_minmax_indexcxx . . $ gsl_vector_int_minmax_index(a5ba5aee98a019f9). (const gsl_vector_intcxx . . $ gsl_vector_int# * v, size_t * imin, size_t * imax); |
| 155 | |
| 156 | int gsl_vector_int_addcxx . . $ gsl_vector_int_add(5856f1218d232a74). (gsl_vector_intcxx . . $ gsl_vector_int# * a, const gsl_vector_intcxx . . $ gsl_vector_int# * b); |
| 157 | int gsl_vector_int_subcxx . . $ gsl_vector_int_sub(5856f1218d232a74). (gsl_vector_intcxx . . $ gsl_vector_int# * a, const gsl_vector_intcxx . . $ gsl_vector_int# * b); |
| 158 | int gsl_vector_int_mulcxx . . $ gsl_vector_int_mul(5856f1218d232a74). (gsl_vector_intcxx . . $ gsl_vector_int# * a, const gsl_vector_intcxx . . $ gsl_vector_int# * b); |
| 159 | int gsl_vector_int_divcxx . . $ gsl_vector_int_div(5856f1218d232a74). (gsl_vector_intcxx . . $ gsl_vector_int# * a, const gsl_vector_intcxx . . $ gsl_vector_int# * b); |
| 160 | int gsl_vector_int_scalecxx . . $ gsl_vector_int_scale(674a441d63d28d51). (gsl_vector_intcxx . . $ gsl_vector_int# * a, const double x); |
| 161 | int gsl_vector_int_add_constantcxx . . $ gsl_vector_int_add_constant(674a441d63d28d51). (gsl_vector_intcxx . . $ gsl_vector_int# * a, const double x); |
| 162 | |
| 163 | int gsl_vector_int_isnullcxx . . $ gsl_vector_int_isnull(9a0d803dba03e7a6). (const gsl_vector_intcxx . . $ gsl_vector_int# * v); |
| 164 | int gsl_vector_int_isposcxx . . $ gsl_vector_int_ispos(9a0d803dba03e7a6). (const gsl_vector_intcxx . . $ gsl_vector_int# * v); |
| 165 | int gsl_vector_int_isnegcxx . . $ gsl_vector_int_isneg(9a0d803dba03e7a6). (const gsl_vector_intcxx . . $ gsl_vector_int# * v); |
| 166 | int gsl_vector_int_isnonnegcxx . . $ gsl_vector_int_isnonneg(9a0d803dba03e7a6). (const gsl_vector_intcxx . . $ gsl_vector_int# * v); |
| 167 | |
| 168 | #ifdef HAVE_INLINE |
| 169 | |
| 170 | extern inline |
| 171 | int |
| 172 | gsl_vector_int_get (const gsl_vector_int * v, const size_t i) |
| 173 | { |
| 174 | #if GSL_RANGE_CHECK |
| 175 | if (i >= v->size) |
| 176 | { |
| 177 | GSL_ERROR_VAL ("index out of range", GSL_EINVAL, 0); |
| 178 | } |
| 179 | #endif |
| 180 | return v->data[i * v->stride]; |
| 181 | } |
| 182 | |
| 183 | extern inline |
| 184 | void |
| 185 | gsl_vector_int_set (gsl_vector_int * v, const size_t i, int x) |
| 186 | { |
| 187 | #if GSL_RANGE_CHECK |
| 188 | if (i >= v->size) |
| 189 | { |
| 190 | GSL_ERROR_VOID ("index out of range", GSL_EINVAL); |
| 191 | } |
| 192 | #endif |
| 193 | v->data[i * v->stride] = x; |
| 194 | } |
| 195 | |
| 196 | extern inline |
| 197 | int * |
| 198 | gsl_vector_int_ptr (gsl_vector_int * v, const size_t i) |
| 199 | { |
| 200 | #if GSL_RANGE_CHECK |
| 201 | if (i >= v->size) |
| 202 | { |
| 203 | GSL_ERROR_NULL ("index out of range", GSL_EINVAL); |
| 204 | } |
| 205 | #endif |
| 206 | return (int *) (v->data + i * v->stride); |
| 207 | } |
| 208 | |
| 209 | extern inline |
| 210 | const int * |
| 211 | gsl_vector_int_const_ptr (const gsl_vector_int * v, const size_t i) |
| 212 | { |
| 213 | #if GSL_RANGE_CHECK |
| 214 | if (i >= v->size) |
| 215 | { |
| 216 | GSL_ERROR_NULL ("index out of range", GSL_EINVAL); |
| 217 | } |
| 218 | #endif |
| 219 | return (const int *) (v->data + i * v->stride); |
| 220 | } |
| 221 | |
| 222 | |
| 223 | #endif /* HAVE_INLINE */ |
| 224 | |
| 225 | __END_DECLScxx . . $ `external/gsl/gsl_vector_int.h:36:10`! |
| 226 | |
| 227 | #endif /* __GSL_VECTOR_INT_H__ */ |
| 228 | |
| 229 |