pyfmtools 5.1__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.
Files changed (109) hide show
  1. {pyfmtools-5.1/src/pyfmtools.egg-info → pyfmtools-5.2}/PKG-INFO +1 -1
  2. {pyfmtools-5.1 → pyfmtools-5.2}/setup.py +1 -1
  3. {pyfmtools-5.1 → pyfmtools-5.2}/src/buildPyfmtools.py +1 -1
  4. {pyfmtools-5.1 → pyfmtools-5.2}/src/fuzzymeasuretools.cpp +16 -11
  5. {pyfmtools-5.1 → pyfmtools-5.2}/src/generaldefs.h +1 -0
  6. {pyfmtools-5.1 → pyfmtools-5.2/src/pyfmtools.egg-info}/PKG-INFO +1 -1
  7. {pyfmtools-5.1 → pyfmtools-5.2}/src/pyfmtools.egg-info/SOURCES.txt +0 -3
  8. {pyfmtools-5.1 → pyfmtools-5.2}/src/wrapperpy.cpp +6 -5
  9. {pyfmtools-5.1 → pyfmtools-5.2}/tests/test_wrapper.py +17 -16
  10. pyfmtools-5.1/dist/pyfmtools-5.1-cp312-cp312-macosx_14_0_arm64.whl +0 -0
  11. pyfmtools-5.1/src/fuzzymeasuretools.bak.cpp +0 -1951
  12. pyfmtools-5.1/src/fuzzymeasuretools.bak.h +0 -454
  13. {pyfmtools-5.1 → pyfmtools-5.2}/LICENSE.txt +0 -0
  14. {pyfmtools-5.1 → pyfmtools-5.2}/MANIFEST.in +0 -0
  15. {pyfmtools-5.1 → pyfmtools-5.2}/README.md +0 -0
  16. {pyfmtools-5.1 → pyfmtools-5.2}/setup.cfg +0 -0
  17. {pyfmtools-5.1 → pyfmtools-5.2}/src/binarylattice.h +0 -0
  18. {pyfmtools-5.1 → pyfmtools-5.2}/src/colamd.c +0 -0
  19. {pyfmtools-5.1 → pyfmtools-5.2}/src/colamd.h +0 -0
  20. {pyfmtools-5.1 → pyfmtools-5.2}/src/commonlib.c +0 -0
  21. {pyfmtools-5.1 → pyfmtools-5.2}/src/commonlib.h +0 -0
  22. {pyfmtools-5.1 → pyfmtools-5.2}/src/declare.h +0 -0
  23. {pyfmtools-5.1 → pyfmtools-5.2}/src/fmrandom.cpp +0 -0
  24. {pyfmtools-5.1 → pyfmtools-5.2}/src/fmrandom.h +0 -0
  25. {pyfmtools-5.1 → pyfmtools-5.2}/src/fmrandomsort.inc +0 -0
  26. {pyfmtools-5.1 → pyfmtools-5.2}/src/fortify.h +0 -0
  27. {pyfmtools-5.1 → pyfmtools-5.2}/src/fuzzymeasurefit.cpp +0 -0
  28. {pyfmtools-5.1 → pyfmtools-5.2}/src/fuzzymeasurefit.h +0 -0
  29. {pyfmtools-5.1 → pyfmtools-5.2}/src/fuzzymeasurefit3.cpp +0 -0
  30. {pyfmtools-5.1 → pyfmtools-5.2}/src/fuzzymeasuretools.h +0 -0
  31. {pyfmtools-5.1 → pyfmtools-5.2}/src/gbrealloc.c +0 -0
  32. {pyfmtools-5.1 → pyfmtools-5.2}/src/hbio.h +0 -0
  33. {pyfmtools-5.1 → pyfmtools-5.2}/src/ini.c +0 -0
  34. {pyfmtools-5.1 → pyfmtools-5.2}/src/ini.h +0 -0
  35. {pyfmtools-5.1 → pyfmtools-5.2}/src/isfixedvar.c +0 -0
  36. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_BFP.h +0 -0
  37. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_BFP1.h +0 -0
  38. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_BFP2.h +0 -0
  39. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_Hash.c +0 -0
  40. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_Hash.h +0 -0
  41. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_LUSOL.c +0 -0
  42. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_LUSOL.h +0 -0
  43. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_MDO.c +0 -0
  44. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_MDO.h +0 -0
  45. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_MPS.c +0 -0
  46. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_MPS.h +0 -0
  47. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_SOS.c +0 -0
  48. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_SOS.h +0 -0
  49. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_crash.c +0 -0
  50. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_crash.h +0 -0
  51. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_etaPFI.h +0 -0
  52. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_explicit.h +0 -0
  53. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_fortify.h +0 -0
  54. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_lib.c +0 -0
  55. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_lib.h +0 -0
  56. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_matrix.c +0 -0
  57. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_matrix.h +0 -0
  58. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_mipbb.c +0 -0
  59. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_mipbb.h +0 -0
  60. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_params.c +0 -0
  61. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_presolve.c +0 -0
  62. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_presolve.h +0 -0
  63. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_price.c +0 -0
  64. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_price.h +0 -0
  65. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_pricePSE.c +0 -0
  66. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_pricePSE.h +0 -0
  67. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_report.c +0 -0
  68. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_report.h +0 -0
  69. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_rlp.h +0 -0
  70. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_scale.c +0 -0
  71. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_scale.h +0 -0
  72. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_simplex.c +0 -0
  73. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_simplex.h +0 -0
  74. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_types.h +0 -0
  75. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_utils.c +0 -0
  76. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_utils.h +0 -0
  77. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_wlp.c +0 -0
  78. {pyfmtools-5.1 → pyfmtools-5.2}/src/lp_wlp.h +0 -0
  79. {pyfmtools-5.1 → pyfmtools-5.2}/src/lpkit.h +0 -0
  80. {pyfmtools-5.1 → pyfmtools-5.2}/src/lpslink56.c +0 -0
  81. {pyfmtools-5.1 → pyfmtools-5.2}/src/lpsolve.h +0 -0
  82. {pyfmtools-5.1 → pyfmtools-5.2}/src/lusol.c +0 -0
  83. {pyfmtools-5.1 → pyfmtools-5.2}/src/lusol.h +0 -0
  84. {pyfmtools-5.1 → pyfmtools-5.2}/src/lusol1.h +0 -0
  85. {pyfmtools-5.1 → pyfmtools-5.2}/src/lusol2.h +0 -0
  86. {pyfmtools-5.1 → pyfmtools-5.2}/src/lusol6a.h +0 -0
  87. {pyfmtools-5.1 → pyfmtools-5.2}/src/lusol6l0.h +0 -0
  88. {pyfmtools-5.1 → pyfmtools-5.2}/src/lusol6u.h +0 -0
  89. {pyfmtools-5.1 → pyfmtools-5.2}/src/lusol7a.h +0 -0
  90. {pyfmtools-5.1 → pyfmtools-5.2}/src/lusol8a.h +0 -0
  91. {pyfmtools-5.1 → pyfmtools-5.2}/src/lusolio.c +0 -0
  92. {pyfmtools-5.1 → pyfmtools-5.2}/src/lusolio.h +0 -0
  93. {pyfmtools-5.1 → pyfmtools-5.2}/src/minimalsplus.h +0 -0
  94. {pyfmtools-5.1 → pyfmtools-5.2}/src/mmio.c +0 -0
  95. {pyfmtools-5.1 → pyfmtools-5.2}/src/mmio.h +0 -0
  96. {pyfmtools-5.1 → pyfmtools-5.2}/src/myblas.c +0 -0
  97. {pyfmtools-5.1 → pyfmtools-5.2}/src/myblas.h +0 -0
  98. {pyfmtools-5.1 → pyfmtools-5.2}/src/pyfmtools.egg-info/dependency_links.txt +0 -0
  99. {pyfmtools-5.1 → pyfmtools-5.2}/src/pyfmtools.egg-info/requires.txt +0 -0
  100. {pyfmtools-5.1 → pyfmtools-5.2}/src/pyfmtools.egg-info/top_level.txt +0 -0
  101. {pyfmtools-5.1 → pyfmtools-5.2}/src/pyfmtools.py +0 -0
  102. {pyfmtools-5.1 → pyfmtools-5.2}/src/sparselib.c +0 -0
  103. {pyfmtools-5.1 → pyfmtools-5.2}/src/sparselib.h +0 -0
  104. {pyfmtools-5.1 → pyfmtools-5.2}/src/stdafx.h +0 -0
  105. {pyfmtools-5.1 → pyfmtools-5.2}/src/ufortify.h +0 -0
  106. {pyfmtools-5.1 → pyfmtools-5.2}/src/wrapperpy.h +0 -0
  107. {pyfmtools-5.1 → pyfmtools-5.2}/src/yacc_read.c +0 -0
  108. {pyfmtools-5.1 → pyfmtools-5.2}/src/yacc_read.h +0 -0
  109. {pyfmtools-5.1 → pyfmtools-5.2}/tests/test_no_wrapper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyfmtools
