00001 #ifndef NPS_PERMUTE_H 00002 #define NPS_PERMUTE_H 00003 00004 #if !defined BUILDING_NPS_PERMUTE && !defined NPS_SMALL 00005 # define NPS_PERMUTE_LKG static inline 00006 #else 00007 # define NPS_PERMUTE_LKG 00008 #endif 00009 00010 #include "nr_ran.h" 00011 #include <string.h> 00012 00013 typedef struct { 00014 nr_ran_t ran; 00015 int64_t *indices; 00016 int64_t length; 00017 } nps_permute_t; 00018 00019 NPS_PERMUTE_LKG nps_permute_t *nps_permute_new(size_t size, uint64_t seed); 00020 NPS_PERMUTE_LKG void nps_permute_shuffle(nps_permute_t *permute); 00021 NPS_PERMUTE_LKG void nps_permute_del(nps_permute_t *permute); 00022 00023 #endif 00024