thera 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/ext/extconf.rb CHANGED
@@ -2,6 +2,7 @@ require 'mkmf-rice'
2
2
 
3
3
  QUARRY_H = 'quarry.h'
4
4
  MARKER = 'mkmf_marker'
5
+ cflags = '-x c++'
5
6
  quarry_dir = File.join(File.dirname(__FILE__), '..', 'lib', 'quarry')
6
7
  quarry_obj = File.join(quarry_dir, 'obj')
7
8
  quarry_src = File.join(quarry_dir, 'src')
@@ -14,6 +15,7 @@ Dir.chdir(quarry_dir) do
14
15
  `make -f Makefile.osx clean`
15
16
  `make -f Makefile.osx`
16
17
  else
18
+ cflags += ' -std=g++0x -Wno-multichar -frtti'
17
19
  puts "Compiling quarry (linux mode)"
18
20
  `make -f Makefile.linux clean`
19
21
  `make -f Makefile.linux`
@@ -21,7 +23,7 @@ Dir.chdir(quarry_dir) do
21
23
  end
22
24
 
23
25
  # the cflags are required to make mkmf compile in c++ mode
24
- with_cflags("-x c++") do
26
+ with_cflags(cflags) do
25
27
  find_header(QUARRY_H, quarry_src)
26
28
  $LIBPATH << quarry_obj
27
29
  have_library('quarry', MARKER, quarry_header)
@@ -1,2 +1,4 @@
1
1
  STATIC_LIB = ar rcs
2
+ CXX = g++
3
+ CPPFLAGS = -fPIC -std=gnu++0x -Wno-multichar -Wno-write-strings
2
4
  include Makefile.targets
@@ -6,6 +6,7 @@
6
6
  #include <vector>
7
7
  #include <iostream>
8
8
  #include <typeinfo>
9
+ #include <stdint.h>
9
10
  using namespace std;
10
11
 
11
12
  namespace Storage {
@@ -2,6 +2,7 @@
2
2
  #define __naive_bayes_classifier_h__
3
3
  #include "classifier/classifier.h"
4
4
  #include <vector>
5
+ #include <cmath>
5
6
 
6
7
  namespace Classifier {
7
8
  class NaiveBayesClassifier : public Classifier {
@@ -3,6 +3,8 @@
3
3
  #include "data_set/example.h"
4
4
  #include "data_set/feature.h"
5
5
  #include <iostream>
6
+ #include <cstdlib>
7
+ #include <cstring>
6
8
 
7
9
  namespace DataSet {
8
10
  class DataSet;
@@ -19,7 +19,8 @@ void Storage::Folders::load_directory(string path, DataSet::SparseDataSet *data_
19
19
  string newpath;
20
20
  struct stat info;
21
21
  FILE *file;
22
- int file_length;
22
+ int file_length = 0;
23
+ int read = 0;
23
24
 
24
25
  while((dp = readdir(dir))) {
25
26
  // ignore files starting with a dot
@@ -47,7 +48,7 @@ void Storage::Folders::load_directory(string path, DataSet::SparseDataSet *data_
47
48
  }
48
49
 
49
50
  // read into the buffer
50
- fread(file_data, 1, file_length - 1, file);
51
+ read = fread(file_data, 1, file_length - 1, file);
51
52
  file_data[file_length - 1] = 0;
52
53
  fclose(file);
53
54
 
data/thera.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.description = "C++ Data Mining Library for Ruby"
10
10
  s.email = "me@willcannings.com"
11
11
  s.authors = ["Will Cannings"]
12
- s.version = '0.0.4'
12
+ s.version = '0.0.5'
13
13
  s.extensions = ["ext/extconf.rb"]
14
14
 
15
15
  s.files = `git ls-files`.split("\n")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thera
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-12 00:00:00.000000000Z
12
+ date: 2011-12-13 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rice
16
- requirement: &70137311664380 !ruby/object:Gem::Requirement
16
+ requirement: &70358172322420 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70137311664380
24
+ version_requirements: *70358172322420
25
25
  description: C++ Data Mining Library for Ruby
26
26
  email: me@willcannings.com
27
27
  executables: []