3
- Version: 5.1
3
+ Version: 5.2
4
4
  Summary: Library for handling and fitting fuzzy measures
5
5
  Home-page:
6
6
  Author: Gleb Beliakov, Norbert Henseler
@@ -10,7 +10,7 @@ with open("README.md", "r") as fh:
10
10
 
11
11
  setup(
12
12
  name="pyfmtools",
13
- version="5.01",
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",
@@ -156,7 +156,7 @@ pyfmtools_src=['src/colamd.c','src/lp_lib.c','src/lp_params.c','src/lp_simplex.c
156
156
 
157
157
  ffibuilder.set_source("_pyfmtools",r""" #include "wrapperpy.h" """,
158
158
  sources=pyfmtools_src,
159
- extra_compile_args=["-Wno-c++11-extensions","-Wno-c++11-long-long","-Wno-unused-but-set-variable","-Wno-sign-compare","-Wno-c++11-extra-semi","-Wno-unreachable-code","-Wno-parentheses-equality","-Wno-empty-body"],
159
+ extra_compile_args=[],
160
160
  include_dirs=[PATH],
161
161
  )
162
162
 
@@ -1581,7 +1581,7 @@ int GetNumTuples(struct SparseFM* cap)
1581
1581
  int IsInSetSparse(int A, int card, int i, struct SparseFM* cap) // does i belong to set A?
1582
1582
  {
1583
1583
  if (card == 1) return (A == i);
1584
- if (card == 2) return((cap->m_pair_index[2 * A] == (uint16_t)i) || (cap->m_pair_index[2 * A + 1] == (uint16_t)i));
1584
+ if (card == 2) return((cap->m_pair_index[2 * A] == (int)i) || (cap->m_pair_index[2 * A + 1] == (int)i));
1585
1585
  // else process tuple
1586
1586
  for (int j = 1;j <= cap->m_tuple_content[cap->m_tuple_start[A]]; j++)
1587
1587
  if (cap->m_tuple_content[cap->m_tuple_start[A] + j] == i) return 1;
@@ -1704,15 +1704,18 @@ void BanzhafMobSparse(double* v, int n, struct SparseFM* cap)
1704
1704
 
1705
1705
  void NonmodularityIndexMobSparse(double* w, int n, int_64 m, struct SparseFM* cap) // calculates all 2^n nonmodularity indices (returned in w) using Mobius transform of
1706
1706
  //a k-additive FM in cardinality ordering (of length 2^n=m), using sparse representation
1707
+ // returns w in standard representation
1707
1708
  {
1708
1709
  int_64 id, A;
1709
- w[0] = 0;
1710
+ // w[0] = 0;
1711
+ for (int_64 i = (int_64)0; i < m; i++) w[i] = 0;
1712
+
1710
1713
  for (int i = 0;i < n; i++)
1711
- w[i] = cap->m_singletons[i]; // singleton
1714
+ w[1 << i] = cap->m_singletons[i]; // singleton
1715
+
1712
1716
 
1713
- for (int_64 i = (int_64)n; i < m; i++) w[i] = 0;
1714
1717
 
1715
- for (id = (int_64)n; id < m; id++)
1718
+ for (id = (int_64)3; id < m; id++) if(Cardinality(id)>1)
1716
1719
  {
1717
1720
  for (size_t j = 0;j < cap->m_pairs.size(); j++)
1718
1721
  {
@@ -1730,7 +1733,9 @@ void NonmodularityIndexMobSparse(double* w, int n, int_64 m, struct SparseFM* ca
1730
1733
  if (IsSubset(id, A))
1731
1734
  w[id] += cap->m_tuples[i] * cap->m_tuple_content[cap->m_tuple_start[i]]; // cardinality
1732
1735
  }
1733
- w[id] /= card[card2bit[id]];
1736
+ // w[id] /= card[card2bit[id]];
1737
+ // I am unsure why card2bit? id looks to be bit order
1738
+ w[id] /= Cardinality(id);
1734
1739
  }
1735
1740
  }
1736
1741
 
@@ -1742,8 +1747,8 @@ void PopulateFM2Add_Sparse(double* singletons, int numpairs, double* pairs, int*
1742
1747
 
1743
1748
  for (int i = 0;i < numpairs; i++) {
1744
1749
  cap->m_pairs.push_back(pairs[i]);
1745
- cap->m_pair_index.push_back(uint16_t(indicesp1[ i]));
1746
- cap->m_pair_index.push_back(uint16_t(indicesp2[i]));
1750
+ cap->m_pair_index.push_back(int(indicesp1[ i]));
1751
+ cap->m_pair_index.push_back(int(indicesp2[i]));
1747
1752
  }
1748
1753
  }
1749
1754
 
@@ -1751,8 +1756,8 @@ void PopulateFM2Add_Sparse(double* singletons, int numpairs, double* pairs, int*
1751
1756
  void AddPairSparse(int i, int j, double* v, struct SparseFM* cap)
1752
1757
  {
1753
1758
  cap->m_pairs.push_back(*v);
1754
- cap->m_pair_index.push_back(uint16_t(min(i, j)));
1755
- cap->m_pair_index.push_back(uint16_t(max(i, j)));
1759
+ cap->m_pair_index.push_back(int(min(i, j)));
1760
+ cap->m_pair_index.push_back(int(max(i, j)));
1756
1761
  }
1757
1762
  void AddTupleSparse(int tupsize, int* tuple, double* v, struct SparseFM* cap)
1758
1763
  {
@@ -1762,7 +1767,7 @@ void AddTupleSparse(int tupsize, int* tuple, double* v, struct SparseFM* cap)
1762
1767
  cap->m_tuple_content.push_back(tupsize);
1763
1768
 
1764
1769
  for (int j = 0;j < tupsize;j++) {
1765
- cap->m_tuple_content.push_back((uint16_t)(tuple[j]));
1770
+ cap->m_tuple_content.push_back((int)(tuple[j]));
1766
1771
  }
1767
1772
  }
1768
1773
 
@@ -7,6 +7,7 @@
7
7
  #if defined (_WIN32)
8
8
  #define LIBEXP __declspec(dllexport)
9
9
  //#include "../stdafx.h"
10
+ #define WIN32
10
11
  #else
11
12
  #define LIBEXP
12
13
  #endif
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyfmtools
3
- Version: 5.1
3
+ Version: 5.2
4
4
  Summary: Library for handling and fitting fuzzy measures
5
5
  Home-page:
6
6
  Author: Gleb Beliakov, Norbert Henseler
@@ -3,7 +3,6 @@ MANIFEST.in
3
3
  README.md
4
4
  setup.cfg
5
5
  setup.py
6
- dist/pyfmtools-5.1-cp312-cp312-macosx_14_0_arm64.whl
7
6
  src/binarylattice.h
8
7
  src/buildPyfmtools.py
9
8
  src/colamd.c
@@ -18,8 +17,6 @@ src/fortify.h
18
17
  src/fuzzymeasurefit.cpp
19
18
  src/fuzzymeasurefit.h
20
19
  src/fuzzymeasurefit3.cpp
21
- src/fuzzymeasuretools.bak.cpp
22
- src/fuzzymeasuretools.bak.h
23
20
  src/fuzzymeasuretools.cpp
24
21
  src/fuzzymeasuretools.h
25
22
  src/gbrealloc.c
@@ -51,7 +51,7 @@ struct fm_env_sparse { // to use in wrappers, just to keep pointers. pointers m
51
51
  };
52
52
 
53
53
 
54
-
54
+ #undef __R
55
55
  //#define __R
56
56
  #ifdef __R
57
57
  //#include "cpp11.hpp"
@@ -68,11 +68,12 @@ struct fm_env_sparse { // to use in wrappers, just to keep pointers. pointers m
68
68
 
69
69
  #include <stdlib.h>
70
70
 
71
+ #ifdef __R
71
72
  //#include "wrapperpy.h"
72
73
 
73
74
  //#if (defined(__clang__) || defined(__APPLE__) || defined(__arm64__)) && defined(_LIBCPP_VERSION)
74
75
  //#if (defined(__clang__) || defined(__arm64__)) && defined(_LIBCPP_VERSION)
75
- #if defined(_LIBCPP_VERSION) // may be just detect libc++
76
+ #if (defined(_LIBCPP_VERSION) ) // may be just detect libc++
76
77
 
77
78
  #if (_LIBCPP_VERSION < 14000)
78
79
  template <class T>
@@ -174,7 +175,7 @@ void releaseVectorWrapper( std::vector<T, std::allocator<T> > volatile &targetV
174
175
  }
175
176
  #endif
176
177
 
177
-
178
+ #endif
178
179
 
179
180
  //#undef PYTHON_
180
181
 
@@ -2642,7 +2643,7 @@ LIBEXP void py_Nonmodularityindex_sparse( double* w, int n, struct fm_env_sparse
2642
2643
  //} // end extern "C"
2643
2644
 
2644
2645
 
2645
-
2646
+ #ifdef __R
2646
2647
 
2647
2648
  void copycontent(struct SparseFM* env, double* singletons, double* pairs, double* tuples, int* pairsidx, int* tuplesidx, int* tuplescon, int* dims)
2648
2649
  {
@@ -2705,7 +2706,7 @@ void copycontent(struct SparseFM* env, double* singletons, double* pairs, double
2705
2706
 
2706
2707
 
2707
2708
 
2708
-
2709
+ #endif
2709
2710
 
2710
2711
 
2711
2712
 
@@ -245,7 +245,7 @@ print( "r: ", r)
245
245
  # void py_FuzzyMeasureFit(int datanum, int additive, struct fm_env* env, double* out_v, double* dataset)
246
246
  datanum = 10
247
247
  additive = 2
248
- dataset = [random.random()] * datanum * ( env.n + 1)
248
+ dataset = np.random.uniform(low=0.0, high=1.0, size=(datanum * ( env.n + 1),))
249
249
  res = pyfm.FuzzyMeasureFit(datanum, additive, env, dataset)
250
250
  print( "datanum: ", datanum)
251
251
  print( "additive: ", additive)
@@ -256,7 +256,7 @@ print( "res: ", res)
256
256
  # void py_FuzzyMeasureFitMob(int datanum, int additive, struct fm_env* env, double* out_v, double* dataset)
257
257
  datanum = 10
258
258
  additive = 3
259
- dataset = [random.random()] * datanum * ( env.n + 1)
259
+ dataset = np.random.uniform(low=0.0, high=1.0, size=(datanum * ( env.n + 1),))
260
260
  res = pyfm.FuzzyMeasureFitMob(datanum, additive, env, dataset)
261
261
  print( "datanum: ", datanum)
262
262
  print( "additive: ", additive)
@@ -267,7 +267,7 @@ print( "res: ", res)
267
267
  # void py_FuzzyMeasureFitKtolerant(int datanum, int additive, struct fm_env* env, double* out_v, double* dataset)
268
268
  datanum = 10
269
269
  additive = 2
270
- dataset = [random.random()] * datanum * ( env.n + 1)
270
+ dataset = np.random.uniform(low=0.0, high=1.0, size=(datanum * ( env.n + 1),))
271
271
  res = pyfm.FuzzyMeasureFitKtolerant(datanum, additive, env, dataset)
272
272
  print( "datanum: ", datanum)
273
273
  print( "additive: ", additive)
@@ -278,7 +278,7 @@ print( "res: ", res)
278
278
  # void py_FuzzyMeasureFitLPKmaxitive(int datanum, int additive, struct fm_env* env, double* out_v, double* dataset)
279
279
  datanum = 10
280
280
  additive = 2
281
- dataset = [random.random()] * datanum * ( env.n + 1)
281
+ dataset = np.random.uniform(low=0.0, high=1.0, size=(datanum * ( env.n + 1),))
282
282
  res = pyfm.FuzzyMeasureFitLPKmaxitive(datanum, additive, env, dataset)
283
283
  print( "datanum: ", datanum)
284
284
  print( "additive: ", additive)
@@ -290,7 +290,7 @@ print( "res: ", res)
290
290
  datanum = 10
291
291
  additive = 2
292
292
  K = 0.5
293
- dataset = [random.random()] * datanum * ( env.n + 1)
293
+ dataset = np.random.uniform(low=0.0, high=1.0, size=(datanum * ( env.n + 1),))
294
294
  v = pyfm.FuzzyMeasureFitLPKinteractive(datanum, additive, env, K, dataset)
295
295
  print( "datanum: ", datanum)
296
296
  print( "additive: ", additive)
@@ -304,7 +304,7 @@ print( "v: ", v)
304
304
  datanum = 10
305
305
  additive = 2
306
306
  K = 0.5
307
- dataset = [random.random()] * datanum * ( env.n + 1)
307
+ dataset = np.random.uniform(low=0.0, high=1.0, size=(datanum * ( env.n + 1),))
308
308
  v = pyfm.FuzzyMeasureFitLPKinteractiveMaxChains(datanum, additive, env, K, dataset)
309
309
  print( "datanum: ", datanum)
310
310
  print( "additive: ", additive)
@@ -318,7 +318,8 @@ datanum = 10
318
318
  additive = 2
319
319
  K = 0.5
320
320
  maxiters = 100
321
- dataset = [random.random()] * datanum * ( env.n + 1)
321
+ #dataset = [random.random()] * datanum * ( env.n + 1)
322
+ dataset = np.random.uniform(low=0.0, high=1.0, size=(datanum * ( env.n + 1),))
322
323
  v = pyfm.FuzzyMeasureFitLPKinteractiveAutoK(datanum, additive, env, K, maxiters, dataset)
323
324
  print( "datanum: ", datanum)
324
325
  print( "additive: ", additive)
@@ -333,7 +334,7 @@ datanum = 10
333
334
  additive = 2
334
335
  K = 0.5
335
336
  submod = 1
336
- dataset = [random.random()] * datanum * ( env.n + 1)
337
+ dataset = np.random.uniform(low=0.0, high=1.0, size=(datanum * ( env.n + 1),))
337
338
  v = pyfm.FuzzyMeasureFitLPKinteractiveMarginal(datanum, additive, env, K, submod, dataset)
338
339
  print( "datanum: ", datanum)
339
340
  print( "additive: ", additive)
@@ -348,7 +349,7 @@ datanum = 10
348
349
  additive = 2
349
350
  K = 0.5
350
351
  submod = 1
351
- dataset = [random.random()] * datanum * ( env.n + 1)
352
+ dataset = np.random.uniform(low=0.0, high=1.0, size=(datanum * ( env.n + 1),))
352
353
  v = pyfm.FuzzyMeasureFitLPKinteractiveMarginalMaxChain(datanum, additive, env, K, maxiters, submod, dataset)
353
354
  print( "datanum: ", datanum)
354
355
  print( "additive: ", additive)
@@ -366,7 +367,7 @@ indexlow = [0, 0, 0]
366
367
  indexhihg = [1, 1, 1]
367
368
  option1 = 0
368
369
  orness = 0.5
369
- dataset = [random.random()] * datanum * ( env.n + 1)
370
+ dataset = np.random.uniform(low=0.0, high=1.0, size=(datanum * ( env.n + 1),))
370
371
  v = pyfm.FuzzyMeasureFitLP(datanum, additive, env, options, indexlow, indexhihg, option1, orness, dataset)
371
372
  print( "datanum: ", datanum)
372
373
  print( "additive: ", additive)
@@ -387,7 +388,7 @@ indexlow = [0, 0, 0]
387
388
  indexhihg = [1, 1, 1]
388
389
  option1 = 0
389
390
  orness = 0.5
390
- dataset = [random.random()] * datanum * ( env.n + 1)
391
+ dataset = np.random.uniform(low=0.0, high=1.0, size=(datanum * ( env.n + 1),))
391
392
  Mob = pyfm.FuzzyMeasureFitLPMob(datanum, additive, env, options, indexlow, indexhihg, option1, orness, dataset)
392
393
  print( "datanum: ", datanum)
393
394
  print( "additive: ", additive)
@@ -403,7 +404,7 @@ print( "Mob: ", Mob)
403
404
  # void py_fittingOWA(int datanum, struct fm_env* env, double* out_v, double* dataset)
404
405
  # documented, no example
405
406
  datanum = 10
406
- dataset = [random.random()] * datanum * ( env.n + 1)
407
+ dataset = np.random.uniform(low=0.0, high=1.0, size=(datanum * ( env.n + 1),))
407
408
  v = pyfm.fittingOWA(datanum, env, dataset)
408
409
  print( "datanum: ", datanum)
409
410
  print( "dataset: ", dataset)
@@ -414,7 +415,7 @@ print( "v: ", v)
414
415
  # documented, no example
415
416
  datanum = 10
416
417
  atanum = 10
417
- dataset = [random.random()] * datanum * ( env.n + 1)
418
+ dataset = np.random.uniform(low=0.0, high=1.0, size=(datanum * ( env.n + 1),))
418
419
  v = pyfm.fittingWAM(datanum, env, dataset)
419
420
  print( "datanum: ", datanum)
420
421
  print( "dataset: ", dataset)
@@ -774,7 +775,7 @@ env_sparse = pyfm.prepare_fm_sparse( n, tupsize)
774
775
  # Test wrapper for:
775
776
  # void py_add_tuple_sparse(int tupsize, int* tuple, double v, struct fm_env_sparse* env)
776
777
  v = 0.2
777
- tuple = [1, 3, 4]
778
+ tuple = [1, 2, 3]
778
779
  pyfm.add_tuple_sparse( tuple, v, env_sparse)
779
780
  print( "tuple: ", tuple)
780
781
 
@@ -796,7 +797,7 @@ print( "Banzhaf values: ", v)
796
797
  # void py_add_pair_sparse(int i, int j, double v, struct fm_env_sparse* env)
797
798
  v = 0.2
798
799
  i = 2
799
- j = 5
800
+ j = 3
800
801
  pyfm.add_pair_sparse(i, j, v, env_sparse)
801
802
  print( "v: ", v)
802
803
  print( "i: ", i)
@@ -893,7 +894,7 @@ print( "is_contained: ", is_contained)
893
894
  A = 0
894
895
  cardA = 3
895
896
  B = 1
896
- cardB = 3
897
+ cardB = 2
897
898
  is_subset = pyfm.is_subset_sparse(A, cardA, B, cardB, env_sparse)
898
899
  print( "A: ", A)
899
900
  print( "cardA: ", cardA)