tomoto 0.6.1-aarch64-linux → 0.6.2-aarch64-linux

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6352033a1cead278ee772904df090e69da5fd4c41e758991032bb06bf07cc51c
4
- data.tar.gz: d3c2f24aa4b3706db17326ced7a70ce486f8c913712553740cbf07e2f29cf0c7
3
+ metadata.gz: 6149ab4bdafde3490087cc9049e2dc95db822edd9523fab29520bad72a6d9351
4
+ data.tar.gz: cd793b6c02de79d5fff809b2dfc69a12804757371fa94b51cb3e4afdd7088532
5
5
  SHA512:
6
- metadata.gz: 98fce9e33c228e617632aa963ac8bab070082b52c4a499fc337af304cfa714b1d12d25fdc050f9176b7f0578ba3405631d0eab81662ad7cba6da0ed3024ff42c
7
- data.tar.gz: 1017e7a8a4d3136e56175403708820086cbae9e74cf24b5b6642f8d913d25d5008d08d8e4c31a854075da0915aac4f37f5c7ca4da0b73d0c6618a7dde146b708
6
+ metadata.gz: a2c5cf477cb6bd2cc59e8f6fb6b58e777e8eef359e2ee7b2d0e7bbda004b558929bc2c96c6882e29b331ea0ccd523128b1e1c7ffd5f82a42e946e70888c50a6d
7
+ data.tar.gz: 6ec815bdde4009003903cff15eda4d022cfb78bb69b7a741371ece31ce7b834d93e86fbc29aee651880e1828366f6d05c43b26837e918c971abe2f1352856578
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.6.2 (2026-02-21)
2
+
3
+ - Updated tomoto to 0.14.0
4
+ - Fixed memory leak with `make_doc` method
5
+
1
6
  ## 0.6.1 (2026-01-01)
2
7
 
3
8
  - Added support for Ruby 4.0
data/ext/tomoto/ct.cpp CHANGED
@@ -16,7 +16,7 @@ void init_ct(Rice::Module& m) {
16
16
  if (seed >= 0) {
17
17
  args.seed = seed;
18
18
  }
19
- return tomoto::ICTModel::create((tomoto::TermWeight)tw, args);
19
+ return tomoto::ICTModel::create((tomoto::TermWeight)tw, args).release();
20
20
  }, Rice::Return().takeOwnership())
21
21
  .define_method(
22
22
  "_correlations",
data/ext/tomoto/dmr.cpp CHANGED
@@ -22,7 +22,7 @@ void init_dmr(Rice::Module& m) {
22
22
  if (seed >= 0) {
23
23
  args.seed = seed;
24
24
  }
25
- return tomoto::IDMRModel::create((tomoto::TermWeight)tw, args);
25
+ return tomoto::IDMRModel::create((tomoto::TermWeight)tw, args).release();
26
26
  }, Rice::Return().takeOwnership())
27
27
  .define_method(
28
28
  "_add_doc",
data/ext/tomoto/dt.cpp CHANGED
@@ -27,7 +27,7 @@ void init_dt(Rice::Module& m) {
27
27
  if (seed >= 0) {
28
28
  args.seed = seed;
29
29
  }
30
- return tomoto::IDTModel::create((tomoto::TermWeight)tw, args);
30
+ return tomoto::IDTModel::create((tomoto::TermWeight)tw, args).release();
31
31
  }, Rice::Return().takeOwnership())
