Class: GSL::Matrix

Inherits:
Object
  • Object
show all
Defined in:
lib/lsh/math_util_gsl.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.json_create(o) ⇒ Object



77
78
79
# File 'lib/lsh/math_util_gsl.rb', line 77

def self.json_create(o)
  alloc(*o['data'])
end

Instance Method Details

#hashObject



81
82
83
# File 'lib/lsh/math_util_gsl.rb', line 81

def hash
  to_a.hash
end

#load(file) ⇒ Object



89
90
91
# File 'lib/lsh/math_util_gsl.rb', line 89

def load(file)
  fread(file)
end

#save(file) ⇒ Object



85
86
87
# File 'lib/lsh/math_util_gsl.rb', line 85

def save(file)
  fwrite(file)
end

#to_json(*a) ⇒ Object



70
71
72
73
74
75
# File 'lib/lsh/math_util_gsl.rb', line 70

def to_json(*a)
  {
    'json_class' => self.class.name,
    'data' => to_a,
  }.to_json(*a)
end