pyfmtools 0.81__tar.gz → 5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyfmtools-0.81 → pyfmtools-5.2}/MANIFEST.in +1 -0
- {pyfmtools-0.81/src/pyfmtools.egg-info → pyfmtools-5.2}/PKG-INFO +3 -5
- {pyfmtools-0.81 → pyfmtools-5.2}/setup.py +2 -2
- {pyfmtools-0.81 → pyfmtools-5.2}/src/buildPyfmtools.py +24 -3
- {pyfmtools-0.81 → pyfmtools-5.2}/src/colamd.h +3 -2
- {pyfmtools-0.81 → pyfmtools-5.2}/src/commonlib.c +5 -5
- {pyfmtools-0.81 → pyfmtools-5.2}/src/commonlib.h +4 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/fmrandom.cpp +26 -4
- {pyfmtools-0.81 → pyfmtools-5.2}/src/fmrandom.h +54 -1
- pyfmtools-5.2/src/fmrandomsort.inc +1944 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/fortify.h +2 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/fuzzymeasurefit.cpp +143 -5
- {pyfmtools-0.81 → pyfmtools-5.2}/src/fuzzymeasurefit.h +6 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/fuzzymeasurefit3.cpp +440 -13
- pyfmtools-0.81/src/fuzzymeasuretools.bak.cpp → pyfmtools-5.2/src/fuzzymeasuretools.cpp +138 -163
- {pyfmtools-0.81 → pyfmtools-5.2}/src/fuzzymeasuretools.h +386 -439
- pyfmtools-5.2/src/gbrealloc.c +24 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/generaldefs.h +24 -1
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_BFP2.h +3 -3
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_MPS.c +21 -1
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_lib.c +25 -11
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_matrix.c +9 -9
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_params.c +9 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_presolve.c +9 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_price.c +13 -13
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_scale.c +1 -1
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_utils.c +2 -2
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_wlp.c +11 -2
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lpslink56.c +4 -4
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lusol.c +11 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lusol1.h +7 -7
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lusol6a.h +6 -6
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lusol6l0.h +1 -1
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lusol6u.h +1 -1
- {pyfmtools-0.81 → pyfmtools-5.2}/src/mmio.c +9 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/myblas.c +7 -7
- {pyfmtools-0.81 → pyfmtools-5.2/src/pyfmtools.egg-info}/PKG-INFO +3 -5
- {pyfmtools-0.81 → pyfmtools-5.2}/src/pyfmtools.egg-info/SOURCES.txt +3 -3
- {pyfmtools-0.81 → pyfmtools-5.2}/src/pyfmtools.py +274 -12
- {pyfmtools-0.81 → pyfmtools-5.2}/src/wrapperpy.cpp +428 -146
- {pyfmtools-0.81 → pyfmtools-5.2}/src/wrapperpy.h +435 -376
- {pyfmtools-0.81 → pyfmtools-5.2}/src/yacc_read.c +12 -2
- {pyfmtools-0.81 → pyfmtools-5.2}/tests/test_wrapper.py +226 -18
- pyfmtools-0.81/dist/pyfmtools-0.81-cp39-cp39-macosx_10_9_x86_64.whl +0 -0
- pyfmtools-0.81/src/fuzzymeasuretools.bak.h +0 -454
- pyfmtools-0.81/src/fuzzymeasuretools.cpp +0 -1951
- {pyfmtools-0.81 → pyfmtools-5.2}/LICENSE.txt +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/README.md +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/setup.cfg +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/binarylattice.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/colamd.c +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/declare.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/hbio.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/ini.c +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/ini.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/isfixedvar.c +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_BFP.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_BFP1.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_Hash.c +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_Hash.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_LUSOL.c +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_LUSOL.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_MDO.c +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_MDO.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_MPS.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_SOS.c +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_SOS.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_crash.c +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_crash.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_etaPFI.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_explicit.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_fortify.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_lib.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_matrix.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_mipbb.c +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_mipbb.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_presolve.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_price.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_pricePSE.c +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_pricePSE.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_report.c +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_report.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_rlp.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_scale.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_simplex.c +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_simplex.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_types.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_utils.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lp_wlp.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lpkit.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lpsolve.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lusol.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lusol2.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lusol7a.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lusol8a.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lusolio.c +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/lusolio.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/minimalsplus.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/mmio.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/myblas.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/pyfmtools.egg-info/dependency_links.txt +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/pyfmtools.egg-info/requires.txt +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/pyfmtools.egg-info/top_level.txt +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/sparselib.c +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/sparselib.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/stdafx.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/ufortify.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/src/yacc_read.h +0 -0
- {pyfmtools-0.81 → pyfmtools-5.2}/tests/test_no_wrapper.py +0 -0
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyfmtools
|
|
3
|
-
Version:
|
|
3
|
+
Version: 5.2
|
|
4
4
|
Summary: Library for handling and fitting fuzzy measures
|
|
5
|
-
Home-page:
|
|
5
|
+
Home-page:
|
|
6
6
|
Author: Gleb Beliakov, Norbert Henseler
|
|
7
7
|
Author-email: gleb.beliakov@deakin.edu.au, norbert.henseler@deakin.edu.au
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Platform: UNKNOWN
|
|
10
8
|
Description-Content-Type: text/markdown
|
|
11
9
|
License-File: LICENSE.txt
|
|
10
|
+
Requires-Dist: cffi>=1.0.0
|
|
12
11
|
|
|
13
12
|
# Pyfmtools
|
|
14
13
|
Pyfmtools provides various tools for handling fuzzy measures, calculating various indices, Choquet and Sugeno integrals, as well as fitting fuzzy measures to empirical data. This package is designed for Python , but it also includes the C++ source files and a user manual.
|
|
@@ -153,4 +152,3 @@ To unit test type:
|
|
|
153
152
|
```python
|
|
154
153
|
$ test/test_no_wrapper.py
|
|
155
154
|
```
|
|
156
|
-
|
|
@@ -10,7 +10,7 @@ with open("README.md", "r") as fh:
|
|
|
10
10
|
|
|
11
11
|
setup(
|
|
12
12
|
name="pyfmtools",
|
|
13
|
-
version="
|
|
13
|
+
version="5.2",
|
|
14
14
|
description="Library for handling and fitting fuzzy measures",
|
|
15
15
|
long_description=open('README.md').read(),
|
|
16
16
|
long_description_content_type="text/markdown",
|
|
@@ -28,4 +28,4 @@ setup(
|
|
|
28
28
|
)
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
|
|
@@ -5,6 +5,7 @@ ffibuilder = FFI()
|
|
|
5
5
|
PATH = os.path.dirname(__file__)
|
|
6
6
|
|
|
7
7
|
ffibuilder.cdef(r"""
|
|
8
|
+
extern "Python" int(py_user_defined_measurecheck)(int*, double *);
|
|
8
9
|
typedef unsigned long long int_64;
|
|
9
10
|
struct fm_env {
|
|
10
11
|
int n;
|
|
@@ -15,7 +16,7 @@ ffibuilder.cdef(r"""
|
|
|
15
16
|
double* card2bit;
|
|
16
17
|
double* factorials;};
|
|
17
18
|
struct fm_env_sparse {
|
|
18
|
-
int xx[
|
|
19
|
+
int xx[44];};
|
|
19
20
|
double py_min_subset(double* x, int n, int_64 S);
|
|
20
21
|
double py_max_subset(double* x, int n, int_64 S);
|
|
21
22
|
void py_ConvertCard2Bit(double* dest, double* src, struct fm_env* env);
|
|
@@ -59,7 +60,7 @@ ffibuilder.cdef(r"""
|
|
|
59
60
|
void py_InteractionBMob(double* Mob, double* v, struct fm_env* env);
|
|
60
61
|
void py_BipartitionShapleyIndex(double* v, double* w, struct fm_env* env);
|
|
61
62
|
void py_BipartitionBanzhafIndex(double* v, double* w, struct fm_env* env);
|
|
62
|
-
void
|
|
63
|
+
void py_NonadditivityIndexMob(double* Mob, double* w, struct fm_env* env);
|
|
63
64
|
void py_NonadditivityIndex(double* v, double* w, struct fm_env* env);
|
|
64
65
|
void py_NonmodularityIndex(double* v, double* w, struct fm_env* env);
|
|
65
66
|
void py_NonmodularityIndexMob(double* Mob, double* w, struct fm_env* env);
|
|
@@ -96,6 +97,7 @@ ffibuilder.cdef(r"""
|
|
|
96
97
|
void py_Banzhaf2addMob(double* v, double* x, int n);
|
|
97
98
|
double py_Choquet2addMob(double*x, double* Mob, int n);
|
|
98
99
|
int py_fm_arraysize(int n, int kint, struct fm_env* env);
|
|
100
|
+
int py_fm_arraysize_kadd(int n, int kint, struct fm_env* env);
|
|
99
101
|
int py_generate_fm_tsort(int num, int n, int kint, int markov, int option, double K, double * vv, struct fm_env* env);
|
|
100
102
|
int py_generate_fmconvex_tsort(int num, int n, int kint, int markov, int option, double K, double * vv, struct fm_env* env);
|
|
101
103
|
int py_generate_fm_minplus(int num, int n, int kint, int markov, int option, double K, double * vv, struct fm_env* env);
|
|
@@ -127,15 +129,34 @@ ffibuilder.cdef(r"""
|
|
|
127
129
|
int py_generate_fm_2additive_convex_sparse(int n, struct fm_env_sparse* env);
|
|
128
130
|
int py_generate_fm_kadditive_convex_sparse(int n, int k, int nonzero, struct fm_env_sparse* env);
|
|
129
131
|
void py_Nonmodularityindex_sparse(double* w, int n, struct fm_env_sparse* env);
|
|
132
|
+
void py_generate_fm_sorting(int num, int n, int markov, int option, double * vv, struct fm_env* env);
|
|
133
|
+
int py_CheckMonotonicitySortMerge(double * vv, double* indices, struct fm_env* env);
|
|
134
|
+
int py_CheckMonotonicitySortInsert(double * vv, double* indices, struct fm_env* env);
|
|
135
|
+
int py_CheckMonotonicitySimple(double * vv,struct fm_env* env);
|
|
136
|
+
void py_GenerateAntibuoyant( double * vv, struct fm_env* env);
|
|
137
|
+
int py_generate_fm_belief(int num, int n, int kadd, double * vv, struct fm_env* env);
|
|
138
|
+
int py_generate_fm_balanced(int num, int n, double * vv, struct fm_env* env);
|
|
139
|
+
int py_generate_fm_2additive(int num, int n, double * vv);
|
|
140
|
+
int py_CheckMonMob2additive2(double * vv, int n, int length, double* temp);
|
|
141
|
+
int py_CheckMonotonicityMob(double * vv, int len, struct fm_env* env);
|
|
142
|
+
int py_CheckConvexityMonMob(double * vv, int len, struct fm_env* env);
|
|
143
|
+
void py_ConvertCoMob2KinterCall(int n, int kint, int len, double* mu, double * vv, int fullmu, struct fm_env* env);
|
|
144
|
+
double py_ChoquetCoMobKInter(double* x, double* Mob, int kadd, int len, struct fm_env* env);
|
|
145
|
+
void py_fitting2additive(int datanum, int n, int len, double* v, double* dataset, int options, double* indexlow, double* indexhi, int option1, double* orness);
|
|
146
|
+
int py_generate_fm_randomwalk(int num, int n, int kint, int markov, int option, double step, double * vv, struct fm_env* env, void* extrachecks);
|
|
147
|
+
int py_generate_fm_kinteractivedualconvex(int num, int n, int kint, int markov, int option, double step, double * vv, struct fm_env* env, void* extrachecks);
|
|
148
|
+
int py_generate_fm_kinteractivedualconcave(int num, int n, int kint, int markov, int option, double step, double * vv, struct fm_env* env, void* extrachecks);
|
|
149
|
+
int py_generate_fm_2additive_randomwalk2(int num, int n, int markov, int option, double step, double * vv, void* extrachecks);
|
|
130
150
|
""", override=True)
|
|
131
151
|
|
|
132
152
|
pyfmtools_src=['src/colamd.c','src/lp_lib.c','src/lp_params.c','src/lp_simplex.c','src/lusolio.c','src/commonlib.c','src/lp_LUSOL.c','src/lp_presolve.c','src/lpslink56.c','src/mmio.c',
|
|
133
153
|
'src/ini.c','src/lp_matrix.c','src/lp_price.c','src/lp_SOS.c','src/myblas.c','src/isfixedvar.c','src/lp_MDO.c','src/lp_pricePSE.c','src/lp_utils.c','src/sparselib.c',
|
|
134
|
-
'src/lp_crash.c','src/lp_mipbb.c','src/lp_report.c','src/lp_wlp.c','src/yacc_read.c','src/lp_Hash.c','src/lp_MPS.c','src/lp_scale.c','src/lusol.c',
|
|
154
|
+
'src/lp_crash.c','src/lp_mipbb.c','src/lp_report.c','src/lp_wlp.c','src/yacc_read.c','src/lp_Hash.c','src/lp_MPS.c','src/lp_scale.c','src/lusol.c','src/gbrealloc.c',
|
|
135
155
|
'src/fmrandom.cpp','src/fuzzymeasurefit.cpp','src/wrapperpy.cpp','src/fuzzymeasurefit3.cpp','src/fuzzymeasuretools.cpp']
|
|
136
156
|
|
|
137
157
|
ffibuilder.set_source("_pyfmtools",r""" #include "wrapperpy.h" """,
|
|
138
158
|
sources=pyfmtools_src,
|
|
159
|
+
extra_compile_args=[],
|
|
139
160
|
include_dirs=[PATH],
|
|
140
161
|
)
|
|
141
162
|
|
|
@@ -207,6 +207,7 @@ typedef struct Colamd_Row_struct
|
|
|
207
207
|
#endif
|
|
208
208
|
*/
|
|
209
209
|
|
|
210
|
+
|
|
210
211
|
#ifndef __BORLANDC__
|
|
211
212
|
|
|
212
213
|
#ifdef __cplusplus
|
|
@@ -277,10 +278,10 @@ void symamd_report
|
|
|
277
278
|
int stats [COLAMD_STATS]
|
|
278
279
|
) ;
|
|
279
280
|
|
|
280
|
-
|
|
281
|
+
|
|
281
282
|
|
|
282
283
|
|
|
283
284
|
#ifdef __cplusplus
|
|
284
285
|
}
|
|
285
286
|
#endif
|
|
286
|
-
|
|
287
|
+
#endif /* COLAMD_H */
|
|
@@ -347,8 +347,8 @@ int CMP_CALLMODEL compareREAL(const void *current, const void *candidate)
|
|
|
347
347
|
where interchanges are reflected in a caller-initialized integer "tags" list. */
|
|
348
348
|
void hpsort(void *attributes, int count, int offset, int recsize, MYBOOL descending, findCompare_func findCompare)
|
|
349
349
|
{
|
|
350
|
-
|
|
351
|
-
|
|
350
|
+
int i, j, k, ir, order;
|
|
351
|
+
char *hold, *base;
|
|
352
352
|
char *save;
|
|
353
353
|
|
|
354
354
|
if(count < 2)
|
|
@@ -409,8 +409,8 @@ void hpsortex(void *attributes, int count, int offset, int recsize, MYBOOL desce
|
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
411
411
|
else {
|
|
412
|
-
|
|
413
|
-
|
|
412
|
+
int i, j, k, ir, order;
|
|
413
|
+
char *hold, *base;
|
|
414
414
|
char *save;
|
|
415
415
|
int savetag;
|
|
416
416
|
|
|
@@ -515,7 +515,7 @@ void QS_delete(UNIONTYPE QSORTrec a[], int ipos, int epos)
|
|
|
515
515
|
}
|
|
516
516
|
int QS_sort(UNIONTYPE QSORTrec a[], int l, int r, findCompare_func findCompare)
|
|
517
517
|
{
|
|
518
|
-
|
|
518
|
+
int i, j, nmove = 0;
|
|
519
519
|
UNIONTYPE QSORTrec v;
|
|
520
520
|
|
|
521
521
|
/* Perform the a fast QuickSort */
|
|
@@ -18,8 +18,14 @@ using namespace std;
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
+
#ifndef NO_R
|
|
22
|
+
unif_R_class<double> distribution(0.0, 1.0);
|
|
23
|
+
#else
|
|
24
|
+
std::uniform_real_distribution<> distribution(0.0, 1.0);
|
|
25
|
+
#endif
|
|
26
|
+
|
|
27
|
+
|
|
21
28
|
|
|
22
|
-
std::uniform_real_distribution<double> distribution(0.0, 1.0);
|
|
23
29
|
|
|
24
30
|
|
|
25
31
|
|
|
@@ -27,13 +33,14 @@ random_device rd;
|
|
|
27
33
|
mt19937 rng(rd()); // random-number engine used (Mersenne-Twister in this case)
|
|
28
34
|
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
/*
|
|
31
37
|
template <class T> struct prec : binary_function <T, T, bool> {
|
|
32
38
|
bool operator() (const T& x, const T& y) const { return x < y; }
|
|
33
39
|
};
|
|
34
40
|
template <class T> struct succ : binary_function <T, T, bool> {
|
|
35
41
|
bool operator() (const T& x, const T& y) const { return x < y; }
|
|
36
42
|
};
|
|
43
|
+
*/
|
|
37
44
|
// These definitions can be changed to support other data types. They sin in the .h file
|
|
38
45
|
|
|
39
46
|
//typedef uint16_t myint;
|
|
@@ -413,6 +420,15 @@ int fm_arraysize_kadd(int n, int k)
|
|
|
413
420
|
return r;
|
|
414
421
|
}
|
|
415
422
|
|
|
423
|
+
|
|
424
|
+
int fm_arraysize_2add(int n)
|
|
425
|
+
{
|
|
426
|
+
// calculates the number of parameers needed in cardinal representation for 2-additive capacity
|
|
427
|
+
// no 0 included !!!
|
|
428
|
+
return (int)(choose(2, n)) + n;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
|
|
416
432
|
myfloat fm_delta(int m, int kint, myfloat K)
|
|
417
433
|
{ // delta is the fixed marginal contribution in the k-interactive fuzzy measures
|
|
418
434
|
// if (m == (kint + 1)) return (myfloat)(1.0 - K);
|
|
@@ -654,7 +670,7 @@ int generate_fm_tsort(int_64 num, int m, int kint, int markov, int option, myflo
|
|
|
654
670
|
std::vector<BYTE> decodedData1;
|
|
655
671
|
|
|
656
672
|
|
|
657
|
-
|
|
673
|
+
int NN=0;
|
|
658
674
|
myint i, j1, j;
|
|
659
675
|
double Wei, WeiS, p, u;
|
|
660
676
|
Edge E;
|
|
@@ -834,7 +850,7 @@ int generate_fmconvexconcave_tsort(int_64 num, int m, int kint, int markov, int
|
|
|
834
850
|
string s5, s6;
|
|
835
851
|
std::vector<BYTE> decodedData1;
|
|
836
852
|
|
|
837
|
-
|
|
853
|
+
int NN=0;
|
|
838
854
|
myint i, j1, j;
|
|
839
855
|
double Wei, WeiS, p, u;
|
|
840
856
|
Edge E;
|
|
@@ -1041,3 +1057,9 @@ void export_maximal_chains(int n, int_64 m, double * v, double * mc)
|
|
|
1041
1057
|
std::next_permutation(temp.begin(), temp.end());
|
|
1042
1058
|
}
|
|
1043
1059
|
}
|
|
1060
|
+
|
|
1061
|
+
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
#include "fmrandomsort.inc"
|
|
@@ -53,7 +53,7 @@ The generate_fm_minplus is based on the minimalsPlus method, which
|
|
|
53
53
|
which is also published in their paper
|
|
54
54
|
|
|
55
55
|
"Minimals plus: An improved algorithm for the random generation of linear extensions of partially ordered sets." Information
|
|
56
|
-
Sciences, 501:50
|
|
56
|
+
Sciences, 501:50-67, 2019.
|
|
57
57
|
|
|
58
58
|
The code can be optimised by not using the matrix representation of the poset, relying on the relation preceeds.Not attempted here due to lack of time.
|
|
59
59
|
|
|
@@ -100,6 +100,15 @@ gleb@deakin.edu.au
|
|
|
100
100
|
//#include "fuzzymeasuretools.h"
|
|
101
101
|
|
|
102
102
|
|
|
103
|
+
typedef struct {
|
|
104
|
+
double val;
|
|
105
|
+
int_64 ind;
|
|
106
|
+
} dobint;
|
|
107
|
+
|
|
108
|
+
typedef struct {
|
|
109
|
+
double val;
|
|
110
|
+
int_64 ind;
|
|
111
|
+
} doblongint;
|
|
103
112
|
|
|
104
113
|
|
|
105
114
|
|
|
@@ -109,6 +118,9 @@ LIBDLL_API int fm_arraysize(int n, int_64 m, int kint);
|
|
|
109
118
|
LIBDLL_API int fm_arraysize_kadd(int n, int k);
|
|
110
119
|
// same for k-additive in cardinality ordering
|
|
111
120
|
|
|
121
|
+
LIBDLL_API int fm_arraysize_2add(int n);
|
|
122
|
+
// same for 2-additive and without 0
|
|
123
|
+
|
|
112
124
|
// generate fuzzy measures randomly using topological sort
|
|
113
125
|
LIBDLL_API int generate_fm_tsort(int_64 num, int n, int kint, int markov, int option, myfloat K, myfloat * vv);
|
|
114
126
|
|
|
@@ -128,3 +140,44 @@ LIBDLL_API int generate_fm_2additive_convex_withsomeindependent(int_64 num, int
|
|
|
128
140
|
// as above, but resets randomly some interactions to 0
|
|
129
141
|
|
|
130
142
|
LIBDLL_API void export_maximal_chains(int n, int_64 m, double * v, double * mc);
|
|
143
|
+
|
|
144
|
+
LIBDLL_API int generate_fm_sorting01(int_64 num, int n, int markov, int option, double* vv);
|
|
145
|
+
|
|
146
|
+
LIBDLL_API int generate_fm_randomwalk(int_64 num, int n, int kadd, int markov, int option, double step , double* vv, int* len, void* extrachecks);
|
|
147
|
+
|
|
148
|
+
// option==0 normal, 1 convex, 2 antibuoyant, 3 kadditive , 4 belief, 5 kadditive convex ,
|
|
149
|
+
//option =0x0100 standars slower mon/convexiy check, 0x1000 or 0x0010 - avoid belief meaures to start walk
|
|
150
|
+
//on the borders of the simplex
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
LIBDLL_API int CheckMonotonicitySortMerge(double* v, int_64* indices, int_64 m, int n);
|
|
155
|
+
LIBDLL_API int CheckMonotonicitySortInsert(double* v, int_64* indices, int_64 m, int n);
|
|
156
|
+
LIBDLL_API int CheckMonotonicitySimple(double* v, int_64 m, int n);
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
LIBDLL_API int CheckConvexitySortMerge(vector<doblongint>& v, vector<int_64>& indices, int_64 m, int n, int_64 M, int conv );
|
|
160
|
+
LIBDLL_API int CheckConvexitySortInsert(vector<doblongint>& v, vector<int_64>& indices, int_64 m, int n, int_64 M, int conv );
|
|
161
|
+
LIBDLL_API int GenerateAntibuoyant(int n, int_64 m, double* out); // lambda
|
|
162
|
+
LIBDLL_API int generate_fm_simple_randomwalk(int_64 num, int n, int markov, int option, double noise, double* vv, int* len, void* extrachecks);
|
|
163
|
+
LIBDLL_API int generate_fm_convex_randomwalk(int_64 num, int n, int markov, int option, double noise, double* vv, int* len, void* extrachecks);
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
LIBDLL_API int CheckMonotonicityMob(double* Mob, int n, int_64 m, int_64 len);
|
|
167
|
+
LIBDLL_API int CheckConvexityMonMob(double* Mob, int n, int_64 m, int_64 len);
|
|
168
|
+
|
|
169
|
+
//LIBDLL_API int generate_fm_kadditive_randomwalk(int_64 num, int n, int kadd, int markov, int option, double noise, double* vv, void* extrachecks);
|
|
170
|
+
//LIBDLL_API int generate_fm_kadditiveconvex_randomwalk(int_64 num, int n, int kadd, int markov, int option, double noise, double* vv, void* extrachecks);
|
|
171
|
+
LIBDLL_API int generate_fm_belief(int_64 num, int n, int kadd, int_64* length, double* vv);
|
|
172
|
+
LIBDLL_API int generate_fm_balanced(int_64 num, int n, double* vv);
|
|
173
|
+
|
|
174
|
+
LIBDLL_API int generate_fm_kinteractivedualconvex(int_64 num, int n, int kadd, int markov, int_64* length, double noise, double* vv, void* extrachecks);
|
|
175
|
+
LIBDLL_API int generate_fm_kinteractivedualconcave(int_64 num, int n, int kadd, int markov, int_64* length, double noise, double* vv, void* extrachecks);
|
|
176
|
+
|
|
177
|
+
// 2 additive
|
|
178
|
+
LIBDLL_API int generate_fm_2additive(int_64 num, int n, int option, myfloat* vv);
|
|
179
|
+
LIBDLL_API int generate_fm_2additive_randomwalk2(int_64 num, int n, int markov, int option, double noise, double* vv, void* extrachecks);
|
|
180
|
+
LIBDLL_API int CheckMonMob2additive2(double* Mob, int n, int length, double* temp);
|
|
181
|
+
|
|
182
|
+
LIBDLL_API void ConvertCoMob2Kinter(double* mu, double* Mob, int n, int_64 m, int kadd, int len, int fullmu);
|
|
183
|
+
LIBDLL_API double ChoquetCoMobKInter(double* x, double* Mob, int n, int_64 m, int kadd, int length);
|