32
32
  .define_method(
33
33
  "_add_doc",
@@ -19,25 +19,21 @@ end
19
19
  apple_clang = RbConfig::CONFIG["CC_VERSION_MESSAGE"] =~ /apple clang/i
20
20
 
21
21
  if apple_clang
22
- # silence rice warnings
23
- $CXXFLAGS += " -Wno-deprecated-declarations"
22
+ # silence tomoto warnings
23
+ $CXXFLAGS += " -Wno-switch -Wno-unqualified-std-cast-call -Wno-inconsistent-missing-override"
24
24
  else
25
25
  # silence eigen warnings
26
- $CXXFLAGS += " -Wno-ignored-attributes -Wno-deprecated-copy"
26
+ $CXXFLAGS += " -Wno-ignored-attributes"
27
27
  end
28
28
 
29
- # silence tomoto warnings
30
- $CXXFLAGS += " -Wno-unused-variable -Wno-switch -Wno-unqualified-std-cast-call"
31
-
32
29
  ext = File.expand_path(".", __dir__)
33
30
  tomoto = File.expand_path("../../vendor/tomotopy/src/TopicModel", __dir__)
34
31
  tomoto_utils = File.expand_path("../../vendor/tomotopy/src/Utils", __dir__)
35
32
  eigen = File.expand_path("../../vendor/eigen", __dir__)
36
33
  eigen_rand = File.expand_path("../../vendor/EigenRand", __dir__)
37
- variant = File.expand_path("../../vendor/variant/include", __dir__)
38
34
 
39
35
  $srcs = Dir["{#{ext},#{tomoto},#{tomoto_utils}}/*.cpp"]
40
- $INCFLAGS += " -I#{tomoto} -I#{eigen} -I#{eigen_rand} -I#{variant}"
36
+ $INCFLAGS += " -I#{tomoto} -I#{eigen} -I#{eigen_rand}"
41
37
  $VPATH << tomoto
42
38
  $VPATH << tomoto_utils
43
39
 
data/ext/tomoto/gdmr.cpp CHANGED
@@ -24,7 +24,7 @@ void init_gdmr(Rice::Module& m) {
24
24
  if (seed >= 0) {
25
25
  args.seed = seed;
26
26
  }
27
- return tomoto::IGDMRModel::create((tomoto::TermWeight)tw, args);
27
+ return tomoto::IGDMRModel::create((tomoto::TermWeight)tw, args).release();
28
28
  }, Rice::Return().takeOwnership())
29
29
  .define_method(
30
30
  "_add_doc",
data/ext/tomoto/hdp.cpp CHANGED
@@ -17,7 +17,7 @@ void init_hdp(Rice::Module& m) {
17
17
  if (seed >= 0) {
18
18
  args.seed = seed;
19
19
  }
20
- return tomoto::IHDPModel::create((tomoto::TermWeight)tw, args);
20
+ return tomoto::IHDPModel::create((tomoto::TermWeight)tw, args).release();
21
21
  }, Rice::Return().takeOwnership())
22
22
  .define_method(
23
23
  "alpha",
data/ext/tomoto/hlda.cpp CHANGED
@@ -17,7 +17,7 @@ void init_hlda(Rice::Module& m) {
17
17
  if (seed >= 0) {
18
18
  args.seed = seed;
19
19
  }
20
- return tomoto::IHLDAModel::create((tomoto::TermWeight)tw, args);
20
+ return tomoto::IHLDAModel::create((tomoto::TermWeight)tw, args).release();
21
21
  }, Rice::Return().takeOwnership())
22
22
  .define_method(
23
23
  "alpha",
data/ext/tomoto/hpa.cpp CHANGED
@@ -17,7 +17,7 @@ void init_hpa(Rice::Module& m) {
17
17
  if (seed >= 0) {
18
18
  args.seed = seed;
19
19
  }
20
- return tomoto::IHPAModel::create((tomoto::TermWeight)tw, false, args);
20
+ return tomoto::IHPAModel::create((tomoto::TermWeight)tw, false, args).release();
21
21
  }, Rice::Return().takeOwnership())
