tomoto 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/ext/tomoto/ct.cpp +11 -11
  4. data/ext/tomoto/dmr.cpp +14 -13
  5. data/ext/tomoto/dt.cpp +14 -14
  6. data/ext/tomoto/ext.cpp +7 -7
  7. data/ext/tomoto/extconf.rb +1 -3
  8. data/ext/tomoto/gdmr.cpp +7 -7
  9. data/ext/tomoto/hdp.cpp +9 -9
  10. data/ext/tomoto/hlda.cpp +13 -13
  11. data/ext/tomoto/hpa.cpp +5 -5
  12. data/ext/tomoto/lda.cpp +42 -39
  13. data/ext/tomoto/llda.cpp +6 -6
  14. data/ext/tomoto/mglda.cpp +15 -15
  15. data/ext/tomoto/pa.cpp +6 -6
  16. data/ext/tomoto/plda.cpp +6 -6
  17. data/ext/tomoto/slda.cpp +8 -8
  18. data/ext/tomoto/utils.h +16 -70
  19. data/lib/tomoto/version.rb +1 -1
  20. data/vendor/tomotopy/README.kr.rst +57 -0
  21. data/vendor/tomotopy/README.rst +55 -0
  22. data/vendor/tomotopy/src/Labeling/Phraser.hpp +3 -3
  23. data/vendor/tomotopy/src/TopicModel/CTModel.hpp +5 -2
  24. data/vendor/tomotopy/src/TopicModel/DMRModel.hpp +5 -2
  25. data/vendor/tomotopy/src/TopicModel/DTModel.hpp +5 -2
  26. data/vendor/tomotopy/src/TopicModel/HDPModel.hpp +4 -4
  27. data/vendor/tomotopy/src/TopicModel/HLDAModel.hpp +5 -2
  28. data/vendor/tomotopy/src/TopicModel/HPAModel.hpp +2 -2
  29. data/vendor/tomotopy/src/TopicModel/LDA.h +3 -3
  30. data/vendor/tomotopy/src/TopicModel/LDACVB0Model.hpp +3 -3
  31. data/vendor/tomotopy/src/TopicModel/LDAModel.hpp +34 -14
  32. data/vendor/tomotopy/src/TopicModel/LLDAModel.hpp +5 -2
  33. data/vendor/tomotopy/src/TopicModel/MGLDAModel.hpp +2 -2
  34. data/vendor/tomotopy/src/TopicModel/PAModel.hpp +1 -1
  35. data/vendor/tomotopy/src/TopicModel/PLDAModel.hpp +5 -2
  36. data/vendor/tomotopy/src/TopicModel/PTModel.hpp +5 -2
  37. data/vendor/tomotopy/src/TopicModel/SLDAModel.hpp +4 -1
  38. data/vendor/tomotopy/src/TopicModel/TopicModel.hpp +48 -21
  39. data/vendor/tomotopy/src/Utils/AliasMethod.hpp +5 -4
  40. data/vendor/tomotopy/src/Utils/Dictionary.h +2 -2
  41. data/vendor/tomotopy/src/Utils/MultiNormalDistribution.hpp +1 -1
  42. data/vendor/tomotopy/src/Utils/TruncMultiNormal.hpp +1 -1
  43. data/vendor/tomotopy/src/Utils/math.h +2 -2
  44. data/vendor/tomotopy/src/Utils/serializer.hpp +30 -5
  45. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7d2b9113c560c533a6ee514fd382116b100a1a0a89c410341f09601c579b524
4
- data.tar.gz: 503cb06e8a36b0d5aa71dd5ff6cf8a67a9a6f66d804351197e89e92d26b3afe7
3
+ metadata.gz: a68366fa033b16f1a3c5ce77d1c62cd523dda6f873fb24cf25619706a7a0086f
4
+ data.tar.gz: 347f7c8c8cce63da9b5f922267123811bc1333ebdb685bbbb10b906fda24eeee
5
5
  SHA512:
