Method: Abst::Matrix#initialize
- Defined in:
- lib/include/matrix.rb
#initialize(m) ⇒ Matrix
Returns a new instance of Matrix.
22 23 24 25 26 27 28 29 |
# File 'lib/include/matrix.rb', line 22 def initialize(m) raise MatrixSizeError unless self.class.height == m.size @coef = m.map{|row| self.class.coef_vector.new(row)} @height = self.class.height @width = self.class.width rescue VectorSizeError raise MatrixSizeError end |