add sub dimension

This commit is contained in:
2024-02-01 18:42:44 +01:00
parent c417c7aece
commit e195aee3b8
5 changed files with 45 additions and 1 deletions
@@ -42,6 +42,13 @@ int sign(long int a){
return p;\
}\
PERMUTATION_##type * INIT_PERMUTATION_##type(type *perm, size_t size){\
if (size == 0) return NULL;\
PERMUTATION_##type *p = CREATE_PERMUTATION_##type(size);\
p->perm = perm ; /*malloc(size*sizeof(type));\
for(size_t i=0;i<size;++i) p->perm[i] = perm[i];*/\
return p;\
}\
PERMUTATION_##type * INIT_COPY_PERMUTATION_##type(type *perm, size_t size){\
if (size == 0) return NULL;\
PERMUTATION_##type *p = CREATE_PERMUTATION_##type(size);\
p->perm = malloc(size*sizeof(type));\
@@ -20,6 +20,7 @@
typedef struct PERMUTATION_##type PERMUTATION_##type;\
PERMUTATION_##type * CREATE_PERMUTATION_##type(size_t size);\
PERMUTATION_##type * INIT_PERMUTATION_##type(type *perm, size_t size);\
PERMUTATION_##type * INIT_COPY_PERMUTATION_##type(type *perm, size_t size);\
PERMUTATION_TYPE_SIZE_T * TRANSLATE_TO_SET_THEORIC_SIZE_T_##type(const PERMUTATION_##type *p );\
bool IS_PERMUTATION_##type(const PERMUTATION_##type *p );\
size_t TabToPlaceAlgo_##type(const PERMUTATION_##type *p);\