22
22
  .define_method(
23
23
  "alpha",
data/ext/tomoto/lda.cpp CHANGED
@@ -12,10 +12,36 @@
12
12
 
13
13
  class DocumentObject {
14
14
  public:
15
- DocumentObject(const tomoto::DocumentBase* _doc, const tomoto::ITopicModel* _tm) : doc{ _doc }, tm{ _tm } {}
15
+ DocumentObject(const tomoto::DocumentBase* _doc, const tomoto::ITopicModel* _tm, bool _owner = false) : doc{ _doc }, tm{ _tm }, owner{ _owner } {}
16
+
17
+ ~DocumentObject() {
18
+ if (owner && doc) {
19
+ delete doc;
20
+ doc = NULL;
21
+ }
22
+ }
23
+
24
+ // prevent copy
25
+ DocumentObject(const DocumentObject&) = delete;
26
+ DocumentObject& operator=(const DocumentObject&) = delete;
27
+
28
+ DocumentObject(DocumentObject&& other) noexcept {
29
+ *this = std::move(other);
30
+ }
31
+
32
+ DocumentObject& operator=(DocumentObject&& other) noexcept {
33
+ if (this != &other) {
34
+ doc = other.doc;
35
+ tm = other.tm;
36
+ owner = other.owner;
37
+ other.owner = false;
38
+ }
39
+ return *this;
40
+ }
16
41
 
17
42
  const tomoto::DocumentBase* doc;
18
43
  const tomoto::ITopicModel* tm;
44
+ bool owner;
19
45
  };
20
46
 
21
47
  void init_lda(Rice::Module& m) {
@@ -42,7 +68,7 @@ void init_lda(Rice::Module& m) {
42
68
  if (seed >= 0) {
43
69
  args.seed = seed;
44
70
  }
45
- return tomoto::ILDAModel::create((tomoto::TermWeight)tw, args);
71
+ return tomoto::ILDAModel::create((tomoto::TermWeight)tw, args).release();
46
72
  }, Rice::Return().takeOwnership())
47
73
  .define_method(
48
74
  "_add_doc",
@@ -52,7 +78,7 @@ void init_lda(Rice::Module& m) {
52
78
  .define_method(
53
79
  "_make_doc",
54
80
  [](tomoto::ILDAModel& self, std::vector<std::string> words) {
55
- return DocumentObject(self.makeDoc(buildDoc(words)).release(), &self);
81
+ return DocumentObject(self.makeDoc(buildDoc(words)).release(), &self, true);
56
82
  })
57
83
  .define_method(
58
84
  "_infer",
data/ext/tomoto/llda.cpp CHANGED
@@ -20,7 +20,7 @@ void init_llda(Rice::Module& m) {
20
20
  if (seed >= 0) {
21
21
  args.seed = seed;
22
22
  }
23
- return tomoto::ILLDAModel::create((tomoto::TermWeight)tw, args);
23
+ return tomoto::ILLDAModel::create((tomoto::TermWeight)tw, args).release();
24
24
  }, Rice::Return().takeOwnership())
25
25
  .define_method(
26
26
  "_add_doc",
data/ext/tomoto/mglda.cpp CHANGED
@@ -23,7 +23,7 @@ void init_mglda(Rice::Module& m) {
23
23
  args.alphaML = alpha_ml;
24
24
  args.eta = eta_g;
25
25
  // TODO more args
26
- return tomoto::IMGLDAModel::create((tomoto::TermWeight)tw, args);
26
+ return tomoto::IMGLDAModel::create((tomoto::TermWeight)tw, args).release();
27
27
  }, Rice::Return().takeOwnership())
28
28
  .define_method(
29
29
  "_add_doc",
data/ext/tomoto/pa.cpp CHANGED
@@ -17,7 +17,7 @@ void init_pa(Rice::Module& m) {
17
17
  if (seed >= 0) {
18
18
  args.seed = seed;
19
19
  }
20
- return tomoto::IPAModel::create((tomoto::TermWeight)tw, args);
20
+ return tomoto::IPAModel::create((tomoto::TermWeight)tw, args).release();
21
21
  }, Rice::Return().takeOwnership())
22
22
  .define_method(
23
23
  "k1",
data/ext/tomoto/plda.cpp CHANGED
@@ -20,7 +20,7 @@ void init_plda(Rice::Module& m) {
20
20
  if (seed >= 0) {
21
21
  args.seed = seed;
22
22
  }
23
- return tomoto::IPLDAModel::create((tomoto::TermWeight)tw, args);
23
+ return tomoto::IPLDAModel::create((tomoto::TermWeight)tw, args).release();
24
24
  }, Rice::Return().takeOwnership())
25
25
  .define_method(
26
26
  "_add_doc",
data/ext/tomoto/slda.cpp CHANGED
@@ -29,7 +29,7 @@ void init_slda(Rice::Module& m) {
29
29
  if (seed >= 0) {
30
30
  args.seed = seed;
31
31
  }
32
- return tomoto::ISLDAModel::create((tomoto::TermWeight)tw, args);
32
+ return tomoto::ISLDAModel::create((tomoto::TermWeight)tw, args).release();
33
33
  }, Rice::Return().takeOwnership())
34
34
  .define_method(
35
35
  "_add_doc",
Binary file
Binary file
Binary file
Binary file
data/lib/tomoto/lda.rb CHANGED
@@ -11,6 +11,7 @@ module Tomoto
11
11
  def self.load(filename)
12
12
  model = new
13
13
  model._load(filename)
14
+ model.instance_variable_set(:@prepared, true)
14
15
  model
15
16
  end
16
17
 
@@ -1,3 +1,3 @@
1
1
  module Tomoto
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
@@ -2,10 +2,10 @@
2
2
  * @file EigenRand
3
3
  * @author bab2min (bab2min@gmail.com)
4
4
  * @brief
5
- * @version 0.4.1
6
- * @date 2022-08-13
7
- *
8
- * @copyright Copyright (c) 2020-2021
5
+ * @version 0.5.1
6
+ * @date 2024-09-08
7
+ *
8
+ * @copyright Copyright (c) 2020-2024
9
9
  *
10
10
  */
11
11