6
- metadata.gz: 587ed55f6006179f861019cfd91ec4b1e78bbebe27a582323ce77c5bb9d5b73979f103625a5c424f1eb76464e5a11b195cc6cbbd23c72e1054cebd046bed3849
7
- data.tar.gz: 03fb68f340dc947f9ef5d25087731f447e7ec9e777d6e551768c5d8db719732af5a7f23ae5c3077d2de43f640b7cd1bc12a01ecf359926e327a5c6b296e36311
6
+ metadata.gz: 72adc8f9e3fe3e9d04e3841d4ff9386d3f2bef710adaa0fa2e0406284eb814cff55e0603e3b3c3b344893011dc20ab9d17de68fbaceff48c73fc9b6e506971e2
7
+ data.tar.gz: 6ec20a814092d056917b5f1b455019a676f8ac54161c3a0f487670dbbba5ae8dbdf6ab634c17c4770ccbdbcd4be9b12304ccc92f6ed0279ee48eb2fe36a035c9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.3 (2021-08-26)
2
+
3
+ - Updated to Rice 4
4
+
1
5
  ## 0.2.2 (2021-08-23)
2
6
 
3
7
  - Reduced gem size
data/ext/tomoto/ct.cpp CHANGED
@@ -1,14 +1,14 @@
1
1
  #include <CT.h>
2
2
 
3
- #include <rice/Module.hpp>
3
+ #include <rice/rice.hpp>
4
4
 
5
5
  #include "utils.h"
6
6
 
