| 1 | /* combination/gsl_combination.h |
| 2 | * based on permutation/gsl_permutation.h by Brian Gough |
| 3 | * |
| 4 | * Copyright (C) 2001 Szymon Jaroszewicz |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 3 of the License, or (at |
| 9 | * your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 19 | */ |
| 20 | |
| 21 | #ifndef __GSL_COMBINATION_H__ |
| 22 | #define __GSL_COMBINATION_H__cxx . . $ `external/gsl/gsl_combination.h:22:9`! |
| 23 | |
| 24 | #include <stdlib.h> |
| 25 | #include "gsl_errno.h"cxx . . $ `<file>/external/gsl/gsl_errno.h`/ |
| 26 | #include "gsl_types.h"cxx . . $ `<file>/external/gsl/gsl_types.h`/ |
| 27 | #include "gsl_check_range.h"cxx . . $ `<file>/external/gsl/gsl_check_range.h`/ |
| 28 | |
| 29 | #undef __BEGIN_DECLScxx . . $ `external/gsl/gsl_check_range.h:32:10`! |
| 30 | #undef __END_DECLScxx . . $ `external/gsl/gsl_check_range.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_combination.h:35:10`! /* empty */ |
| 36 | # define __END_DECLScxx . . $ `external/gsl/gsl_combination.h:36:10`! /* empty */ |
| 37 | #endif |
| 38 | |
| 39 | __BEGIN_DECLScxx . . $ `external/gsl/gsl_combination.h:35:10`! |
| 40 | |
| 41 | struct gsl_combination_structcxx . . $ gsl_combination_struct# |
| 42 | { |
| 43 | size_tcxx . . $ size_t# ncxx . . $ gsl_combination_struct#n.; |
| 44 | size_tcxx . . $ size_t# kcxx . . $ gsl_combination_struct#k.; |
| 45 | size_tcxx . . $ size_t# *datacxx . . $ gsl_combination_struct#data.; |
| 46 | }; |
| 47 | |
| 48 | typedef struct gsl_combination_structcxx . . $ gsl_combination_struct# gsl_combinationcxx . . $ gsl_combination#; |
| 49 | |
| 50 | gsl_combinationcxx . . $ gsl_combination# *gsl_combination_alloccxx . . $ gsl_combination_alloc(6b184067857f7842). (const size_tcxx . . $ size_t# n, const size_tcxx . . $ size_t# k); |
| 51 | gsl_combinationcxx . . $ gsl_combination# *gsl_combination_calloccxx . . $ gsl_combination_calloc(6b184067857f7842). (const size_tcxx . . $ size_t# n, const size_tcxx . . $ size_t# k); |
| 52 | void gsl_combination_init_firstcxx . . $ gsl_combination_init_first(ce74e54de15c98cd). (gsl_combinationcxx . . $ gsl_combination# * c); |
| 53 | void gsl_combination_init_lastcxx . . $ gsl_combination_init_last(ce74e54de15c98cd). (gsl_combinationcxx . . $ gsl_combination# * c); |
| 54 | void gsl_combination_freecxx . . $ gsl_combination_free(ce74e54de15c98cd). (gsl_combinationcxx . . $ gsl_combination# * c); |
| 55 | int gsl_combination_memcpycxx . . $ gsl_combination_memcpy(6268d3d6f8b3379f). (gsl_combinationcxx . . $ gsl_combination# * dest, const gsl_combinationcxx . . $ gsl_combination# * src); |
| 56 | |
| 57 | int gsl_combination_freadcxx . . $ gsl_combination_fread(9e42499e7bf363da). (FILEcxx . . $ FILE# * stream, gsl_combinationcxx . . $ gsl_combination# * c); |
| 58 | int gsl_combination_fwritecxx . . $ gsl_combination_fwrite(ee242fa2f9e118f2). (FILEcxx . . $ FILE# * stream, const gsl_combinationcxx . . $ gsl_combination# * c); |
| 59 | int gsl_combination_fscanfcxx . . $ gsl_combination_fscanf(9e42499e7bf363da). (FILEcxx . . $ FILE# * stream, gsl_combinationcxx . . $ gsl_combination# * c); |
| 60 | int gsl_combination_fprintfcxx . . $ gsl_combination_fprintf(1734ba4eef349dd3). (FILEcxx . . $ FILE# * stream, const gsl_combinationcxx . . $ gsl_combination# * c, const char *format); |
| 61 | |
| 62 | size_tcxx . . $ size_t# gsl_combination_ncxx . . $ gsl_combination_n(53f70f710faac233). (const gsl_combinationcxx . . $ gsl_combination# * c); |
| 63 | size_tcxx . . $ size_t# gsl_combination_kcxx . . $ gsl_combination_k(53f70f710faac233). (const gsl_combinationcxx . . $ gsl_combination# * c); |
| 64 | size_tcxx . . $ size_t# * gsl_combination_datacxx . . $ gsl_combination_data(e21b9f814e91ddd3). (const gsl_combinationcxx . . $ gsl_combination# * c); |
| 65 | |
| 66 | size_tcxx . . $ size_t# gsl_combination_getcxx . . $ gsl_combination_get(94685fafde97c82). (const gsl_combinationcxx . . $ gsl_combination# * c, const size_tcxx . . $ size_t# i); |
| 67 | |
| 68 | int gsl_combination_validcxx . . $ gsl_combination_valid(2123b49d6e758fad). (gsl_combinationcxx . . $ gsl_combination# * c); |
| 69 | int gsl_combination_nextcxx . . $ gsl_combination_next(2123b49d6e758fad). (gsl_combinationcxx . . $ gsl_combination# * c); |
| 70 | int gsl_combination_prevcxx . . $ gsl_combination_prev(2123b49d6e758fad). (gsl_combinationcxx . . $ gsl_combination# * c); |
| 71 | |
| 72 | #ifdef HAVE_INLINE |
| 73 | |
| 74 | extern inline |
| 75 | size_t |
| 76 | gsl_combination_get (const gsl_combination * c, const size_t i) |
| 77 | { |
| 78 | #if GSL_RANGE_CHECK |
| 79 | if (i >= c->k) |
| 80 | { |
| 81 | GSL_ERROR_VAL ("index out of range", GSL_EINVAL, 0); |
| 82 | } |
| 83 | #endif |
| 84 | return c->data[i]; |
| 85 | } |
| 86 | |
| 87 | #endif /* HAVE_INLINE */ |
| 88 | |
| 89 | __END_DECLScxx . . $ `external/gsl/gsl_combination.h:36:10`! |
| 90 | |
| 91 | #endif /* __GSL_COMBINATION_H__ */ |