35 fprintf(stderr,
"Perm (%4d): ", permutation->
size);
36 for (i = 0; i < permutation->
size; i++) {
37 fprintf(stderr,
"%i ",permutation->
elements[i]);
39 fprintf(stderr,
"\n");
41 #endif // BPU_CONF_PRINT
47 for (i = 0; i < permutation->
size; i++) {
50 for (i = 0; i < permutation->
size; i++) {
72 for (i = 0; i < in->
size; i++) {
84 if (to_permute->
size != permutation->
size){
92 for (i = 0; i < to_permute->
size; i++) {
96 for (i = 0; i < permutation->
size; i++) {
107 for (i = 0; i < p->
size; i++) {
108 for (j = 0; j < p->
size; j++) {
111 #ifdef BPU_CONF_PRINT
BPU_T_Perm_Element * elements
permutation vector
void BPU_permFree(BPU_T_Perm_Vector **p)
Free dynamically or statically alocated permutation vector.
int BPU_permPermute(BPU_T_Perm_Vector *to_permute, const BPU_T_Perm_Vector *permutation)
void BPU_permSwap(BPU_T_Perm_Element *a, BPU_T_Perm_Element *b)
BPU_swap.
uint32_t BPU_prngGetRand(int from, int to)
Get random unsigned int 32 value from given range (from <= return <= to)
int BPU_permRandomize(BPU_T_Perm_Vector *permutation)
#define BPU_printError(fmt,...)
print error message with filename, line
void BPU_printPerm(const BPU_T_Perm_Vector *permutation)
BPU_T_Perm_Element size
permutation size
int BPU_permGetInv(BPU_T_Perm_Vector *out, const BPU_T_Perm_Vector *in)
uint16_t BPU_T_Perm_Element
Definition of permutation element type.
int BPU_permMalloc(BPU_T_Perm_Vector **p, int size)
Allocate permutation vector elements of size size.
int BPU_permIsValid(const BPU_T_Perm_Vector *p)
BPU_permIsValid Check wheter is permutaion valid.