Class: Matrix
- Inherits:
-
Object
- Object
- Matrix
- Defined in:
- lib/matrix_extensions.rb
Instance Method Summary collapse
Instance Method Details
#*(another) ⇒ Object
5 6 7 8 |
# File 'lib/matrix_extensions.rb', line 5 def *(another) return multiply(Matrix.columns([[another[:x], another[:y]]])) if another.kind_of? Hash multiply(another) end |
#as_hash ⇒ Object
10 11 12 |
# File 'lib/matrix_extensions.rb', line 10 def as_hash {:x => self[0,0], :y => self[1,0]} end |
#multiply ⇒ Object
4 |
# File 'lib/matrix_extensions.rb', line 4 alias_method :multiply, :* |