7
7
  void init_ct(Rice::Module& m) {
8
8
  Rice::define_class_under<tomoto::ICTModel, tomoto::ILDAModel>(m, "CT")
9
- .define_singleton_method(
9
+ .define_singleton_function(
10
10
  "_new",
11
- *[](size_t tw, size_t k, tomoto::Float alpha, tomoto::Float eta, size_t seed) {
11
+ [](size_t tw, size_t k, tomoto::Float alpha, tomoto::Float eta, size_t seed) {
12
12
  tomoto::CTArgs args;
13
13
  args.k = k;
14
14
  args.alpha = {alpha};
@@ -17,42 +17,42 @@ void init_ct(Rice::Module& m) {
17
17
  args.seed = seed;
18
18
  }
19
19
  return tomoto::ICTModel::create((tomoto::TermWeight)tw, args);
20
- })
20
+ }, Rice::Return().takeOwnership())
21
21
  .define_method(
22
22
  "_correlations",
23
- *[](tomoto::ICTModel& self, tomoto::Tid topic_id) {
23
+ [](tomoto::ICTModel& self, tomoto::Tid topic_id) {
24
24
  return self.getCorrelationTopic(topic_id);
25
25
  })
26
26
  .define_method(
27
27
  "num_beta_sample",
28
- *[](tomoto::ICTModel& self) {
28
+ [](tomoto::ICTModel& self) {
29
29
  return self.getNumBetaSample();
30
30
  })
31
31
  .define_method(
32
32
  "num_beta_sample=",
33
- *[](tomoto::ICTModel& self, size_t value) {
33
+ [](tomoto::ICTModel& self, size_t value) {
34
34
  self.setNumBetaSample(value);
35
35
  return value;
36
36
  })
37
37
  .define_method(
38
38
  "num_tmn_sample",
39
- *[](tomoto::ICTModel& self) {
39
+ [](tomoto::ICTModel& self) {
40
40
  return self.getNumTMNSample();
41
41
  })
42
42
  .define_method(
43
43
  "num_tmn_sample=",
44
- *[](tomoto::ICTModel& self, size_t value) {
44
+ [](tomoto::ICTModel& self, size_t value) {
45
45
  self.setNumTMNSample(value);
46
46
  return value;
47
47
  })
48
48
  .define_method(
49
49
  "_prior_cov",
50
- *[](tomoto::ICTModel& self) {
50
+ [](tomoto::ICTModel& self) {
51
51
  return self.getPriorCov();
52
52
  })
53
53
  .define_method(
54
54
  "prior_mean",
55
- *[](tomoto::ICTModel& self) {
55
+ [](tomoto::ICTModel& self) {
56
56
  return self.getPriorMean();
57
57
  });
58
58
  }
data/ext/tomoto/dmr.cpp CHANGED
@@ -1,15 +1,14 @@
1
1
  #include <DMR.h>
2
2
 
3
- #include <rice/Class.hpp>
4
- #include <rice/Module.hpp>
3
+ #include <rice/rice.hpp>
5
4
 
6
5
  #include "utils.h"
7
6
 
8
7
  void init_dmr(Rice::Module& m) {
9
8
  Rice::define_class_under<tomoto::IDMRModel, tomoto::ILDAModel>(m, "DMR")
10
- .define_singleton_method(
9
+ .define_singleton_function(
11
10
  "_new",
12
- *[](size_t tw, size_t k, tomoto::Float alpha, tomoto::Float sigma, tomoto::Float eta, tomoto::Float alpha_epsilon, size_t seed) {
11
+ [](size_t tw, size_t k, tomoto::Float alpha, tomoto::Float sigma, tomoto::Float eta, tomoto::Float alpha_epsilon, size_t seed) {
13
12
  tomoto::DMRArgs args;
14
13
  args.k = k;
15
14
  args.alpha = {alpha};
@@ -20,49 +19,51 @@ void init_dmr(Rice::Module& m) {
20
19
  args.seed = seed;
21
20
  }
22
21
  return tomoto::IDMRModel::create((tomoto::TermWeight)tw, args);
23
- })
22
+ }, Rice::Return().takeOwnership())
24
23
  .define_method(
25
24
  "_add_doc",
26
- *[](tomoto::IDMRModel& self, std::vector<std::string> words, std::string metadata) {
25
+ [](tomoto::IDMRModel& self, std::vector<std::string> words, std::string metadata) {
27
26
  auto doc = buildDoc(words);
28
27
  doc.misc["metadata"] = metadata;
29
28
  return self.addDoc(doc);
30
29
  })
31
30
  .define_method(
32
31
  "alpha_epsilon",
33
- *[](tomoto::IDMRModel& self) {
32
+ [](tomoto::IDMRModel& self) {
34
33
  return self.getAlphaEps();
35
34
  })
36
35
  .define_method(
37
36
  "alpha_epsilon=",
38
- *[](tomoto::IDMRModel& self, tomoto::Float value) {
37
+ [](tomoto::IDMRModel& self, tomoto::Float value) {
39
38
  self.setAlphaEps(value);
40
39
  return value;
41
40
  })
42
41
  .define_method(
43
42
  "f",
44
- *[](tomoto::IDMRModel& self) {
43
+ [](tomoto::IDMRModel& self) {
45
44
  return self.getF();
46
45
  })
47
46
  .define_method(
48
47
  "_lambdas",
49
- *[](tomoto::IDMRModel& self, tomoto::Tid topic_id) {
48
+ [](tomoto::IDMRModel& self, tomoto::Tid topic_id) {
50
49
  return self.getLambdaByTopic(topic_id);
51
50
  })
52
51
  .define_method(
53
52
  "metadata_dict",
54
- *[](tomoto::IDMRModel& self) {
53
+ [](tomoto::IDMRModel& self) {
55
54
  auto dict = self.getMetadataDict();
56
55
  Array res;
57
56
  auto utf8 = Rice::Class(rb_cEncoding).call("const_get", "UTF_8");
58
57
  for (size_t i = 0; i < dict.size(); i++) {
59
- res.push(to_ruby<std::string>(dict.toWord(i)).call("force_encoding", utf8));
58
+ VALUE value = Rice::detail::To_Ruby<std::string>().convert(dict.toWord(i));
59
+ Object obj(value);
60
+ res.push(obj.call("force_encoding", utf8));
60
61
  }
61
62
  return res;
62
63
  })
63
64
  .define_method(
64
65
  "sigma",
65
- *[](tomoto::IDMRModel& self) {
66
+ [](tomoto::IDMRModel& self) {
66
67
  return self.getSigma();
67
68
  });
68
69
  }
data/ext/tomoto/dt.cpp CHANGED
@@ -1,14 +1,14 @@
1
1
  #include <DT.h>
2
2
 
3
- #include <rice/Module.hpp>
3
+ #include <rice/rice.hpp>
4
4
 
5
5
  #include "utils.h"
6
6
 
7
7
  void init_dt(Rice::Module& m) {
8
8
  Rice::define_class_under<tomoto::IDTModel, tomoto::ILDAModel>(m, "DT")
9
- .define_singleton_method(
9
+ .define_singleton_function(
10
10
  "_new",
11
- *[](size_t tw, size_t k, size_t t, tomoto::Float alphaVar, tomoto::Float etaVar, tomoto::Float phiVar, tomoto::Float shapeA, tomoto::Float shapeB, tomoto::Float shapeC) {
11
+ [](size_t tw, size_t k, size_t t, tomoto::Float alphaVar, tomoto::Float etaVar, tomoto::Float phiVar, tomoto::Float shapeA, tomoto::Float shapeB, tomoto::Float shapeC) {
12
12
  // Rice only supports 10 arguments
13
13
  size_t seed = -1;
14
14
  tomoto::DTArgs args;
@@ -24,17 +24,17 @@ void init_dt(Rice::Module& m) {
24
24
  args.seed = seed;
25
25
  }
26
26
  return tomoto::IDTModel::create((tomoto::TermWeight)tw, args);
27
- })
27
+ }, Rice::Return().takeOwnership())
28
28
  .define_method(
29
29
  "_add_doc",
30
- *[](tomoto::IDTModel& self, std::vector<std::string> words, uint32_t timepoint) {
30
+ [](tomoto::IDTModel& self, std::vector<std::string> words, uint32_t timepoint) {
31
31
  auto doc = buildDoc(words);
32
32
  doc.misc["timepoint"] = timepoint;
33
33
  return self.addDoc(doc);
34
34
  })
35
35
  .define_method(
36
36
  "alpha",
37
- *[](tomoto::IDTModel& self) {
37
+ [](tomoto::IDTModel& self) {
38
38
  Array res;
39
39
  for (size_t i = 0; i < self.getK(); i++) {
40
40
  Array res2;
@@ -47,45 +47,45 @@ void init_dt(Rice::Module& m) {
47
47
  })
48
48
  .define_method(
49
49
  "lr_a",
50
- *[](tomoto::IDTModel& self) {
50
+ [](tomoto::IDTModel& self) {
51
51
  return self.getShapeA();
52
52
  })
53
53
  .define_method(
54
54
  "lr_a=",
55
- *[](tomoto::IDTModel& self, tomoto::Float value) {
55
+ [](tomoto::IDTModel& self, tomoto::Float value) {
56
56
  self.setShapeA(value);
57
57
  return value;
58
58
  })
59
59
  .define_method(
60
60
  "lr_b",
61
- *[](tomoto::IDTModel& self) {
61
+ [](tomoto::IDTModel& self) {
62
62
  return self.getShapeB();
63
63
  })
64
64
  .define_method(
65
65
  "lr_b=",
66
- *[](tomoto::IDTModel& self, tomoto::Float value) {
66
+ [](tomoto::IDTModel& self, tomoto::Float value) {
67
67
  self.setShapeB(value);
68
68
  return value;
69
69
  })
70
70
  .define_method(
71
71
  "lr_c",
72
- *[](tomoto::IDTModel& self) {
72
+ [](tomoto::IDTModel& self) {
73
73
  return self.getShapeC();
74
74
  })
75
75
  .define_method(
76
76
  "lr_c=",
77
- *[](tomoto::IDTModel& self, tomoto::Float value) {
77
+ [](tomoto::IDTModel& self, tomoto::Float value) {
78
78
  self.setShapeC(value);
79
79
  return value;
80
80
  })
81
81
  .define_method(
82
82
  "num_docs_by_timepoint",
83
- *[](tomoto::IDTModel& self) {
83
+ [](tomoto::IDTModel& self) {
84
84
  return self.getNumDocsByT();
85
85
  })
86
86
  .define_method(
87
87
  "num_timepoints",
88
- *[](tomoto::IDTModel& self) {
88
+ [](tomoto::IDTModel& self) {
89
89
  return self.getT();
90
90
  });
91
91
  }
data/ext/tomoto/ext.cpp CHANGED
@@ -1,4 +1,4 @@
1
- #include <rice/Module.hpp>
1
+ #include <rice/rice.hpp>
2
2
 
3
3
  void init_lda(Rice::Module& m);
4
4
  void init_ct(Rice::Module& m);
@@ -18,17 +18,17 @@ extern "C"
18
18
  void Init_ext()
19
19
  {
20
20
  auto m = Rice::define_module("Tomoto")
21
- .define_singleton_method(
21
+ .define_singleton_function(
22
22
  "isa",
23
- *[]() {
23
+ []() {
24
24
  #ifdef __AVX2__
25
- return "avx2";
25
+ return Rice::String("avx2");
26
26
  #elif defined(__AVX__)
27
- return "avx";
27
+ return Rice::String("avx");
28
28
  #elif defined(__SSE2__) || defined(__x86_64__) || defined(_WIN64)
29
- return "sse2";
29
+ return Rice::String("sse2");
30
30
  #else
31
- return "none";
31
+ return Rice::String("none");
32
32
  #endif
33
33
  });
34
34
 
@@ -1,8 +1,6 @@
1
1
  require "mkmf-rice"
2
2
 
3
- abort "Missing stdc++" unless have_library("stdc++")
4
-
5
- $CXXFLAGS += " -std=c++14 -DEIGEN_MPL2_ONLY"
3
+ $CXXFLAGS += " -std=c++17 $(optflags) -DEIGEN_MPL2_ONLY"
6
4
 
7
5
  $CXXFLAGS += " -march=native"
8
6
 
data/ext/tomoto/gdmr.cpp CHANGED
@@ -1,14 +1,14 @@
1
1
  #include <GDMR.h>
2
2
 
3
- #include <rice/Module.hpp>
3
+ #include <rice/rice.hpp>
4
4
 
5
5
  #include "utils.h"
6
6
 
7
7
  void init_gdmr(Rice::Module& m) {
8
8
  Rice::define_class_under<tomoto::IGDMRModel, tomoto::IDMRModel>(m, "GDMR")
9
- .define_singleton_method(
9
+ .define_singleton_function(
10
10
  "_new",
11
- *[](size_t tw, size_t k, std::vector<uint64_t> degrees, tomoto::Float alpha, tomoto::Float sigma, tomoto::Float sigma0, tomoto::Float eta, tomoto::Float alpha_epsilon, size_t seed) {
11
+ [](size_t tw, size_t k, std::vector<uint64_t> degrees, tomoto::Float alpha, tomoto::Float sigma, tomoto::Float sigma0, tomoto::Float eta, tomoto::Float alpha_epsilon, size_t seed) {
12
12
  tomoto::GDMRArgs args;
13
13
  args.k = k;
14
14
  args.degrees = degrees;
@@ -21,22 +21,22 @@ void init_gdmr(Rice::Module& m) {
21
21
  args.seed = seed;
22
22
  }
23
23
  return tomoto::IGDMRModel::create((tomoto::TermWeight)tw, args);
24
- })
24
+ }, Rice::Return().takeOwnership())
25
25
  .define_method(
26
26
  "_add_doc",
27
- *[](tomoto::IGDMRModel& self, std::vector<std::string> words, std::vector<tomoto::Float> numeric_metadata) {
27
+ [](tomoto::IGDMRModel& self, std::vector<std::string> words, std::vector<tomoto::Float> numeric_metadata) {
28
28
  auto doc = buildDoc(words);
29
29
  doc.misc["numeric_metadata"] = numeric_metadata;
30
30
  return self.addDoc(doc);
31
31
  })
32
32
  .define_method(
33
33
  "degrees",
34
- *[](tomoto::IGDMRModel& self) {
34
+ [](tomoto::IGDMRModel& self) {
35
35
  return self.getFs();
36
36
  })
37
37
  .define_method(
38
38
  "sigma0",
39
- *[](tomoto::IGDMRModel& self) {
39
+ [](tomoto::IGDMRModel& self) {
40
40
  return self.getSigma0();
41
41
  });
42
42
  }
data/ext/tomoto/hdp.cpp CHANGED
@@ -1,14 +1,14 @@
1
1
  #include <HDP.h>
2
2
 
3
- #include <rice/Module.hpp>
3
+ #include <rice/rice.hpp>
4
4
 
5
5
  #include "utils.h"
6
6
 
7
7
  void init_hdp(Rice::Module& m) {
8
8
  Rice::define_class_under<tomoto::IHDPModel, tomoto::ILDAModel>(m, "HDP")
9
- .define_singleton_method(
9
+ .define_singleton_function(
10
10
  "_new",
11
- *[](size_t tw, size_t k, tomoto::Float alpha, tomoto::Float eta, tomoto::Float gamma, size_t seed) {
11
+ [](size_t tw, size_t k, tomoto::Float alpha, tomoto::Float eta, tomoto::Float gamma, size_t seed) {
12
12
  tomoto::HDPArgs args;
13
13
  args.k = k;
14
14
  args.alpha = {alpha};
@@ -18,30 +18,30 @@ void init_hdp(Rice::Module& m) {
18
18
  args.seed = seed;
19
19
  }
20
20
  return tomoto::IHDPModel::create((tomoto::TermWeight)tw, args);
21
- })
21
+ }, Rice::Return().takeOwnership())
22
22
  .define_method(
23
23
  "alpha",
24
- *[](tomoto::IHDPModel& self) {
24
+ [](tomoto::IHDPModel& self) {
25
25
  return self.getAlpha();
26
26
  })
27
27
  .define_method(
28
28
  "gamma",
29
- *[](tomoto::IHDPModel& self) {
29
+ [](tomoto::IHDPModel& self) {
30
30
  return self.getGamma();
31
31
  })
32
32
  .define_method(
33
33
  "live_k",
34
- *[](tomoto::IHDPModel& self) {
34
+ [](tomoto::IHDPModel& self) {
35
35
  return self.getLiveK();
36
36
  })
37
37
  .define_method(
38
38
  "live_topic?",
39
- *[](tomoto::IHDPModel& self, size_t tid) {
39
+ [](tomoto::IHDPModel& self, size_t tid) {
40
40
  return self.isLiveTopic(tid);
41
41
  })
42
42
  .define_method(
43
43
  "num_tables",
44
- *[](tomoto::IHDPModel& self) {
44
+ [](tomoto::IHDPModel& self) {
45
45
  return self.getTotalTables();
46
46
  });
47
47
  }
data/ext/tomoto/hlda.cpp CHANGED
@@ -1,14 +1,14 @@
1
1
  #include <HLDA.h>
2
2
 
3
- #include <rice/Module.hpp>
3
+ #include <rice/rice.hpp>
4
4
 
5
5
  #include "utils.h"
6
6
 
7
7
  void init_hlda(Rice::Module& m) {
8
8
  Rice::define_class_under<tomoto::IHLDAModel, tomoto::ILDAModel>(m, "HLDA")
9
- .define_singleton_method(
9
+ .define_singleton_function(
10
10
  "_new",
11
- *[](size_t tw, size_t levelDepth, tomoto::Float alpha, tomoto::Float eta, tomoto::Float gamma, size_t seed) {
11
+ [](size_t tw, size_t levelDepth, tomoto::Float alpha, tomoto::Float eta, tomoto::Float gamma, size_t seed) {
12
12
  tomoto::HLDAArgs args;
13
13
  args.k = levelDepth;
14
14
  args.alpha = {alpha};
@@ -18,10 +18,10 @@ void init_hlda(Rice::Module& m) {
18
18
  args.seed = seed;
19
19
  }
20
20
  return tomoto::IHLDAModel::create((tomoto::TermWeight)tw, args);
21
- })
21
+ }, Rice::Return().takeOwnership())
22
22
  .define_method(
23
23
  "alpha",
24
- *[](tomoto::IHLDAModel& self) {
24
+ [](tomoto::IHLDAModel& self) {
25
25
  Array res;
26
26
  for (size_t i = 0; i < self.getLevelDepth(); i++) {
27
27
  res.push(self.getAlpha(i));
@@ -30,42 +30,42 @@ void init_hlda(Rice::Module& m) {
30
30
  })
31
31
  .define_method(
32
32
  "_children_topics",
33
- *[](tomoto::IHLDAModel& self, tomoto::Tid topic_id) {
33
+ [](tomoto::IHLDAModel& self, tomoto::Tid topic_id) {
34
34
  return self.getChildTopicId(topic_id);
35
35
  })
36
36
  .define_method(
37
37
  "depth",
38
- *[](tomoto::IHLDAModel& self) {
38
+ [](tomoto::IHLDAModel& self) {
39
39
  return self.getLevelDepth();
40
40
  })
41
41
  .define_method(
42
42
  "gamma",
43
- *[](tomoto::IHLDAModel& self) {
43
+ [](tomoto::IHLDAModel& self) {
44
44
  return self.getGamma();
45
45
  })
46
46
  .define_method(
47
47
  "_level",
48
- *[](tomoto::IHLDAModel& self, tomoto::Tid topic_id) {
48
+ [](tomoto::IHLDAModel& self, tomoto::Tid topic_id) {
49
49
  return self.getLevelOfTopic(topic_id);
50
50
  })
51
51
  .define_method(
52
52
  "live_k",
53
- *[](tomoto::IHLDAModel& self) {
53
+ [](tomoto::IHLDAModel& self) {
54
54
  return self.getLiveK();
55
55
  })
56
56
  .define_method(
57
57
  "_live_topic?",
58
- *[](tomoto::IHLDAModel& self, tomoto::Tid topic_id) {
58
+ [](tomoto::IHLDAModel& self, tomoto::Tid topic_id) {
59
59
  return self.isLiveTopic(topic_id);
60
60
  })
61
61
  .define_method(
62
62
  "_num_docs_of_topic",
63
- *[](tomoto::IHLDAModel& self, tomoto::Tid topic_id) {
63
+ [](tomoto::IHLDAModel& self, tomoto::Tid topic_id) {
64
64
  return self.getNumDocsOfTopic(topic_id);
65
65
  })
66
66
  .define_method(
67
67
  "_parent_topic",
68
- *[](tomoto::IHLDAModel& self, tomoto::Tid topic_id) {
68
+ [](tomoto::IHLDAModel& self, tomoto::Tid topic_id) {
69
69
  return self.getParentTopicId(topic_id);
70
70
  });
71
71
  }