1 /** D bindings for GSL. 2 Authors: Chibisi Chima-Okereke 3 Copyright: Copyright (c) 2016, Chibisi Chima-Okereke. All rights reserved. 4 License: Boost License 1.0 5 */ 6 7 module gsl.vector; 8 import gsl.block; 9 import gsl.check_range; 10 import gsl.complex; 11 import core.stdc.stdio : FILE; 12 //import core.stdc.complex; 13 import core.stdc.config : c_long; 14 import core.stdc.config : c_ulong; 15 16 extern (C): 17 18 // gsl_vector_char 19 struct gsl_vector_char 20 { 21 size_t size; 22 size_t stride; 23 char* data; 24 gsl_block_char* block; 25 int owner; 26 } 27 28 struct _gsl_vector_char_view 29 { 30 gsl_vector_char vector; 31 } 32 33 struct _gsl_vector_char_const_view 34 { 35 gsl_vector_char vector; 36 } 37 38 alias _gsl_vector_char_view gsl_vector_char_view; 39 alias const _gsl_vector_char_const_view gsl_vector_char_const_view; 40 41 gsl_vector_char* gsl_vector_char_alloc (const size_t n); 42 gsl_vector_char* gsl_vector_char_calloc (const size_t n); 43 gsl_vector_char* gsl_vector_char_alloc_from_block (gsl_block_char* b, const size_t offset, const size_t n, const size_t stride); 44 gsl_vector_char* gsl_vector_char_alloc_from_vector (gsl_vector_char* v, const size_t offset, const size_t n, const size_t stride); 45 void gsl_vector_char_free (gsl_vector_char* v); 46 _gsl_vector_char_view gsl_vector_char_view_array (char* v, size_t n); 47 _gsl_vector_char_view gsl_vector_char_view_array_with_stride (char* base, size_t stride, size_t n); 48 _gsl_vector_char_const_view gsl_vector_char_const_view_array (const(char)* v, size_t n); 49 _gsl_vector_char_const_view gsl_vector_char_const_view_array_with_stride (const(char)* base, size_t stride, size_t n); 50 _gsl_vector_char_view gsl_vector_char_subvector (gsl_vector_char* v, size_t i, size_t n); 51 _gsl_vector_char_view gsl_vector_char_subvector_with_stride (gsl_vector_char* v, size_t i, size_t stride, size_t n); 52 _gsl_vector_char_const_view gsl_vector_char_const_subvector (const(gsl_vector_char)* v, size_t i, size_t n); 53 _gsl_vector_char_const_view gsl_vector_char_const_subvector_with_stride (const(gsl_vector_char)* v, size_t i, size_t stride, size_t n); 54 void gsl_vector_char_set_zero (gsl_vector_char* v); 55 void gsl_vector_char_set_all (gsl_vector_char* v, char x); 56 int gsl_vector_char_set_basis (gsl_vector_char* v, size_t i); 57 int gsl_vector_char_fread (FILE* stream, gsl_vector_char* v); 58 int gsl_vector_char_fwrite (FILE* stream, const(gsl_vector_char)* v); 59 int gsl_vector_char_fscanf (FILE* stream, gsl_vector_char* v); 60 int gsl_vector_char_fprintf (FILE* stream, const(gsl_vector_char)* v, const(char)* format); 61 int gsl_vector_char_memcpy (gsl_vector_char* dest, const(gsl_vector_char)* src); 62 int gsl_vector_char_reverse (gsl_vector_char* v); 63 int gsl_vector_char_swap (gsl_vector_char* v, gsl_vector_char* w); 64 int gsl_vector_char_swap_elements (gsl_vector_char* v, const size_t i, const size_t j); 65 char gsl_vector_char_max (const(gsl_vector_char)* v); 66 char gsl_vector_char_min (const(gsl_vector_char)* v); 67 void gsl_vector_char_minmax (const(gsl_vector_char)* v, char* min_out, char* max_out); 68 size_t gsl_vector_char_max_index (const(gsl_vector_char)* v); 69 size_t gsl_vector_char_min_index (const(gsl_vector_char)* v); 70 void gsl_vector_char_minmax_index (const(gsl_vector_char)* v, size_t* imin, size_t* imax); 71 int gsl_vector_char_add (gsl_vector_char* a, const(gsl_vector_char)* b); 72 int gsl_vector_char_sub (gsl_vector_char* a, const(gsl_vector_char)* b); 73 int gsl_vector_char_mul (gsl_vector_char* a, const(gsl_vector_char)* b); 74 int gsl_vector_char_div (gsl_vector_char* a, const(gsl_vector_char)* b); 75 int gsl_vector_char_scale (gsl_vector_char* a, const double x); 76 int gsl_vector_char_add_constant (gsl_vector_char* a, const double x); 77 int gsl_vector_char_equal (const(gsl_vector_char)* u, const(gsl_vector_char)* v); 78 int gsl_vector_char_isnull (const(gsl_vector_char)* v); 79 int gsl_vector_char_ispos (const(gsl_vector_char)* v); 80 int gsl_vector_char_isneg (const(gsl_vector_char)* v); 81 int gsl_vector_char_isnonneg (const(gsl_vector_char)* v); 82 char gsl_vector_char_get (const(gsl_vector_char)* v, const size_t i); 83 void gsl_vector_char_set (gsl_vector_char* v, const size_t i, char x); 84 char* gsl_vector_char_ptr (gsl_vector_char* v, const size_t i); 85 const(char)* gsl_vector_char_const_ptr (const(gsl_vector_char)* v, const size_t i); 86 87 88 // gsl_vector_complex_double 89 struct gsl_vector_complex 90 { 91 size_t size; 92 size_t stride; 93 double* data; 94 gsl_block_complex* block; 95 int owner; 96 } 97 98 struct _gsl_vector_complex_view 99 { 100 gsl_vector_complex vector; 101 } 102 103 struct _gsl_vector_complex_const_view 104 { 105 gsl_vector_complex vector; 106 } 107 108 alias _gsl_vector_complex_view gsl_vector_complex_view; 109 alias const _gsl_vector_complex_const_view gsl_vector_complex_const_view; 110 111 gsl_vector_complex* gsl_vector_complex_alloc (const size_t n); 112 gsl_vector_complex* gsl_vector_complex_calloc (const size_t n); 113 gsl_vector_complex* gsl_vector_complex_alloc_from_block (gsl_block_complex* b, const size_t offset, const size_t n, const size_t stride); 114 gsl_vector_complex* gsl_vector_complex_alloc_from_vector (gsl_vector_complex* v, const size_t offset, const size_t n, const size_t stride); 115 void gsl_vector_complex_free (gsl_vector_complex* v); 116 _gsl_vector_complex_view gsl_vector_complex_view_array (double* base, size_t n); 117 _gsl_vector_complex_view gsl_vector_complex_view_array_with_stride (double* base, size_t stride, size_t n); 118 _gsl_vector_complex_const_view gsl_vector_complex_const_view_array (const(double)* base, size_t n); 119 _gsl_vector_complex_const_view gsl_vector_complex_const_view_array_with_stride (const(double)* base, size_t stride, size_t n); 120 _gsl_vector_complex_view gsl_vector_complex_subvector (gsl_vector_complex* base, size_t i, size_t n); 121 _gsl_vector_complex_view gsl_vector_complex_subvector_with_stride (gsl_vector_complex* v, size_t i, size_t stride, size_t n); 122 _gsl_vector_complex_const_view gsl_vector_complex_const_subvector (const(gsl_vector_complex)* base, size_t i, size_t n); 123 _gsl_vector_complex_const_view gsl_vector_complex_const_subvector_with_stride (const(gsl_vector_complex)* v, size_t i, size_t stride, size_t n); 124 _gsl_vector_view gsl_vector_complex_real (gsl_vector_complex* v); 125 _gsl_vector_view gsl_vector_complex_imag (gsl_vector_complex* v); 126 _gsl_vector_const_view gsl_vector_complex_const_real (const(gsl_vector_complex)* v); 127 _gsl_vector_const_view gsl_vector_complex_const_imag (const(gsl_vector_complex)* v); 128 void gsl_vector_complex_set_zero (gsl_vector_complex* v); 129 void gsl_vector_complex_set_all (gsl_vector_complex* v, gsl_complex z); 130 int gsl_vector_complex_set_basis (gsl_vector_complex* v, size_t i); 131 int gsl_vector_complex_fread (FILE* stream, gsl_vector_complex* v); 132 int gsl_vector_complex_fwrite (FILE* stream, const(gsl_vector_complex)* v); 133 int gsl_vector_complex_fscanf (FILE* stream, gsl_vector_complex* v); 134 int gsl_vector_complex_fprintf (FILE* stream, const(gsl_vector_complex)* v, const(char)* format); 135 int gsl_vector_complex_memcpy (gsl_vector_complex* dest, const(gsl_vector_complex)* src); 136 int gsl_vector_complex_reverse (gsl_vector_complex* v); 137 int gsl_vector_complex_swap (gsl_vector_complex* v, gsl_vector_complex* w); 138 int gsl_vector_complex_swap_elements (gsl_vector_complex* v, const size_t i, const size_t j); 139 int gsl_vector_complex_equal (const(gsl_vector_complex)* u, const(gsl_vector_complex)* v); 140 int gsl_vector_complex_isnull (const(gsl_vector_complex)* v); 141 int gsl_vector_complex_ispos (const(gsl_vector_complex)* v); 142 int gsl_vector_complex_isneg (const(gsl_vector_complex)* v); 143 int gsl_vector_complex_isnonneg (const(gsl_vector_complex)* v); 144 int gsl_vector_complex_add (gsl_vector_complex* a, const(gsl_vector_complex)* b); 145 int gsl_vector_complex_sub (gsl_vector_complex* a, const(gsl_vector_complex)* b); 146 int gsl_vector_complex_mul (gsl_vector_complex* a, const(gsl_vector_complex)* b); 147 int gsl_vector_complex_div (gsl_vector_complex* a, const(gsl_vector_complex)* b); 148 int gsl_vector_complex_scale (gsl_vector_complex* a, const gsl_complex x); 149 int gsl_vector_complex_add_constant (gsl_vector_complex* a, const gsl_complex x); 150 gsl_complex gsl_vector_complex_get (const(gsl_vector_complex)* v, const size_t i); 151 void gsl_vector_complex_set (gsl_vector_complex* v, const size_t i, gsl_complex z); 152 gsl_complex* gsl_vector_complex_ptr (gsl_vector_complex* v, const size_t i); 153 const(gsl_complex)* gsl_vector_complex_const_ptr (const(gsl_vector_complex)* v, const size_t i); 154 155 156 //gsl_vector_complex_float 157 struct gsl_vector_complex_float 158 { 159 size_t size; 160 size_t stride; 161 float* data; 162 gsl_block_complex_float* block; 163 int owner; 164 } 165 166 struct _gsl_vector_complex_float_view 167 { 168 gsl_vector_complex_float vector; 169 } 170 171 struct _gsl_vector_complex_float_const_view 172 { 173 gsl_vector_complex_float vector; 174 } 175 176 alias _gsl_vector_complex_float_view gsl_vector_complex_float_view; 177 alias const _gsl_vector_complex_float_const_view gsl_vector_complex_float_const_view; 178 179 gsl_vector_complex_float* gsl_vector_complex_float_alloc (const size_t n); 180 gsl_vector_complex_float* gsl_vector_complex_float_calloc (const size_t n); 181 gsl_vector_complex_float* gsl_vector_complex_float_alloc_from_block (gsl_block_complex_float* b, const size_t offset, const size_t n, const size_t stride); 182 gsl_vector_complex_float* gsl_vector_complex_float_alloc_from_vector (gsl_vector_complex_float* v, const size_t offset, const size_t n, const size_t stride); 183 void gsl_vector_complex_float_free (gsl_vector_complex_float* v); 184 _gsl_vector_complex_float_view gsl_vector_complex_float_view_array (float* base, size_t n); 185 _gsl_vector_complex_float_view gsl_vector_complex_float_view_array_with_stride (float* base, size_t stride, size_t n); 186 _gsl_vector_complex_float_const_view gsl_vector_complex_float_const_view_array (const(float)* base, size_t n); 187 _gsl_vector_complex_float_const_view gsl_vector_complex_float_const_view_array_with_stride (const(float)* base, size_t stride, size_t n); 188 _gsl_vector_complex_float_view gsl_vector_complex_float_subvector (gsl_vector_complex_float* base, size_t i, size_t n); 189 _gsl_vector_complex_float_view gsl_vector_complex_float_subvector_with_stride (gsl_vector_complex_float* v, size_t i, size_t stride, size_t n); 190 _gsl_vector_complex_float_const_view gsl_vector_complex_float_const_subvector (const(gsl_vector_complex_float)* base, size_t i, size_t n); 191 _gsl_vector_complex_float_const_view gsl_vector_complex_float_const_subvector_with_stride (const(gsl_vector_complex_float)* v, size_t i, size_t stride, size_t n); 192 _gsl_vector_float_view gsl_vector_complex_float_real (gsl_vector_complex_float* v); 193 _gsl_vector_float_view gsl_vector_complex_float_imag (gsl_vector_complex_float* v); 194 _gsl_vector_float_const_view gsl_vector_complex_float_const_real (const(gsl_vector_complex_float)* v); 195 _gsl_vector_float_const_view gsl_vector_complex_float_const_imag (const(gsl_vector_complex_float)* v); 196 void gsl_vector_complex_float_set_zero (gsl_vector_complex_float* v); 197 void gsl_vector_complex_float_set_all (gsl_vector_complex_float* v, gsl_complex_float z); 198 int gsl_vector_complex_float_set_basis (gsl_vector_complex_float* v, size_t i); 199 int gsl_vector_complex_float_fread (FILE* stream, gsl_vector_complex_float* v); 200 int gsl_vector_complex_float_fwrite (FILE* stream, const(gsl_vector_complex_float)* v); 201 int gsl_vector_complex_float_fscanf (FILE* stream, gsl_vector_complex_float* v); 202 int gsl_vector_complex_float_fprintf (FILE* stream, const(gsl_vector_complex_float)* v, const(char)* format); 203 int gsl_vector_complex_float_memcpy (gsl_vector_complex_float* dest, const(gsl_vector_complex_float)* src); 204 int gsl_vector_complex_float_reverse (gsl_vector_complex_float* v); 205 int gsl_vector_complex_float_swap (gsl_vector_complex_float* v, gsl_vector_complex_float* w); 206 int gsl_vector_complex_float_swap_elements (gsl_vector_complex_float* v, const size_t i, const size_t j); 207 int gsl_vector_complex_float_equal (const(gsl_vector_complex_float)* u, const(gsl_vector_complex_float)* v); 208 int gsl_vector_complex_float_isnull (const(gsl_vector_complex_float)* v); 209 int gsl_vector_complex_float_ispos (const(gsl_vector_complex_float)* v); 210 int gsl_vector_complex_float_isneg (const(gsl_vector_complex_float)* v); 211 int gsl_vector_complex_float_isnonneg (const(gsl_vector_complex_float)* v); 212 int gsl_vector_complex_float_add (gsl_vector_complex_float* a, const(gsl_vector_complex_float)* b); 213 int gsl_vector_complex_float_sub (gsl_vector_complex_float* a, const(gsl_vector_complex_float)* b); 214 int gsl_vector_complex_float_mul (gsl_vector_complex_float* a, const(gsl_vector_complex_float)* b); 215 int gsl_vector_complex_float_div (gsl_vector_complex_float* a, const(gsl_vector_complex_float)* b); 216 int gsl_vector_complex_float_scale (gsl_vector_complex_float* a, const gsl_complex_float x); 217 int gsl_vector_complex_float_add_constant (gsl_vector_complex_float* a, const gsl_complex_float x); 218 gsl_complex_float gsl_vector_complex_float_get (const(gsl_vector_complex_float)* v, const size_t i); 219 void gsl_vector_complex_float_set (gsl_vector_complex_float* v, const size_t i, gsl_complex_float z); 220 gsl_complex_float* gsl_vector_complex_float_ptr (gsl_vector_complex_float* v, const size_t i); 221 const(gsl_complex_float)* gsl_vector_complex_float_const_ptr (const(gsl_vector_complex_float)* v, const size_t i); 222 223 //gsl_vector_complex_long_double 224 struct gsl_vector_complex_long_double 225 { 226 size_t size; 227 size_t stride; 228 real* data; 229 gsl_block_complex_long_double* block; 230 int owner; 231 } 232 233 struct _gsl_vector_complex_long_double_view 234 { 235 gsl_vector_complex_long_double vector; 236 } 237 238 struct _gsl_vector_complex_long_double_const_view 239 { 240 gsl_vector_complex_long_double vector; 241 } 242 243 alias _gsl_vector_complex_long_double_view gsl_vector_complex_long_double_view; 244 alias const _gsl_vector_complex_long_double_const_view gsl_vector_complex_long_double_const_view; 245 246 gsl_vector_complex_long_double* gsl_vector_complex_long_double_alloc (const size_t n); 247 gsl_vector_complex_long_double* gsl_vector_complex_long_double_calloc (const size_t n); 248 gsl_vector_complex_long_double* gsl_vector_complex_long_double_alloc_from_block (gsl_block_complex_long_double* b, const size_t offset, const size_t n, const size_t stride); 249 gsl_vector_complex_long_double* gsl_vector_complex_long_double_alloc_from_vector (gsl_vector_complex_long_double* v, const size_t offset, const size_t n, const size_t stride); 250 void gsl_vector_complex_long_double_free (gsl_vector_complex_long_double* v); 251 _gsl_vector_complex_long_double_view gsl_vector_complex_long_double_view_array (real* base, size_t n); 252 _gsl_vector_complex_long_double_view gsl_vector_complex_long_double_view_array_with_stride (real* base, size_t stride, size_t n); 253 _gsl_vector_complex_long_double_const_view gsl_vector_complex_long_double_const_view_array (const(real)* base, size_t n); 254 _gsl_vector_complex_long_double_const_view gsl_vector_complex_long_double_const_view_array_with_stride (const(real)* base, size_t stride, size_t n); 255 _gsl_vector_complex_long_double_view gsl_vector_complex_long_double_subvector (gsl_vector_complex_long_double* base, size_t i, size_t n); 256 _gsl_vector_complex_long_double_view gsl_vector_complex_long_double_subvector_with_stride (gsl_vector_complex_long_double* v, size_t i, size_t stride, size_t n); 257 _gsl_vector_complex_long_double_const_view gsl_vector_complex_long_double_const_subvector (const(gsl_vector_complex_long_double)* base, size_t i, size_t n); 258 _gsl_vector_complex_long_double_const_view gsl_vector_complex_long_double_const_subvector_with_stride (const(gsl_vector_complex_long_double)* v, size_t i, size_t stride, size_t n); 259 _gsl_vector_long_double_view gsl_vector_complex_long_double_real (gsl_vector_complex_long_double* v); 260 _gsl_vector_long_double_view gsl_vector_complex_long_double_imag (gsl_vector_complex_long_double* v); 261 _gsl_vector_long_double_const_view gsl_vector_complex_long_double_const_real (const(gsl_vector_complex_long_double)* v); 262 _gsl_vector_long_double_const_view gsl_vector_complex_long_double_const_imag (const(gsl_vector_complex_long_double)* v); 263 void gsl_vector_complex_long_double_set_zero (gsl_vector_complex_long_double* v); 264 void gsl_vector_complex_long_double_set_all (gsl_vector_complex_long_double* v, gsl_complex_long_double z); 265 int gsl_vector_complex_long_double_set_basis (gsl_vector_complex_long_double* v, size_t i); 266 int gsl_vector_complex_long_double_fread (FILE* stream, gsl_vector_complex_long_double* v); 267 int gsl_vector_complex_long_double_fwrite (FILE* stream, const(gsl_vector_complex_long_double)* v); 268 int gsl_vector_complex_long_double_fscanf (FILE* stream, gsl_vector_complex_long_double* v); 269 int gsl_vector_complex_long_double_fprintf (FILE* stream, const(gsl_vector_complex_long_double)* v, const(char)* format); 270 int gsl_vector_complex_long_double_memcpy (gsl_vector_complex_long_double* dest, const(gsl_vector_complex_long_double)* src); 271 int gsl_vector_complex_long_double_reverse (gsl_vector_complex_long_double* v); 272 int gsl_vector_complex_long_double_swap (gsl_vector_complex_long_double* v, gsl_vector_complex_long_double* w); 273 int gsl_vector_complex_long_double_swap_elements (gsl_vector_complex_long_double* v, const size_t i, const size_t j); 274 int gsl_vector_complex_long_double_equal (const(gsl_vector_complex_long_double)* u, const(gsl_vector_complex_long_double)* v); 275 int gsl_vector_complex_long_double_isnull (const(gsl_vector_complex_long_double)* v); 276 int gsl_vector_complex_long_double_ispos (const(gsl_vector_complex_long_double)* v); 277 int gsl_vector_complex_long_double_isneg (const(gsl_vector_complex_long_double)* v); 278 int gsl_vector_complex_long_double_isnonneg (const(gsl_vector_complex_long_double)* v); 279 int gsl_vector_complex_long_double_add (gsl_vector_complex_long_double* a, const(gsl_vector_complex_long_double)* b); 280 int gsl_vector_complex_long_double_sub (gsl_vector_complex_long_double* a, const(gsl_vector_complex_long_double)* b); 281 int gsl_vector_complex_long_double_mul (gsl_vector_complex_long_double* a, const(gsl_vector_complex_long_double)* b); 282 int gsl_vector_complex_long_double_div (gsl_vector_complex_long_double* a, const(gsl_vector_complex_long_double)* b); 283 int gsl_vector_complex_long_double_scale (gsl_vector_complex_long_double* a, const gsl_complex_long_double x); 284 int gsl_vector_complex_long_double_add_constant (gsl_vector_complex_long_double* a, const gsl_complex_long_double x); 285 gsl_complex_long_double gsl_vector_complex_long_double_get (const(gsl_vector_complex_long_double)* v, const size_t i); 286 void gsl_vector_complex_long_double_set (gsl_vector_complex_long_double* v, const size_t i, gsl_complex_long_double z); 287 gsl_complex_long_double* gsl_vector_complex_long_double_ptr (gsl_vector_complex_long_double* v, const size_t i); 288 const(gsl_complex_long_double)* gsl_vector_complex_long_double_const_ptr (const(gsl_vector_complex_long_double)* v, const size_t i); 289 290 291 //gsl_vector_double 292 struct gsl_vector 293 { 294 size_t size; 295 size_t stride; 296 double* data; 297 gsl_block* block; 298 int owner; 299 } 300 301 struct _gsl_vector_view 302 { 303 gsl_vector vector; 304 } 305 306 struct _gsl_vector_const_view 307 { 308 gsl_vector vector; 309 } 310 311 alias _gsl_vector_view gsl_vector_view; 312 alias const _gsl_vector_const_view gsl_vector_const_view; 313 314 gsl_vector* gsl_vector_alloc (const size_t n); 315 gsl_vector* gsl_vector_calloc (const size_t n); 316 gsl_vector* gsl_vector_alloc_from_block (gsl_block* b, const size_t offset, const size_t n, const size_t stride); 317 gsl_vector* gsl_vector_alloc_from_vector (gsl_vector* v, const size_t offset, const size_t n, const size_t stride); 318 void gsl_vector_free (gsl_vector* v); 319 _gsl_vector_view gsl_vector_view_array (double* v, size_t n); 320 _gsl_vector_view gsl_vector_view_array_with_stride (double* base, size_t stride, size_t n); 321 _gsl_vector_const_view gsl_vector_const_view_array (const(double)* v, size_t n); 322 _gsl_vector_const_view gsl_vector_const_view_array_with_stride (const(double)* base, size_t stride, size_t n); 323 _gsl_vector_view gsl_vector_subvector (gsl_vector* v, size_t i, size_t n); 324 _gsl_vector_view gsl_vector_subvector_with_stride (gsl_vector* v, size_t i, size_t stride, size_t n); 325 _gsl_vector_const_view gsl_vector_const_subvector (const(gsl_vector)* v, size_t i, size_t n); 326 _gsl_vector_const_view gsl_vector_const_subvector_with_stride (const(gsl_vector)* v, size_t i, size_t stride, size_t n); 327 void gsl_vector_set_zero (gsl_vector* v); 328 void gsl_vector_set_all (gsl_vector* v, double x); 329 int gsl_vector_set_basis (gsl_vector* v, size_t i); 330 int gsl_vector_fread (FILE* stream, gsl_vector* v); 331 int gsl_vector_fwrite (FILE* stream, const(gsl_vector)* v); 332 int gsl_vector_fscanf (FILE* stream, gsl_vector* v); 333 int gsl_vector_fprintf (FILE* stream, const(gsl_vector)* v, const(char)* format); 334 int gsl_vector_memcpy (gsl_vector* dest, const(gsl_vector)* src); 335 int gsl_vector_reverse (gsl_vector* v); 336 int gsl_vector_swap (gsl_vector* v, gsl_vector* w); 337 int gsl_vector_swap_elements (gsl_vector* v, const size_t i, const size_t j); 338 double gsl_vector_max (const(gsl_vector)* v); 339 double gsl_vector_min (const(gsl_vector)* v); 340 void gsl_vector_minmax (const(gsl_vector)* v, double* min_out, double* max_out); 341 size_t gsl_vector_max_index (const(gsl_vector)* v); 342 size_t gsl_vector_min_index (const(gsl_vector)* v); 343 void gsl_vector_minmax_index (const(gsl_vector)* v, size_t* imin, size_t* imax); 344 int gsl_vector_add (gsl_vector* a, const(gsl_vector)* b); 345 int gsl_vector_sub (gsl_vector* a, const(gsl_vector)* b); 346 int gsl_vector_mul (gsl_vector* a, const(gsl_vector)* b); 347 int gsl_vector_div (gsl_vector* a, const(gsl_vector)* b); 348 int gsl_vector_scale (gsl_vector* a, const double x); 349 int gsl_vector_add_constant (gsl_vector* a, const double x); 350 int gsl_vector_equal (const(gsl_vector)* u, const(gsl_vector)* v); 351 int gsl_vector_isnull (const(gsl_vector)* v); 352 int gsl_vector_ispos (const(gsl_vector)* v); 353 int gsl_vector_isneg (const(gsl_vector)* v); 354 int gsl_vector_isnonneg (const(gsl_vector)* v); 355 double gsl_vector_get (const(gsl_vector)* v, const size_t i); 356 void gsl_vector_set (gsl_vector* v, const size_t i, double x); 357 double* gsl_vector_ptr (gsl_vector* v, const size_t i); 358 const(double)* gsl_vector_const_ptr (const(gsl_vector)* v, const size_t i); 359 360 //gsl_vector_float 361 struct gsl_vector_float 362 { 363 size_t size; 364 size_t stride; 365 float* data; 366 gsl_block_float* block; 367 int owner; 368 } 369 370 struct _gsl_vector_float_view 371 { 372 gsl_vector_float vector; 373 } 374 375 struct _gsl_vector_float_const_view 376 { 377 gsl_vector_float vector; 378 } 379 380 alias _gsl_vector_float_view gsl_vector_float_view; 381 alias const _gsl_vector_float_const_view gsl_vector_float_const_view; 382 383 gsl_vector_float* gsl_vector_float_alloc (const size_t n); 384 gsl_vector_float* gsl_vector_float_calloc (const size_t n); 385 gsl_vector_float* gsl_vector_float_alloc_from_block (gsl_block_float* b, const size_t offset, const size_t n, const size_t stride); 386 gsl_vector_float* gsl_vector_float_alloc_from_vector (gsl_vector_float* v, const size_t offset, const size_t n, const size_t stride); 387 void gsl_vector_float_free (gsl_vector_float* v); 388 _gsl_vector_float_view gsl_vector_float_view_array (float* v, size_t n); 389 _gsl_vector_float_view gsl_vector_float_view_array_with_stride (float* base, size_t stride, size_t n); 390 _gsl_vector_float_const_view gsl_vector_float_const_view_array (const(float)* v, size_t n); 391 _gsl_vector_float_const_view gsl_vector_float_const_view_array_with_stride (const(float)* base, size_t stride, size_t n); 392 _gsl_vector_float_view gsl_vector_float_subvector (gsl_vector_float* v, size_t i, size_t n); 393 _gsl_vector_float_view gsl_vector_float_subvector_with_stride (gsl_vector_float* v, size_t i, size_t stride, size_t n); 394 _gsl_vector_float_const_view gsl_vector_float_const_subvector (const(gsl_vector_float)* v, size_t i, size_t n); 395 _gsl_vector_float_const_view gsl_vector_float_const_subvector_with_stride (const(gsl_vector_float)* v, size_t i, size_t stride, size_t n); 396 void gsl_vector_float_set_zero (gsl_vector_float* v); 397 void gsl_vector_float_set_all (gsl_vector_float* v, float x); 398 int gsl_vector_float_set_basis (gsl_vector_float* v, size_t i); 399 int gsl_vector_float_fread (FILE* stream, gsl_vector_float* v); 400 int gsl_vector_float_fwrite (FILE* stream, const(gsl_vector_float)* v); 401 int gsl_vector_float_fscanf (FILE* stream, gsl_vector_float* v); 402 int gsl_vector_float_fprintf (FILE* stream, const(gsl_vector_float)* v, const(char)* format); 403 int gsl_vector_float_memcpy (gsl_vector_float* dest, const(gsl_vector_float)* src); 404 int gsl_vector_float_reverse (gsl_vector_float* v); 405 int gsl_vector_float_swap (gsl_vector_float* v, gsl_vector_float* w); 406 int gsl_vector_float_swap_elements (gsl_vector_float* v, const size_t i, const size_t j); 407 float gsl_vector_float_max (const(gsl_vector_float)* v); 408 float gsl_vector_float_min (const(gsl_vector_float)* v); 409 void gsl_vector_float_minmax (const(gsl_vector_float)* v, float* min_out, float* max_out); 410 size_t gsl_vector_float_max_index (const(gsl_vector_float)* v); 411 size_t gsl_vector_float_min_index (const(gsl_vector_float)* v); 412 void gsl_vector_float_minmax_index (const(gsl_vector_float)* v, size_t* imin, size_t* imax); 413 int gsl_vector_float_add (gsl_vector_float* a, const(gsl_vector_float)* b); 414 int gsl_vector_float_sub (gsl_vector_float* a, const(gsl_vector_float)* b); 415 int gsl_vector_float_mul (gsl_vector_float* a, const(gsl_vector_float)* b); 416 int gsl_vector_float_div (gsl_vector_float* a, const(gsl_vector_float)* b); 417 int gsl_vector_float_scale (gsl_vector_float* a, const double x); 418 int gsl_vector_float_add_constant (gsl_vector_float* a, const double x); 419 int gsl_vector_float_equal (const(gsl_vector_float)* u, const(gsl_vector_float)* v); 420 int gsl_vector_float_isnull (const(gsl_vector_float)* v); 421 int gsl_vector_float_ispos (const(gsl_vector_float)* v); 422 int gsl_vector_float_isneg (const(gsl_vector_float)* v); 423 int gsl_vector_float_isnonneg (const(gsl_vector_float)* v); 424 float gsl_vector_float_get (const(gsl_vector_float)* v, const size_t i); 425 void gsl_vector_float_set (gsl_vector_float* v, const size_t i, float x); 426 float* gsl_vector_float_ptr (gsl_vector_float* v, const size_t i); 427 const(float)* gsl_vector_float_const_ptr (const(gsl_vector_float)* v, const size_t i); 428 429 430 //gsl_vector_int 431 struct gsl_vector_int 432 { 433 size_t size; 434 size_t stride; 435 int* data; 436 gsl_block_int* block; 437 int owner; 438 } 439 440 struct _gsl_vector_int_view 441 { 442 gsl_vector_int vector; 443 } 444 445 struct _gsl_vector_int_const_view 446 { 447 gsl_vector_int vector; 448 } 449 450 alias _gsl_vector_int_view gsl_vector_int_view; 451 alias const _gsl_vector_int_const_view gsl_vector_int_const_view; 452 453 gsl_vector_int* gsl_vector_int_alloc (const size_t n); 454 gsl_vector_int* gsl_vector_int_calloc (const size_t n); 455 gsl_vector_int* gsl_vector_int_alloc_from_block (gsl_block_int* b, const size_t offset, const size_t n, const size_t stride); 456 gsl_vector_int* gsl_vector_int_alloc_from_vector (gsl_vector_int* v, const size_t offset, const size_t n, const size_t stride); 457 void gsl_vector_int_free (gsl_vector_int* v); 458 _gsl_vector_int_view gsl_vector_int_view_array (int* v, size_t n); 459 _gsl_vector_int_view gsl_vector_int_view_array_with_stride (int* base, size_t stride, size_t n); 460 _gsl_vector_int_const_view gsl_vector_int_const_view_array (const(int)* v, size_t n); 461 _gsl_vector_int_const_view gsl_vector_int_const_view_array_with_stride (const(int)* base, size_t stride, size_t n); 462 _gsl_vector_int_view gsl_vector_int_subvector (gsl_vector_int* v, size_t i, size_t n); 463 _gsl_vector_int_view gsl_vector_int_subvector_with_stride (gsl_vector_int* v, size_t i, size_t stride, size_t n); 464 _gsl_vector_int_const_view gsl_vector_int_const_subvector (const(gsl_vector_int)* v, size_t i, size_t n); 465 _gsl_vector_int_const_view gsl_vector_int_const_subvector_with_stride (const(gsl_vector_int)* v, size_t i, size_t stride, size_t n); 466 void gsl_vector_int_set_zero (gsl_vector_int* v); 467 void gsl_vector_int_set_all (gsl_vector_int* v, int x); 468 int gsl_vector_int_set_basis (gsl_vector_int* v, size_t i); 469 int gsl_vector_int_fread (FILE* stream, gsl_vector_int* v); 470 int gsl_vector_int_fwrite (FILE* stream, const(gsl_vector_int)* v); 471 int gsl_vector_int_fscanf (FILE* stream, gsl_vector_int* v); 472 int gsl_vector_int_fprintf (FILE* stream, const(gsl_vector_int)* v, const(char)* format); 473 int gsl_vector_int_memcpy (gsl_vector_int* dest, const(gsl_vector_int)* src); 474 int gsl_vector_int_reverse (gsl_vector_int* v); 475 int gsl_vector_int_swap (gsl_vector_int* v, gsl_vector_int* w); 476 int gsl_vector_int_swap_elements (gsl_vector_int* v, const size_t i, const size_t j); 477 int gsl_vector_int_max (const(gsl_vector_int)* v); 478 int gsl_vector_int_min (const(gsl_vector_int)* v); 479 void gsl_vector_int_minmax (const(gsl_vector_int)* v, int* min_out, int* max_out); 480 size_t gsl_vector_int_max_index (const(gsl_vector_int)* v); 481 size_t gsl_vector_int_min_index (const(gsl_vector_int)* v); 482 void gsl_vector_int_minmax_index (const(gsl_vector_int)* v, size_t* imin, size_t* imax); 483 int gsl_vector_int_add (gsl_vector_int* a, const(gsl_vector_int)* b); 484 int gsl_vector_int_sub (gsl_vector_int* a, const(gsl_vector_int)* b); 485 int gsl_vector_int_mul (gsl_vector_int* a, const(gsl_vector_int)* b); 486 int gsl_vector_int_div (gsl_vector_int* a, const(gsl_vector_int)* b); 487 int gsl_vector_int_scale (gsl_vector_int* a, const double x); 488 int gsl_vector_int_add_constant (gsl_vector_int* a, const double x); 489 int gsl_vector_int_equal (const(gsl_vector_int)* u, const(gsl_vector_int)* v); 490 int gsl_vector_int_isnull (const(gsl_vector_int)* v); 491 int gsl_vector_int_ispos (const(gsl_vector_int)* v); 492 int gsl_vector_int_isneg (const(gsl_vector_int)* v); 493 int gsl_vector_int_isnonneg (const(gsl_vector_int)* v); 494 int gsl_vector_int_get (const(gsl_vector_int)* v, const size_t i); 495 void gsl_vector_int_set (gsl_vector_int* v, const size_t i, int x); 496 int* gsl_vector_int_ptr (gsl_vector_int* v, const size_t i); 497 const(int)* gsl_vector_int_const_ptr (const(gsl_vector_int)* v, const size_t i); 498 499 500 //gsl_vector_long 501 struct gsl_vector_long 502 { 503 size_t size; 504 size_t stride; 505 c_long* data; 506 gsl_block_long* block; 507 int owner; 508 } 509 510 struct _gsl_vector_long_view 511 { 512 gsl_vector_long vector; 513 } 514 515 516 struct _gsl_vector_long_const_view 517 { 518 gsl_vector_long vector; 519 } 520 521 alias _gsl_vector_long_view gsl_vector_long_view; 522 alias const _gsl_vector_long_const_view gsl_vector_long_const_view; 523 524 gsl_vector_long* gsl_vector_long_alloc (const size_t n); 525 gsl_vector_long* gsl_vector_long_calloc (const size_t n); 526 gsl_vector_long* gsl_vector_long_alloc_from_block (gsl_block_long* b, const size_t offset, const size_t n, const size_t stride); 527 gsl_vector_long* gsl_vector_long_alloc_from_vector (gsl_vector_long* v, const size_t offset, const size_t n, const size_t stride); 528 void gsl_vector_long_free (gsl_vector_long* v); 529 _gsl_vector_long_view gsl_vector_long_view_array (c_long* v, size_t n); 530 _gsl_vector_long_view gsl_vector_long_view_array_with_stride (c_long* base, size_t stride, size_t n); 531 _gsl_vector_long_const_view gsl_vector_long_const_view_array (const(c_long)* v, size_t n); 532 _gsl_vector_long_const_view gsl_vector_long_const_view_array_with_stride (const(c_long)* base, size_t stride, size_t n); 533 _gsl_vector_long_view gsl_vector_long_subvector (gsl_vector_long* v, size_t i, size_t n); 534 _gsl_vector_long_view gsl_vector_long_subvector_with_stride (gsl_vector_long* v, size_t i, size_t stride, size_t n); 535 _gsl_vector_long_const_view gsl_vector_long_const_subvector (const(gsl_vector_long)* v, size_t i, size_t n); 536 _gsl_vector_long_const_view gsl_vector_long_const_subvector_with_stride (const(gsl_vector_long)* v, size_t i, size_t stride, size_t n); 537 void gsl_vector_long_set_zero (gsl_vector_long* v); 538 void gsl_vector_long_set_all (gsl_vector_long* v, c_long x); 539 int gsl_vector_long_set_basis (gsl_vector_long* v, size_t i); 540 int gsl_vector_long_fread (FILE* stream, gsl_vector_long* v); 541 int gsl_vector_long_fwrite (FILE* stream, const(gsl_vector_long)* v); 542 int gsl_vector_long_fscanf (FILE* stream, gsl_vector_long* v); 543 int gsl_vector_long_fprintf (FILE* stream, const(gsl_vector_long)* v, const(char)* format); 544 int gsl_vector_long_memcpy (gsl_vector_long* dest, const(gsl_vector_long)* src); 545 int gsl_vector_long_reverse (gsl_vector_long* v); 546 int gsl_vector_long_swap (gsl_vector_long* v, gsl_vector_long* w); 547 int gsl_vector_long_swap_elements (gsl_vector_long* v, const size_t i, const size_t j); 548 c_long gsl_vector_long_max (const(gsl_vector_long)* v); 549 c_long gsl_vector_long_min (const(gsl_vector_long)* v); 550 void gsl_vector_long_minmax (const(gsl_vector_long)* v, c_long* min_out, c_long* max_out); 551 size_t gsl_vector_long_max_index (const(gsl_vector_long)* v); 552 size_t gsl_vector_long_min_index (const(gsl_vector_long)* v); 553 void gsl_vector_long_minmax_index (const(gsl_vector_long)* v, size_t* imin, size_t* imax); 554 int gsl_vector_long_add (gsl_vector_long* a, const(gsl_vector_long)* b); 555 int gsl_vector_long_sub (gsl_vector_long* a, const(gsl_vector_long)* b); 556 int gsl_vector_long_mul (gsl_vector_long* a, const(gsl_vector_long)* b); 557 int gsl_vector_long_div (gsl_vector_long* a, const(gsl_vector_long)* b); 558 int gsl_vector_long_scale (gsl_vector_long* a, const double x); 559 int gsl_vector_long_add_constant (gsl_vector_long* a, const double x); 560 int gsl_vector_long_equal (const(gsl_vector_long)* u, const(gsl_vector_long)* v); 561 int gsl_vector_long_isnull (const(gsl_vector_long)* v); 562 int gsl_vector_long_ispos (const(gsl_vector_long)* v); 563 int gsl_vector_long_isneg (const(gsl_vector_long)* v); 564 int gsl_vector_long_isnonneg (const(gsl_vector_long)* v); 565 c_long gsl_vector_long_get (const(gsl_vector_long)* v, const size_t i); 566 void gsl_vector_long_set (gsl_vector_long* v, const size_t i, c_long x); 567 c_long* gsl_vector_long_ptr (gsl_vector_long* v, const size_t i); 568 const(c_long)* gsl_vector_long_const_ptr (const(gsl_vector_long)* v, const size_t i); 569 570 571 //gsl_vector_long_double 572 struct gsl_vector_long_double 573 { 574 size_t size; 575 size_t stride; 576 real* data; 577 gsl_block_long_double* block; 578 int owner; 579 } 580 581 struct _gsl_vector_long_double_view 582 { 583 gsl_vector_long_double vector; 584 } 585 586 struct _gsl_vector_long_double_const_view 587 { 588 gsl_vector_long_double vector; 589 } 590 591 alias _gsl_vector_long_double_view gsl_vector_long_double_view; 592 alias const _gsl_vector_long_double_const_view gsl_vector_long_double_const_view; 593 594 gsl_vector_long_double* gsl_vector_long_double_alloc (const size_t n); 595 gsl_vector_long_double* gsl_vector_long_double_calloc (const size_t n); 596 gsl_vector_long_double* gsl_vector_long_double_alloc_from_block (gsl_block_long_double* b, const size_t offset, const size_t n, const size_t stride); 597 gsl_vector_long_double* gsl_vector_long_double_alloc_from_vector (gsl_vector_long_double* v, const size_t offset, const size_t n, const size_t stride); 598 void gsl_vector_long_double_free (gsl_vector_long_double* v); 599 _gsl_vector_long_double_view gsl_vector_long_double_view_array (real* v, size_t n); 600 _gsl_vector_long_double_view gsl_vector_long_double_view_array_with_stride (real* base, size_t stride, size_t n); 601 _gsl_vector_long_double_const_view gsl_vector_long_double_const_view_array (const(real)* v, size_t n); 602 _gsl_vector_long_double_const_view gsl_vector_long_double_const_view_array_with_stride (const(real)* base, size_t stride, size_t n); 603 _gsl_vector_long_double_view gsl_vector_long_double_subvector (gsl_vector_long_double* v, size_t i, size_t n); 604 _gsl_vector_long_double_view gsl_vector_long_double_subvector_with_stride (gsl_vector_long_double* v, size_t i, size_t stride, size_t n); 605 _gsl_vector_long_double_const_view gsl_vector_long_double_const_subvector (const(gsl_vector_long_double)* v, size_t i, size_t n); 606 _gsl_vector_long_double_const_view gsl_vector_long_double_const_subvector_with_stride (const(gsl_vector_long_double)* v, size_t i, size_t stride, size_t n); 607 void gsl_vector_long_double_set_zero (gsl_vector_long_double* v); 608 void gsl_vector_long_double_set_all (gsl_vector_long_double* v, real x); 609 int gsl_vector_long_double_set_basis (gsl_vector_long_double* v, size_t i); 610 int gsl_vector_long_double_fread (FILE* stream, gsl_vector_long_double* v); 611 int gsl_vector_long_double_fwrite (FILE* stream, const(gsl_vector_long_double)* v); 612 int gsl_vector_long_double_fscanf (FILE* stream, gsl_vector_long_double* v); 613 int gsl_vector_long_double_fprintf (FILE* stream, const(gsl_vector_long_double)* v, const(char)* format); 614 int gsl_vector_long_double_memcpy (gsl_vector_long_double* dest, const(gsl_vector_long_double)* src); 615 int gsl_vector_long_double_reverse (gsl_vector_long_double* v); 616 int gsl_vector_long_double_swap (gsl_vector_long_double* v, gsl_vector_long_double* w); 617 int gsl_vector_long_double_swap_elements (gsl_vector_long_double* v, const size_t i, const size_t j); 618 real gsl_vector_long_double_max (const(gsl_vector_long_double)* v); 619 real gsl_vector_long_double_min (const(gsl_vector_long_double)* v); 620 void gsl_vector_long_double_minmax (const(gsl_vector_long_double)* v, real* min_out, real* max_out); 621 size_t gsl_vector_long_double_max_index (const(gsl_vector_long_double)* v); 622 size_t gsl_vector_long_double_min_index (const(gsl_vector_long_double)* v); 623 void gsl_vector_long_double_minmax_index (const(gsl_vector_long_double)* v, size_t* imin, size_t* imax); 624 int gsl_vector_long_double_add (gsl_vector_long_double* a, const(gsl_vector_long_double)* b); 625 int gsl_vector_long_double_sub (gsl_vector_long_double* a, const(gsl_vector_long_double)* b); 626 int gsl_vector_long_double_mul (gsl_vector_long_double* a, const(gsl_vector_long_double)* b); 627 int gsl_vector_long_double_div (gsl_vector_long_double* a, const(gsl_vector_long_double)* b); 628 int gsl_vector_long_double_scale (gsl_vector_long_double* a, const double x); 629 int gsl_vector_long_double_add_constant (gsl_vector_long_double* a, const double x); 630 int gsl_vector_long_double_equal (const(gsl_vector_long_double)* u, const(gsl_vector_long_double)* v); 631 int gsl_vector_long_double_isnull (const(gsl_vector_long_double)* v); 632 int gsl_vector_long_double_ispos (const(gsl_vector_long_double)* v); 633 int gsl_vector_long_double_isneg (const(gsl_vector_long_double)* v); 634 int gsl_vector_long_double_isnonneg (const(gsl_vector_long_double)* v); 635 real gsl_vector_long_double_get (const(gsl_vector_long_double)* v, const size_t i); 636 void gsl_vector_long_double_set (gsl_vector_long_double* v, const size_t i, real x); 637 real* gsl_vector_long_double_ptr (gsl_vector_long_double* v, const size_t i); 638 const(real)* gsl_vector_long_double_const_ptr (const(gsl_vector_long_double)* v, const size_t i); 639 640 //gsl_vector_short 641 struct gsl_vector_short 642 { 643 size_t size; 644 size_t stride; 645 short* data; 646 gsl_block_short* block; 647 int owner; 648 } 649 650 struct _gsl_vector_short_view 651 { 652 gsl_vector_short vector; 653 } 654 655 struct _gsl_vector_short_const_view 656 { 657 gsl_vector_short vector; 658 } 659 660 661 alias _gsl_vector_short_view gsl_vector_short_view; 662 alias const _gsl_vector_short_const_view gsl_vector_short_const_view; 663 664 gsl_vector_short* gsl_vector_short_alloc (const size_t n); 665 gsl_vector_short* gsl_vector_short_calloc (const size_t n); 666 gsl_vector_short* gsl_vector_short_alloc_from_block (gsl_block_short* b, const size_t offset, const size_t n, const size_t stride); 667 gsl_vector_short* gsl_vector_short_alloc_from_vector (gsl_vector_short* v, const size_t offset, const size_t n, const size_t stride); 668 void gsl_vector_short_free (gsl_vector_short* v); 669 _gsl_vector_short_view gsl_vector_short_view_array (short* v, size_t n); 670 _gsl_vector_short_view gsl_vector_short_view_array_with_stride (short* base, size_t stride, size_t n); 671 _gsl_vector_short_const_view gsl_vector_short_const_view_array (const(short)* v, size_t n); 672 _gsl_vector_short_const_view gsl_vector_short_const_view_array_with_stride (const(short)* base, size_t stride, size_t n); 673 _gsl_vector_short_view gsl_vector_short_subvector (gsl_vector_short* v, size_t i, size_t n); 674 _gsl_vector_short_view gsl_vector_short_subvector_with_stride (gsl_vector_short* v, size_t i, size_t stride, size_t n); 675 _gsl_vector_short_const_view gsl_vector_short_const_subvector (const(gsl_vector_short)* v, size_t i, size_t n); 676 _gsl_vector_short_const_view gsl_vector_short_const_subvector_with_stride (const(gsl_vector_short)* v, size_t i, size_t stride, size_t n); 677 void gsl_vector_short_set_zero (gsl_vector_short* v); 678 void gsl_vector_short_set_all (gsl_vector_short* v, short x); 679 int gsl_vector_short_set_basis (gsl_vector_short* v, size_t i); 680 int gsl_vector_short_fread (FILE* stream, gsl_vector_short* v); 681 int gsl_vector_short_fwrite (FILE* stream, const(gsl_vector_short)* v); 682 int gsl_vector_short_fscanf (FILE* stream, gsl_vector_short* v); 683 int gsl_vector_short_fprintf (FILE* stream, const(gsl_vector_short)* v, const(char)* format); 684 int gsl_vector_short_memcpy (gsl_vector_short* dest, const(gsl_vector_short)* src); 685 int gsl_vector_short_reverse (gsl_vector_short* v); 686 int gsl_vector_short_swap (gsl_vector_short* v, gsl_vector_short* w); 687 int gsl_vector_short_swap_elements (gsl_vector_short* v, const size_t i, const size_t j); 688 short gsl_vector_short_max (const(gsl_vector_short)* v); 689 short gsl_vector_short_min (const(gsl_vector_short)* v); 690 void gsl_vector_short_minmax (const(gsl_vector_short)* v, short* min_out, short* max_out); 691 size_t gsl_vector_short_max_index (const(gsl_vector_short)* v); 692 size_t gsl_vector_short_min_index (const(gsl_vector_short)* v); 693 void gsl_vector_short_minmax_index (const(gsl_vector_short)* v, size_t* imin, size_t* imax); 694 int gsl_vector_short_add (gsl_vector_short* a, const(gsl_vector_short)* b); 695 int gsl_vector_short_sub (gsl_vector_short* a, const(gsl_vector_short)* b); 696 int gsl_vector_short_mul (gsl_vector_short* a, const(gsl_vector_short)* b); 697 int gsl_vector_short_div (gsl_vector_short* a, const(gsl_vector_short)* b); 698 int gsl_vector_short_scale (gsl_vector_short* a, const double x); 699 int gsl_vector_short_add_constant (gsl_vector_short* a, const double x); 700 int gsl_vector_short_equal (const(gsl_vector_short)* u, const(gsl_vector_short)* v); 701 int gsl_vector_short_isnull (const(gsl_vector_short)* v); 702 int gsl_vector_short_ispos (const(gsl_vector_short)* v); 703 int gsl_vector_short_isneg (const(gsl_vector_short)* v); 704 int gsl_vector_short_isnonneg (const(gsl_vector_short)* v); 705 short gsl_vector_short_get (const(gsl_vector_short)* v, const size_t i); 706 void gsl_vector_short_set (gsl_vector_short* v, const size_t i, short x); 707 short* gsl_vector_short_ptr (gsl_vector_short* v, const size_t i); 708 const(short)* gsl_vector_short_const_ptr (const(gsl_vector_short)* v, const size_t i); 709 710 711 //gsl_vector_uchar 712 struct gsl_vector_uchar 713 { 714 size_t size; 715 size_t stride; 716 ubyte* data; 717 gsl_block_uchar* block; 718 int owner; 719 } 720 721 struct _gsl_vector_uchar_view 722 { 723 gsl_vector_uchar vector; 724 } 725 726 struct _gsl_vector_uchar_const_view 727 { 728 gsl_vector_uchar vector; 729 } 730 731 alias _gsl_vector_uchar_view gsl_vector_uchar_view; 732 alias const _gsl_vector_uchar_const_view gsl_vector_uchar_const_view; 733 734 gsl_vector_uchar* gsl_vector_uchar_alloc (const size_t n); 735 gsl_vector_uchar* gsl_vector_uchar_calloc (const size_t n); 736 gsl_vector_uchar* gsl_vector_uchar_alloc_from_block (gsl_block_uchar* b, const size_t offset, const size_t n, const size_t stride); 737 gsl_vector_uchar* gsl_vector_uchar_alloc_from_vector (gsl_vector_uchar* v, const size_t offset, const size_t n, const size_t stride); 738 void gsl_vector_uchar_free (gsl_vector_uchar* v); 739 _gsl_vector_uchar_view gsl_vector_uchar_view_array (ubyte* v, size_t n); 740 _gsl_vector_uchar_view gsl_vector_uchar_view_array_with_stride (ubyte* base, size_t stride, size_t n); 741 _gsl_vector_uchar_const_view gsl_vector_uchar_const_view_array (const(ubyte)* v, size_t n); 742 _gsl_vector_uchar_const_view gsl_vector_uchar_const_view_array_with_stride (const(ubyte)* base, size_t stride, size_t n); 743 _gsl_vector_uchar_view gsl_vector_uchar_subvector (gsl_vector_uchar* v, size_t i, size_t n); 744 _gsl_vector_uchar_view gsl_vector_uchar_subvector_with_stride (gsl_vector_uchar* v, size_t i, size_t stride, size_t n); 745 _gsl_vector_uchar_const_view gsl_vector_uchar_const_subvector (const(gsl_vector_uchar)* v, size_t i, size_t n); 746 _gsl_vector_uchar_const_view gsl_vector_uchar_const_subvector_with_stride (const(gsl_vector_uchar)* v, size_t i, size_t stride, size_t n); 747 void gsl_vector_uchar_set_zero (gsl_vector_uchar* v); 748 void gsl_vector_uchar_set_all (gsl_vector_uchar* v, ubyte x); 749 int gsl_vector_uchar_set_basis (gsl_vector_uchar* v, size_t i); 750 int gsl_vector_uchar_fread (FILE* stream, gsl_vector_uchar* v); 751 int gsl_vector_uchar_fwrite (FILE* stream, const(gsl_vector_uchar)* v); 752 int gsl_vector_uchar_fscanf (FILE* stream, gsl_vector_uchar* v); 753 int gsl_vector_uchar_fprintf (FILE* stream, const(gsl_vector_uchar)* v, const(char)* format); 754 int gsl_vector_uchar_memcpy (gsl_vector_uchar* dest, const(gsl_vector_uchar)* src); 755 int gsl_vector_uchar_reverse (gsl_vector_uchar* v); 756 int gsl_vector_uchar_swap (gsl_vector_uchar* v, gsl_vector_uchar* w); 757 int gsl_vector_uchar_swap_elements (gsl_vector_uchar* v, const size_t i, const size_t j); 758 ubyte gsl_vector_uchar_max (const(gsl_vector_uchar)* v); 759 ubyte gsl_vector_uchar_min (const(gsl_vector_uchar)* v); 760 void gsl_vector_uchar_minmax (const(gsl_vector_uchar)* v, ubyte* min_out, ubyte* max_out); 761 size_t gsl_vector_uchar_max_index (const(gsl_vector_uchar)* v); 762 size_t gsl_vector_uchar_min_index (const(gsl_vector_uchar)* v); 763 void gsl_vector_uchar_minmax_index (const(gsl_vector_uchar)* v, size_t* imin, size_t* imax); 764 int gsl_vector_uchar_add (gsl_vector_uchar* a, const(gsl_vector_uchar)* b); 765 int gsl_vector_uchar_sub (gsl_vector_uchar* a, const(gsl_vector_uchar)* b); 766 int gsl_vector_uchar_mul (gsl_vector_uchar* a, const(gsl_vector_uchar)* b); 767 int gsl_vector_uchar_div (gsl_vector_uchar* a, const(gsl_vector_uchar)* b); 768 int gsl_vector_uchar_scale (gsl_vector_uchar* a, const double x); 769 int gsl_vector_uchar_add_constant (gsl_vector_uchar* a, const double x); 770 int gsl_vector_uchar_equal (const(gsl_vector_uchar)* u, const(gsl_vector_uchar)* v); 771 int gsl_vector_uchar_isnull (const(gsl_vector_uchar)* v); 772 int gsl_vector_uchar_ispos (const(gsl_vector_uchar)* v); 773 int gsl_vector_uchar_isneg (const(gsl_vector_uchar)* v); 774 int gsl_vector_uchar_isnonneg (const(gsl_vector_uchar)* v); 775 ubyte gsl_vector_uchar_get (const(gsl_vector_uchar)* v, const size_t i); 776 void gsl_vector_uchar_set (gsl_vector_uchar* v, const size_t i, ubyte x); 777 ubyte* gsl_vector_uchar_ptr (gsl_vector_uchar* v, const size_t i); 778 const(ubyte)* gsl_vector_uchar_const_ptr (const(gsl_vector_uchar)* v, const size_t i); 779 780 781 //gsl_vector_uint 782 struct gsl_vector_uint 783 { 784 size_t size; 785 size_t stride; 786 uint* data; 787 gsl_block_uint* block; 788 int owner; 789 } 790 791 struct _gsl_vector_uint_view 792 { 793 gsl_vector_uint vector; 794 } 795 796 struct _gsl_vector_uint_const_view 797 { 798 gsl_vector_uint vector; 799 } 800 801 alias _gsl_vector_uint_view gsl_vector_uint_view; 802 alias const _gsl_vector_uint_const_view gsl_vector_uint_const_view; 803 804 805 gsl_vector_uint* gsl_vector_uint_alloc (const size_t n); 806 gsl_vector_uint* gsl_vector_uint_calloc (const size_t n); 807 gsl_vector_uint* gsl_vector_uint_alloc_from_block (gsl_block_uint* b, const size_t offset, const size_t n, const size_t stride); 808 gsl_vector_uint* gsl_vector_uint_alloc_from_vector (gsl_vector_uint* v, const size_t offset, const size_t n, const size_t stride); 809 void gsl_vector_uint_free (gsl_vector_uint* v); 810 _gsl_vector_uint_view gsl_vector_uint_view_array (uint* v, size_t n); 811 _gsl_vector_uint_view gsl_vector_uint_view_array_with_stride (uint* base, size_t stride, size_t n); 812 _gsl_vector_uint_const_view gsl_vector_uint_const_view_array (const(uint)* v, size_t n); 813 _gsl_vector_uint_const_view gsl_vector_uint_const_view_array_with_stride (const(uint)* base, size_t stride, size_t n); 814 _gsl_vector_uint_view gsl_vector_uint_subvector (gsl_vector_uint* v, size_t i, size_t n); 815 _gsl_vector_uint_view gsl_vector_uint_subvector_with_stride (gsl_vector_uint* v, size_t i, size_t stride, size_t n); 816 _gsl_vector_uint_const_view gsl_vector_uint_const_subvector (const(gsl_vector_uint)* v, size_t i, size_t n); 817 _gsl_vector_uint_const_view gsl_vector_uint_const_subvector_with_stride (const(gsl_vector_uint)* v, size_t i, size_t stride, size_t n); 818 void gsl_vector_uint_set_zero (gsl_vector_uint* v); 819 void gsl_vector_uint_set_all (gsl_vector_uint* v, uint x); 820 int gsl_vector_uint_set_basis (gsl_vector_uint* v, size_t i); 821 int gsl_vector_uint_fread (FILE* stream, gsl_vector_uint* v); 822 int gsl_vector_uint_fwrite (FILE* stream, const(gsl_vector_uint)* v); 823 int gsl_vector_uint_fscanf (FILE* stream, gsl_vector_uint* v); 824 int gsl_vector_uint_fprintf (FILE* stream, const(gsl_vector_uint)* v, const(char)* format); 825 int gsl_vector_uint_memcpy (gsl_vector_uint* dest, const(gsl_vector_uint)* src); 826 int gsl_vector_uint_reverse (gsl_vector_uint* v); 827 int gsl_vector_uint_swap (gsl_vector_uint* v, gsl_vector_uint* w); 828 int gsl_vector_uint_swap_elements (gsl_vector_uint* v, const size_t i, const size_t j); 829 uint gsl_vector_uint_max (const(gsl_vector_uint)* v); 830 uint gsl_vector_uint_min (const(gsl_vector_uint)* v); 831 void gsl_vector_uint_minmax (const(gsl_vector_uint)* v, uint* min_out, uint* max_out); 832 size_t gsl_vector_uint_max_index (const(gsl_vector_uint)* v); 833 size_t gsl_vector_uint_min_index (const(gsl_vector_uint)* v); 834 void gsl_vector_uint_minmax_index (const(gsl_vector_uint)* v, size_t* imin, size_t* imax); 835 int gsl_vector_uint_add (gsl_vector_uint* a, const(gsl_vector_uint)* b); 836 int gsl_vector_uint_sub (gsl_vector_uint* a, const(gsl_vector_uint)* b); 837 int gsl_vector_uint_mul (gsl_vector_uint* a, const(gsl_vector_uint)* b); 838 int gsl_vector_uint_div (gsl_vector_uint* a, const(gsl_vector_uint)* b); 839 int gsl_vector_uint_scale (gsl_vector_uint* a, const double x); 840 int gsl_vector_uint_add_constant (gsl_vector_uint* a, const double x); 841 int gsl_vector_uint_equal (const(gsl_vector_uint)* u, const(gsl_vector_uint)* v); 842 int gsl_vector_uint_isnull (const(gsl_vector_uint)* v); 843 int gsl_vector_uint_ispos (const(gsl_vector_uint)* v); 844 int gsl_vector_uint_isneg (const(gsl_vector_uint)* v); 845 int gsl_vector_uint_isnonneg (const(gsl_vector_uint)* v); 846 uint gsl_vector_uint_get (const(gsl_vector_uint)* v, const size_t i); 847 void gsl_vector_uint_set (gsl_vector_uint* v, const size_t i, uint x); 848 uint* gsl_vector_uint_ptr (gsl_vector_uint* v, const size_t i); 849 const(uint)* gsl_vector_uint_const_ptr (const(gsl_vector_uint)* v, const size_t i); 850 851 //gsl_vector_ulong 852 struct gsl_vector_ulong 853 { 854 size_t size; 855 size_t stride; 856 c_ulong* data; 857 gsl_block_ulong* block; 858 int owner; 859 } 860 861 struct _gsl_vector_ulong_view 862 { 863 gsl_vector_ulong vector; 864 } 865 866 struct _gsl_vector_ulong_const_view 867 { 868 gsl_vector_ulong vector; 869 } 870 871 alias _gsl_vector_ulong_view gsl_vector_ulong_view; 872 alias const _gsl_vector_ulong_const_view gsl_vector_ulong_const_view; 873 874 gsl_vector_ulong* gsl_vector_ulong_alloc (const size_t n); 875 gsl_vector_ulong* gsl_vector_ulong_calloc (const size_t n); 876 gsl_vector_ulong* gsl_vector_ulong_alloc_from_block (gsl_block_ulong* b, const size_t offset, const size_t n, const size_t stride); 877 gsl_vector_ulong* gsl_vector_ulong_alloc_from_vector (gsl_vector_ulong* v, const size_t offset, const size_t n, const size_t stride); 878 void gsl_vector_ulong_free (gsl_vector_ulong* v); 879 _gsl_vector_ulong_view gsl_vector_ulong_view_array (c_ulong* v, size_t n); 880 _gsl_vector_ulong_view gsl_vector_ulong_view_array_with_stride (c_ulong* base, size_t stride, size_t n); 881 _gsl_vector_ulong_const_view gsl_vector_ulong_const_view_array (const(c_ulong)* v, size_t n); 882 _gsl_vector_ulong_const_view gsl_vector_ulong_const_view_array_with_stride (const(c_ulong)* base, size_t stride, size_t n); 883 _gsl_vector_ulong_view gsl_vector_ulong_subvector (gsl_vector_ulong* v, size_t i, size_t n); 884 _gsl_vector_ulong_view gsl_vector_ulong_subvector_with_stride (gsl_vector_ulong* v, size_t i, size_t stride, size_t n); 885 _gsl_vector_ulong_const_view gsl_vector_ulong_const_subvector (const(gsl_vector_ulong)* v, size_t i, size_t n); 886 _gsl_vector_ulong_const_view gsl_vector_ulong_const_subvector_with_stride (const(gsl_vector_ulong)* v, size_t i, size_t stride, size_t n); 887 void gsl_vector_ulong_set_zero (gsl_vector_ulong* v); 888 void gsl_vector_ulong_set_all (gsl_vector_ulong* v, c_ulong x); 889 int gsl_vector_ulong_set_basis (gsl_vector_ulong* v, size_t i); 890 int gsl_vector_ulong_fread (FILE* stream, gsl_vector_ulong* v); 891 int gsl_vector_ulong_fwrite (FILE* stream, const(gsl_vector_ulong)* v); 892 int gsl_vector_ulong_fscanf (FILE* stream, gsl_vector_ulong* v); 893 int gsl_vector_ulong_fprintf (FILE* stream, const(gsl_vector_ulong)* v, const(char)* format); 894 int gsl_vector_ulong_memcpy (gsl_vector_ulong* dest, const(gsl_vector_ulong)* src); 895 int gsl_vector_ulong_reverse (gsl_vector_ulong* v); 896 int gsl_vector_ulong_swap (gsl_vector_ulong* v, gsl_vector_ulong* w); 897 int gsl_vector_ulong_swap_elements (gsl_vector_ulong* v, const size_t i, const size_t j); 898 c_ulong gsl_vector_ulong_max (const(gsl_vector_ulong)* v); 899 c_ulong gsl_vector_ulong_min (const(gsl_vector_ulong)* v); 900 void gsl_vector_ulong_minmax (const(gsl_vector_ulong)* v, c_ulong* min_out, c_ulong* max_out); 901 size_t gsl_vector_ulong_max_index (const(gsl_vector_ulong)* v); 902 size_t gsl_vector_ulong_min_index (const(gsl_vector_ulong)* v); 903 void gsl_vector_ulong_minmax_index (const(gsl_vector_ulong)* v, size_t* imin, size_t* imax); 904 int gsl_vector_ulong_add (gsl_vector_ulong* a, const(gsl_vector_ulong)* b); 905 int gsl_vector_ulong_sub (gsl_vector_ulong* a, const(gsl_vector_ulong)* b); 906 int gsl_vector_ulong_mul (gsl_vector_ulong* a, const(gsl_vector_ulong)* b); 907 int gsl_vector_ulong_div (gsl_vector_ulong* a, const(gsl_vector_ulong)* b); 908 int gsl_vector_ulong_scale (gsl_vector_ulong* a, const double x); 909 int gsl_vector_ulong_add_constant (gsl_vector_ulong* a, const double x); 910 int gsl_vector_ulong_equal (const(gsl_vector_ulong)* u, const(gsl_vector_ulong)* v); 911 int gsl_vector_ulong_isnull (const(gsl_vector_ulong)* v); 912 int gsl_vector_ulong_ispos (const(gsl_vector_ulong)* v); 913 int gsl_vector_ulong_isneg (const(gsl_vector_ulong)* v); 914 int gsl_vector_ulong_isnonneg (const(gsl_vector_ulong)* v); 915 c_ulong gsl_vector_ulong_get (const(gsl_vector_ulong)* v, const size_t i); 916 void gsl_vector_ulong_set (gsl_vector_ulong* v, const size_t i, c_ulong x); 917 c_ulong* gsl_vector_ulong_ptr (gsl_vector_ulong* v, const size_t i); 918 const(c_ulong)* gsl_vector_ulong_const_ptr (const(gsl_vector_ulong)* v, const size_t i); 919 920 //gsl_vector_ushort 921 struct gsl_vector_ushort 922 { 923 size_t size; 924 size_t stride; 925 ushort* data; 926 gsl_block_ushort* block; 927 int owner; 928 } 929 930 struct _gsl_vector_ushort_view 931 { 932 gsl_vector_ushort vector; 933 } 934 935 936 struct _gsl_vector_ushort_const_view 937 { 938 gsl_vector_ushort vector; 939 } 940 941 alias _gsl_vector_ushort_view gsl_vector_ushort_view; 942 alias const _gsl_vector_ushort_const_view gsl_vector_ushort_const_view; 943 944 gsl_vector_ushort* gsl_vector_ushort_alloc (const size_t n); 945 gsl_vector_ushort* gsl_vector_ushort_calloc (const size_t n); 946 gsl_vector_ushort* gsl_vector_ushort_alloc_from_block (gsl_block_ushort* b, const size_t offset, const size_t n, const size_t stride); 947 gsl_vector_ushort* gsl_vector_ushort_alloc_from_vector (gsl_vector_ushort* v, const size_t offset, const size_t n, const size_t stride); 948 void gsl_vector_ushort_free (gsl_vector_ushort* v); 949 _gsl_vector_ushort_view gsl_vector_ushort_view_array (ushort* v, size_t n); 950 _gsl_vector_ushort_view gsl_vector_ushort_view_array_with_stride (ushort* base, size_t stride, size_t n); 951 _gsl_vector_ushort_const_view gsl_vector_ushort_const_view_array (const(ushort)* v, size_t n); 952 _gsl_vector_ushort_const_view gsl_vector_ushort_const_view_array_with_stride (const(ushort)* base, size_t stride, size_t n); 953 _gsl_vector_ushort_view gsl_vector_ushort_subvector (gsl_vector_ushort* v, size_t i, size_t n); 954 _gsl_vector_ushort_view gsl_vector_ushort_subvector_with_stride (gsl_vector_ushort* v, size_t i, size_t stride, size_t n); 955 _gsl_vector_ushort_const_view gsl_vector_ushort_const_subvector (const(gsl_vector_ushort)* v, size_t i, size_t n); 956 _gsl_vector_ushort_const_view gsl_vector_ushort_const_subvector_with_stride (const(gsl_vector_ushort)* v, size_t i, size_t stride, size_t n); 957 void gsl_vector_ushort_set_zero (gsl_vector_ushort* v); 958 void gsl_vector_ushort_set_all (gsl_vector_ushort* v, ushort x); 959 int gsl_vector_ushort_set_basis (gsl_vector_ushort* v, size_t i); 960 int gsl_vector_ushort_fread (FILE* stream, gsl_vector_ushort* v); 961 int gsl_vector_ushort_fwrite (FILE* stream, const(gsl_vector_ushort)* v); 962 int gsl_vector_ushort_fscanf (FILE* stream, gsl_vector_ushort* v); 963 int gsl_vector_ushort_fprintf (FILE* stream, const(gsl_vector_ushort)* v, const(char)* format); 964 int gsl_vector_ushort_memcpy (gsl_vector_ushort* dest, const(gsl_vector_ushort)* src); 965 int gsl_vector_ushort_reverse (gsl_vector_ushort* v); 966 int gsl_vector_ushort_swap (gsl_vector_ushort* v, gsl_vector_ushort* w); 967 int gsl_vector_ushort_swap_elements (gsl_vector_ushort* v, const size_t i, const size_t j); 968 ushort gsl_vector_ushort_max (const(gsl_vector_ushort)* v); 969 ushort gsl_vector_ushort_min (const(gsl_vector_ushort)* v); 970 void gsl_vector_ushort_minmax (const(gsl_vector_ushort)* v, ushort* min_out, ushort* max_out); 971 size_t gsl_vector_ushort_max_index (const(gsl_vector_ushort)* v); 972 size_t gsl_vector_ushort_min_index (const(gsl_vector_ushort)* v); 973 void gsl_vector_ushort_minmax_index (const(gsl_vector_ushort)* v, size_t* imin, size_t* imax); 974 int gsl_vector_ushort_add (gsl_vector_ushort* a, const(gsl_vector_ushort)* b); 975 int gsl_vector_ushort_sub (gsl_vector_ushort* a, const(gsl_vector_ushort)* b); 976 int gsl_vector_ushort_mul (gsl_vector_ushort* a, const(gsl_vector_ushort)* b); 977 int gsl_vector_ushort_div (gsl_vector_ushort* a, const(gsl_vector_ushort)* b); 978 int gsl_vector_ushort_scale (gsl_vector_ushort* a, const double x); 979 int gsl_vector_ushort_add_constant (gsl_vector_ushort* a, const double x); 980 int gsl_vector_ushort_equal (const(gsl_vector_ushort)* u, const(gsl_vector_ushort)* v); 981 int gsl_vector_ushort_isnull (const(gsl_vector_ushort)* v); 982 int gsl_vector_ushort_ispos (const(gsl_vector_ushort)* v); 983 int gsl_vector_ushort_isneg (const(gsl_vector_ushort)* v); 984 int gsl_vector_ushort_isnonneg (const(gsl_vector_ushort)* v); 985 ushort gsl_vector_ushort_get (const(gsl_vector_ushort)* v, const size_t i); 986 void gsl_vector_ushort_set (gsl_vector_ushort* v, const size_t i, ushort x); 987 ushort* gsl_vector_ushort_ptr (gsl_vector_ushort* v, const size_t i); 988 const(ushort)* gsl_vector_ushort_const_ptr (const(gsl_vector_ushort)* v, const size_t i); 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005