Class: JBLAS::DoubleMatrix

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.json_create(o) ⇒ Object



63
64
65
# File 'lib/lsh/math_util_jblas.rb', line 63

def self.json_create(o)
  from_array(o['data']).t
end

Instance Method Details

#sizeObject



67
68
69
# File 'lib/lsh/math_util_jblas.rb', line 67

def size
  [ rows, columns ]
end

#to_json(*a) ⇒ Object



56
57
58
59
60
61
# File 'lib/lsh/math_util_jblas.rb', line 56

def to_json(*a)
  {
    'json_class' => 'JBLAS::DoubleMatrix',
    'data' => to_a,
  }.to_json(*a)
end