diff --git a/permutation_test/Makefile b/ypermutation_t/Makefile similarity index 100% rename from permutation_test/Makefile rename to ypermutation_t/Makefile diff --git a/permutation_test/compile.sh b/ypermutation_t/compile.sh similarity index 100% rename from permutation_test/compile.sh rename to ypermutation_t/compile.sh diff --git a/permutation_test/is_good.c b/ypermutation_t/is_good.c similarity index 100% rename from permutation_test/is_good.c rename to ypermutation_t/is_good.c diff --git a/permutation_test/isgood.cu b/ypermutation_t/isgood.cu similarity index 100% rename from permutation_test/isgood.cu rename to ypermutation_t/isgood.cu diff --git a/permutation_test/src/Makefile b/ypermutation_t/src/Makefile similarity index 100% rename from permutation_test/src/Makefile rename to ypermutation_t/src/Makefile diff --git a/permutation_test/src/coordinate/coordinate.h b/ypermutation_t/src/coordinate/coordinate.h similarity index 100% rename from permutation_test/src/coordinate/coordinate.h rename to ypermutation_t/src/coordinate/coordinate.h diff --git a/permutation_test/src/dimension/dimension.cpp b/ypermutation_t/src/dimension/dimension.cpp similarity index 100% rename from permutation_test/src/dimension/dimension.cpp rename to ypermutation_t/src/dimension/dimension.cpp diff --git a/permutation_test/src/dimension/dimension.h b/ypermutation_t/src/dimension/dimension.h similarity index 100% rename from permutation_test/src/dimension/dimension.h rename to ypermutation_t/src/dimension/dimension.h diff --git a/permutation_test/src/dimension/dimension.hpp b/ypermutation_t/src/dimension/dimension.hpp similarity index 100% rename from permutation_test/src/dimension/dimension.hpp rename to ypermutation_t/src/dimension/dimension.hpp diff --git a/permutation_test/src/dimension_t/dimension.cpp b/ypermutation_t/src/dimension_t/dimension.cpp similarity index 100% rename from permutation_test/src/dimension_t/dimension.cpp rename to ypermutation_t/src/dimension_t/dimension.cpp diff --git a/permutation_test/src/dimension_t/dimension.h b/ypermutation_t/src/dimension_t/dimension.h similarity index 100% rename from permutation_test/src/dimension_t/dimension.h rename to ypermutation_t/src/dimension_t/dimension.h diff --git a/permutation_test/src/dimension_t/dimension.hpp b/ypermutation_t/src/dimension_t/dimension.hpp similarity index 100% rename from permutation_test/src/dimension_t/dimension.hpp rename to ypermutation_t/src/dimension_t/dimension.hpp diff --git a/permutation_test/src/dimension_t/dimension_t.h b/ypermutation_t/src/dimension_t/dimension_t.h similarity index 100% rename from permutation_test/src/dimension_t/dimension_t.h rename to ypermutation_t/src/dimension_t/dimension_t.h diff --git a/permutation_test/src/is_good.c b/ypermutation_t/src/is_good.c similarity index 100% rename from permutation_test/src/is_good.c rename to ypermutation_t/src/is_good.c diff --git a/permutation_test/src/permutation_t/permutation_t.c b/ypermutation_t/src/permutation_t/permutation_t.c similarity index 90% rename from permutation_test/src/permutation_t/permutation_t.c rename to ypermutation_t/src/permutation_t/permutation_t.c index d8a2bd1..4ed6cdb 100644 --- a/permutation_test/src/permutation_t/permutation_t.c +++ b/ypermutation_t/src/permutation_t/permutation_t.c @@ -28,6 +28,10 @@ GENERATE_PERMUTATION_FUNCTIONS_UNSIGNED(TYPE_U_INT) GENERATE_PERMUTATION_FUNCTIONS_UNSIGNED(TYPE_U_L_INT) GENERATE_PERMUTATION_FUNCTIONS_UNSIGNED(TYPE_SIZE_T) +int sign(long int a){ + if (a<0) return -1; + return 1; +} #define GENERATE_PERMUTATION_FUNCTIONS(type)\ PERMUTATION_##type * CREATE_PERMUTATION_##type(size_t size){\ @@ -67,6 +71,19 @@ GENERATE_PERMUTATION_FUNCTIONS_UNSIGNED(TYPE_SIZE_T) free(t_p);\ return ret; \ }\ + \ + int signature_##type(const PERMUTATION_##type *p){\ + PERMUTATION_TYPE_SIZE_T *t_p = TRANSLATE_TO_SET_THEORIC_SIZE_T_##type(p);\ + int ss = 1;\ + for (size_t i = 0; i < t_p->size; ++i) {\ + for (size_t j = i + 1; j < t_p->size; ++j) {\ + ss *= sign((long int)(t_p->perm[j]) - (long int)(t_p->perm[i]));/* sign(j - i);*/\ + }\ + }\ + return ss;\ + }\ + \ + diff --git a/permutation_test/src/permutation_t/permutation_t.h b/ypermutation_t/src/permutation_t/permutation_t.h similarity index 100% rename from permutation_test/src/permutation_t/permutation_t.h rename to ypermutation_t/src/permutation_t/permutation_t.h diff --git a/permutation_test/src/set_theoric_t/set_theoric_t.c b/ypermutation_t/src/set_theoric_t/set_theoric_t.c similarity index 100% rename from permutation_test/src/set_theoric_t/set_theoric_t.c rename to ypermutation_t/src/set_theoric_t/set_theoric_t.c diff --git a/permutation_test/src/set_theoric_t/set_theoric_t.h b/ypermutation_t/src/set_theoric_t/set_theoric_t.h similarity index 100% rename from permutation_test/src/set_theoric_t/set_theoric_t.h rename to ypermutation_t/src/set_theoric_t/set_theoric_t.h diff --git a/permutation_test/src/tensor/tens0neD/tens0neD.cpp b/ypermutation_t/src/tensor/tens0neD/tens0neD.cpp similarity index 100% rename from permutation_test/src/tensor/tens0neD/tens0neD.cpp rename to ypermutation_t/src/tensor/tens0neD/tens0neD.cpp diff --git a/permutation_test/src/tensor/tens0neD/tens0neD.h b/ypermutation_t/src/tensor/tens0neD/tens0neD.h similarity index 100% rename from permutation_test/src/tensor/tens0neD/tens0neD.h rename to ypermutation_t/src/tensor/tens0neD/tens0neD.h diff --git a/permutation_test/src/tensor/tensCuda/d_tensCuda.cu b/ypermutation_t/src/tensor/tensCuda/d_tensCuda.cu similarity index 100% rename from permutation_test/src/tensor/tensCuda/d_tensCuda.cu rename to ypermutation_t/src/tensor/tensCuda/d_tensCuda.cu diff --git a/permutation_test/src/tensor/tensCuda/d_tensCuda.h b/ypermutation_t/src/tensor/tensCuda/d_tensCuda.h similarity index 100% rename from permutation_test/src/tensor/tensCuda/d_tensCuda.h rename to ypermutation_t/src/tensor/tensCuda/d_tensCuda.h diff --git a/permutation_test/src/tensor/tensCuda/tensCuda.cu b/ypermutation_t/src/tensor/tensCuda/tensCuda.cu similarity index 100% rename from permutation_test/src/tensor/tensCuda/tensCuda.cu rename to ypermutation_t/src/tensor/tensCuda/tensCuda.cu diff --git a/permutation_test/src/tensor/tensCuda/tensCuda.h b/ypermutation_t/src/tensor/tensCuda/tensCuda.h similarity index 100% rename from permutation_test/src/tensor/tensCuda/tensCuda.h rename to ypermutation_t/src/tensor/tensCuda/tensCuda.h diff --git a/Ecompile.sh b/ytest_t/Ecompile.sh similarity index 100% rename from Ecompile.sh rename to ytest_t/Ecompile.sh diff --git a/LICENSE b/ytest_t/LICENSE similarity index 100% rename from LICENSE rename to ytest_t/LICENSE diff --git a/Makefile b/ytest_t/Makefile similarity index 100% rename from Makefile rename to ytest_t/Makefile diff --git a/README.md b/ytest_t/README.md similarity index 100% rename from README.md rename to ytest_t/README.md diff --git a/example/compile.sh b/ytest_t/example/compile.sh similarity index 100% rename from example/compile.sh rename to ytest_t/example/compile.sh diff --git a/example/eg1.c b/ytest_t/example/eg1.c similarity index 100% rename from example/eg1.c rename to ytest_t/example/eg1.c diff --git a/example/run.sh b/ytest_t/example/run.sh similarity index 100% rename from example/run.sh rename to ytest_t/example/run.sh diff --git a/example/x1 b/ytest_t/example/x1 similarity index 100% rename from example/x1 rename to ytest_t/example/x1 diff --git a/include_ytest/include/bar_progress/bar_progress.h b/ytest_t/include_ytest/include/bar_progress/bar_progress.h similarity index 100% rename from include_ytest/include/bar_progress/bar_progress.h rename to ytest_t/include_ytest/include/bar_progress/bar_progress.h diff --git a/include_ytest/include/fmock/fmock.h b/ytest_t/include_ytest/include/fmock/fmock.h similarity index 100% rename from include_ytest/include/fmock/fmock.h rename to ytest_t/include_ytest/include/fmock/fmock.h diff --git a/include_ytest/include/ftest/ftest.h b/ytest_t/include_ytest/include/ftest/ftest.h similarity index 100% rename from include_ytest/include/ftest/ftest.h rename to ytest_t/include_ytest/include/ftest/ftest.h diff --git a/include_ytest/include/tools_t/tools_t.h b/ytest_t/include_ytest/include/tools_t/tools_t.h similarity index 100% rename from include_ytest/include/tools_t/tools_t.h rename to ytest_t/include_ytest/include/tools_t/tools_t.h diff --git a/install.sh b/ytest_t/install.sh similarity index 100% rename from install.sh rename to ytest_t/install.sh diff --git a/kreate_library_ytest.sh b/ytest_t/kreate_library_ytest.sh similarity index 100% rename from kreate_library_ytest.sh rename to ytest_t/kreate_library_ytest.sh diff --git a/libytest.so b/ytest_t/libytest.so similarity index 100% rename from libytest.so rename to ytest_t/libytest.so diff --git a/set_env.sh b/ytest_t/set_env.sh similarity index 100% rename from set_env.sh rename to ytest_t/set_env.sh diff --git a/test/Makefile b/ytest_t/test/Makefile similarity index 100% rename from test/Makefile rename to ytest_t/test/Makefile diff --git a/test/compile.sh b/ytest_t/test/compile.sh similarity index 100% rename from test/compile.sh rename to ytest_t/test/compile.sh diff --git a/test/is_good.c b/ytest_t/test/is_good.c similarity index 100% rename from test/is_good.c rename to ytest_t/test/is_good.c diff --git a/test/isgood.cu b/ytest_t/test/isgood.cu similarity index 100% rename from test/isgood.cu rename to ytest_t/test/isgood.cu diff --git a/test/src/Makefile b/ytest_t/test/src/Makefile similarity index 100% rename from test/src/Makefile rename to ytest_t/test/src/Makefile diff --git a/test/src/coordinate/coordinate.h b/ytest_t/test/src/coordinate/coordinate.h similarity index 100% rename from test/src/coordinate/coordinate.h rename to ytest_t/test/src/coordinate/coordinate.h diff --git a/test/src/dimension/dimension.cpp b/ytest_t/test/src/dimension/dimension.cpp similarity index 100% rename from test/src/dimension/dimension.cpp rename to ytest_t/test/src/dimension/dimension.cpp diff --git a/test/src/dimension/dimension.h b/ytest_t/test/src/dimension/dimension.h similarity index 100% rename from test/src/dimension/dimension.h rename to ytest_t/test/src/dimension/dimension.h diff --git a/test/src/dimension/dimension.hpp b/ytest_t/test/src/dimension/dimension.hpp similarity index 100% rename from test/src/dimension/dimension.hpp rename to ytest_t/test/src/dimension/dimension.hpp diff --git a/test/src/is_good.c b/ytest_t/test/src/is_good.c similarity index 100% rename from test/src/is_good.c rename to ytest_t/test/src/is_good.c diff --git a/test/src/permutation_t/permutation_t.c b/ytest_t/test/src/permutation_t/permutation_t.c similarity index 100% rename from test/src/permutation_t/permutation_t.c rename to ytest_t/test/src/permutation_t/permutation_t.c diff --git a/test/src/permutation_t/permutation_t.h b/ytest_t/test/src/permutation_t/permutation_t.h similarity index 100% rename from test/src/permutation_t/permutation_t.h rename to ytest_t/test/src/permutation_t/permutation_t.h diff --git a/test/src/set_theoric_t/set_theoric_t.c b/ytest_t/test/src/set_theoric_t/set_theoric_t.c similarity index 100% rename from test/src/set_theoric_t/set_theoric_t.c rename to ytest_t/test/src/set_theoric_t/set_theoric_t.c diff --git a/test/src/set_theoric_t/set_theoric_t.h b/ytest_t/test/src/set_theoric_t/set_theoric_t.h similarity index 100% rename from test/src/set_theoric_t/set_theoric_t.h rename to ytest_t/test/src/set_theoric_t/set_theoric_t.h diff --git a/test/src/tensor/tens0neD/tens0neD.cpp b/ytest_t/test/src/tensor/tens0neD/tens0neD.cpp similarity index 100% rename from test/src/tensor/tens0neD/tens0neD.cpp rename to ytest_t/test/src/tensor/tens0neD/tens0neD.cpp diff --git a/test/src/tensor/tens0neD/tens0neD.h b/ytest_t/test/src/tensor/tens0neD/tens0neD.h similarity index 100% rename from test/src/tensor/tens0neD/tens0neD.h rename to ytest_t/test/src/tensor/tens0neD/tens0neD.h diff --git a/test/src/tensor/tensCuda/d_tensCuda.cu b/ytest_t/test/src/tensor/tensCuda/d_tensCuda.cu similarity index 100% rename from test/src/tensor/tensCuda/d_tensCuda.cu rename to ytest_t/test/src/tensor/tensCuda/d_tensCuda.cu diff --git a/test/src/tensor/tensCuda/d_tensCuda.h b/ytest_t/test/src/tensor/tensCuda/d_tensCuda.h similarity index 100% rename from test/src/tensor/tensCuda/d_tensCuda.h rename to ytest_t/test/src/tensor/tensCuda/d_tensCuda.h diff --git a/test/src/tensor/tensCuda/tensCuda.cu b/ytest_t/test/src/tensor/tensCuda/tensCuda.cu similarity index 100% rename from test/src/tensor/tensCuda/tensCuda.cu rename to ytest_t/test/src/tensor/tensCuda/tensCuda.cu diff --git a/test/src/tensor/tensCuda/tensCuda.h b/ytest_t/test/src/tensor/tensCuda/tensCuda.h similarity index 100% rename from test/src/tensor/tensCuda/tensCuda.h rename to ytest_t/test/src/tensor/tensCuda/tensCuda.h diff --git a/uninstall.sh b/ytest_t/uninstall.sh similarity index 100% rename from uninstall.sh rename to ytest_t/uninstall.sh diff --git a/unset_env.sh b/ytest_t/unset_env.sh similarity index 100% rename from unset_env.sh rename to ytest_t/unset_env.sh diff --git a/yfmock/Makefile b/ytest_t/yfmock/Makefile similarity index 100% rename from yfmock/Makefile rename to ytest_t/yfmock/Makefile diff --git a/yfmock/include/fmock/fmock.h b/ytest_t/yfmock/include/fmock/fmock.h similarity index 100% rename from yfmock/include/fmock/fmock.h rename to ytest_t/yfmock/include/fmock/fmock.h diff --git a/yfmock/src/fmock/fmock.c b/ytest_t/yfmock/src/fmock/fmock.c similarity index 100% rename from yfmock/src/fmock/fmock.c rename to ytest_t/yfmock/src/fmock/fmock.c diff --git a/yftest/Makefile b/ytest_t/yftest/Makefile similarity index 100% rename from yftest/Makefile rename to ytest_t/yftest/Makefile diff --git a/yftest/include/ftest/ftest.h b/ytest_t/yftest/include/ftest/ftest.h similarity index 100% rename from yftest/include/ftest/ftest.h rename to ytest_t/yftest/include/ftest/ftest.h diff --git a/yftest/src/ftest/ftest.c b/ytest_t/yftest/src/ftest/ftest.c similarity index 100% rename from yftest/src/ftest/ftest.c rename to ytest_t/yftest/src/ftest/ftest.c