ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- unit-c.ri000064400000000363152414432470006307 0ustar00U:RDoc::AnyMethod[iI" unit:EFI"Matrix::unit;TT: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"(n);T@ FI" Matrix;TcRDoc::NormalClass0[@TI" identity;Fcomponent-i.ri000064400000000371152414432470007337 0ustar00U:RDoc::AnyMethod[iI"component:EFI"Matrix#component;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I" (i, j);T@ FI" Matrix;TcRDoc::NormalClass0[@FI"[];Fdiagonal%3f-i.ri000064400000000552152414432470007412 0ustar00U:RDoc::AnyMethod[iI"diagonal?:EFI"Matrix#diagonal?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"2Returns +true+ is this is a diagonal matrix. ;TI"-Raises an error if matrix is not square.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00elements_to_i-i.ri000064400000000360152414432470010161 0ustar00U:RDoc::AnyMethod[iI"elements_to_i:EFI"Matrix#elements_to_i;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI" Matrix;TcRDoc::NormalClass00round-i.ri000064400000000544152414432470006466 0ustar00U:RDoc::AnyMethod[iI" round:EFI"Matrix#round;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"BReturns a matrix with entries rounded to the given precision ;TI"(see Float#round);T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"(ndigits=0);T@FI" Matrix;TcRDoc::NormalClass00trace-i.ri000064400000000663152414432470006437 0ustar00U:RDoc::AnyMethod[iI" trace:EFI"Matrix#trace;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"@Returns the trace (sum of diagonal elements) of the matrix.;To:RDoc::Markup::Verbatim; [I" Matrix[[7,6], [3,9]].trace ;TI" => 16;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[[I"tr;Fo;; [; @;0I"();T@FI" Matrix;TcRDoc::NormalClass00element-i.ri000064400000000365152414432470006771 0ustar00U:RDoc::AnyMethod[iI" element:EFI"Matrix#element;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I" (i, j);T@ FI" Matrix;TcRDoc::NormalClass0[@FI"[];Frank_e-i.ri000064400000000443152414432470006574 0ustar00U:RDoc::AnyMethod[iI" rank_e:EFI"Matrix#rank_e;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I" deprecated; use Matrix#rank;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00row_vector-c.ri000064400000000705152414432470007521 0ustar00U:RDoc::AnyMethod[iI"row_vector:EFI"Matrix::row_vector;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"NCreates a single-row matrix where the values of that row are as given in ;TI" +row+.;To:RDoc::Markup::Verbatim; [I" Matrix.row_vector([4,5,6]) ;TI" => 4 5 6;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I" (row);T@FI" Matrix;TcRDoc::NormalClass00regular%3f-i.ri000064400000000513152414432470007272 0ustar00U:RDoc::AnyMethod[iI" regular?:EFI"Matrix#regular?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"DReturns +true+ if this is a regular (i.e. non-singular) matrix.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00inspect-i.ri000064400000000442152414432470007001 0ustar00U:RDoc::AnyMethod[iI" inspect:EFI"Matrix#inspect;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Overrides Object#inspect;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00rows-c.ri000064400000001157152414432470006324 0ustar00U:RDoc::AnyMethod[iI" rows:EFI"Matrix::rows;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"QCreates a matrix where +rows+ is an array of arrays, each of which is a row ;TI"Mof the matrix. If the optional argument +copy+ is false, use the given ;TI"Darrays as the internal structure of the matrix without copying.;To:RDoc::Markup::Verbatim; [I"'Matrix.rows([[25, 93], [-1, 66]]) ;TI" => 25 93 ;TI" -1 66;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"(rows, copy = true);T@FI" Matrix;TcRDoc::NormalClass00column_count-i.ri000064400000000446152414432470010045 0ustar00U:RDoc::Attr[iI"column_count:ETI"Matrix#column_count;TI"R;T: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"#Returns the number of columns.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below0F@I" Matrix;TcRDoc::NormalClass0to_a-i.ri000064400000000504152414432470006255 0ustar00U:RDoc::AnyMethod[iI" to_a:EFI"Matrix#to_a;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"EReturns an array of arrays that describe the rows of the matrix.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00rect-i.ri000064400000000761152414432470006275 0ustar00U:RDoc::AnyMethod[iI" rect:EFI"Matrix#rect;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"RReturns an array containing matrices corresponding to the real and imaginary ;TI"parts of the matrix;To:RDoc::Markup::BlankLineo; ; [I">m.rect == [m.real, m.imag] # ==> true for all matrices m;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[[I"rectangular;Fo;; [; @; 0I"();T@FI" Matrix;TcRDoc::NormalClass00column_vectors-i.ri000064400000000532152414432470010376 0ustar00U:RDoc::AnyMethod[iI"column_vectors:EFI"Matrix#column_vectors;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"GReturns an array of the column vectors of the matrix. See Vector.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00imag-i.ri000064400000000362152414432470006252 0ustar00U:RDoc::AnyMethod[iI" imag:EFI"Matrix#imag;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI" Matrix;TcRDoc::NormalClass0[@FI"imaginary;Feigensystem-i.ri000064400000001114152414432470007665 0ustar00U:RDoc::AnyMethod[iI"eigensystem:EFI"Matrix#eigensystem;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"JReturns the Eigensystem of the matrix; see +EigenvalueDecomposition+.;To:RDoc::Markup::Verbatim; [ I" m = Matrix[[1, 2], [3, 4]] ;TI"!v, d, v_inv = m.eigensystem ;TI"d.diagonal? # => true ;TI"v.inv == v_inv # => true ;TI",(v * d * v_inv).round(5) == m # => true;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[[I" eigen;Fo;; [; @;0I"();T@FI" Matrix;TcRDoc::NormalClass00%5b%5d-c.ri000064400000000647152414432470006206 0ustar00U:RDoc::AnyMethod[iI"[]:EFI"Matrix::[];TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"3Creates a matrix where each argument is a row.;To:RDoc::Markup::Verbatim; [I""Matrix[ [25, 93], [-1, 66] ] ;TI" => 25 93 ;TI" -1 66;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I" (*rows);T@FI" Matrix;TcRDoc::NormalClass00hermitian%3f-i.ri000064400000000556152414432470007620 0ustar00U:RDoc::AnyMethod[iI"hermitian?:EFI"Matrix#hermitian?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"4Returns +true+ is this is an hermitian matrix. ;TI"-Raises an error if matrix is not square.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00eql%3f-i.ri000064400000000343152414432470006413 0ustar00U:RDoc::AnyMethod[iI" eql?:EFI"Matrix#eql?;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I" (other);T@ FI" Matrix;TcRDoc::NormalClass00elements_to_f-i.ri000064400000000360152414432470010156 0ustar00U:RDoc::AnyMethod[iI"elements_to_f:EFI"Matrix#elements_to_f;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI" Matrix;TcRDoc::NormalClass00det_e-i.ri000064400000000370152414432470006414 0ustar00U:RDoc::AnyMethod[iI" det_e:EFI"Matrix#det_e;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI" Matrix;TcRDoc::NormalClass0[@FI"determinant_e;Fnew-c.ri000064400000000552152414432470006121 0ustar00U:RDoc::AnyMethod[iI"new:ETI"Matrix::new;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"KMatrix.new is private; use Matrix.rows, columns, [], etc... to create.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"((rows, column_count = rows[0].size);T@FI" Matrix;TcRDoc::NormalClass00rank-i.ri000064400000001110152414432470006260 0ustar00U:RDoc::AnyMethod[iI" rank:EFI"Matrix#rank;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [ I"%Returns the rank of the matrix. ;TI"@Beware that using Float values can yield erroneous results ;TI")because of their lack of precision. ;TI"DConsider using exact types like Rational or BigDecimal instead.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [I"Matrix[[7,6], [3,9]].rank ;TI" => 2;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00normal%3f-i.ri000064400000000544152414432470007125 0ustar00U:RDoc::AnyMethod[iI" normal?:EFI"Matrix#normal?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"0Returns +true+ is this is a normal matrix. ;TI"-Raises an error if matrix is not square.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00set_component-i.ri000064400000000406152414432470010211 0ustar00U:RDoc::AnyMethod[iI"set_component:EFI"Matrix#set_component;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"(i, j, v);T@ FI" Matrix;TcRDoc::NormalClass0[@FI"[]=;Fempty%3f-i.ri000064400000000563152414432470006774 0ustar00U:RDoc::AnyMethod[iI" empty?:EFI"Matrix#empty?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"KReturns +true+ if this is an empty matrix, i.e. if the number of rows ;TI"#or the number of columns is 0.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00rows-i.ri000064400000000415152414432470006326 0ustar00U:RDoc::Attr[iI" rows:ETI"Matrix#rows;TI"R;T:protectedo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"instance creations;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below0F@I" Matrix;TcRDoc::NormalClass0row_size-i.ri000064400000000372152414432470007177 0ustar00U:RDoc::AnyMethod[iI" row_size:ETI"Matrix#row_size;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI" Matrix;TcRDoc::NormalClass0[@FI"row_count;Fcoerce-i.ri000064400000001047152414432470006576 0ustar00U:RDoc::AnyMethod[iI" coerce:EFI"Matrix#coerce;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [ I"@The coerce method provides support for Ruby type coercion. ;TI"BThis coercion mechanism is used by Ruby to handle mixed-type ;TI"Dnumeric operations: it is intended to find a compatible common ;TI"4type between the two operands of the operator. ;TI"See also Numeric#coerce.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I" (other);T@FI" Matrix;TcRDoc::NormalClass00set_element-i.ri000064400000000402152414432470007634 0ustar00U:RDoc::AnyMethod[iI"set_element:EFI"Matrix#set_element;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"(i, j, v);T@ FI" Matrix;TcRDoc::NormalClass0[@FI"[]=;Frow-i.ri000064400000000651152414432470006145 0ustar00U:RDoc::AnyMethod[iI"row:EFI"Matrix#row;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"QReturns row vector number +i+ of the matrix as a Vector (starting at 0 like ;TI"Qan array). When a block is given, the elements of that vector are iterated.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below00I"e;F[I"(i);T@FI" Matrix;TcRDoc::NormalClass00%2a-i.ri000064400000000615152414432470005705 0ustar00U:RDoc::AnyMethod[iI"*:ETI" Matrix#*;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Matrix multiplication.;To:RDoc::Markup::Verbatim; [I"/Matrix[[2,4], [6,8]] * Matrix.identity(2) ;TI" => 2 4 ;TI" 6 8;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"(m);T@FI" Matrix;TcRDoc::NormalClass00t-i.ri000064400000000354152414432470005601 0ustar00U:RDoc::AnyMethod[iI"t:EFI" Matrix#t;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI" Matrix;TcRDoc::NormalClass0[@FI"transpose;Fsquare%3f-i.ri000064400000000464152414432470007136 0ustar00U:RDoc::AnyMethod[iI" square?:EFI"Matrix#square?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"/Returns +true+ is this is a square matrix.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00identity-c.ri000064400000000712152414432470007157 0ustar00U:RDoc::AnyMethod[iI" identity:EFI"Matrix::identity;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"+Creates an +n+ by +n+ identity matrix.;To:RDoc::Markup::Verbatim; [I"Matrix.identity(2) ;TI" => 1 0 ;TI" 0 1;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[[I" unit;Fo;; [; @;0[I"I;Fo;; [; @;0I"(n);T@FI" Matrix;TcRDoc::NormalClass00LUPDecomposition/u-i.ri000064400000000523152414432470010775 0ustar00U:RDoc::AnyMethod[iI"u:EFI"Matrix::LUPDecomposition#u;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I",Returns the upper triangular factor +U+;T: @fileI"$lib/matrix/lup_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"LUPDecomposition;TcRDoc::NormalClass00LUPDecomposition/to_a-i.ri000064400000000472152414432470011456 0ustar00U:RDoc::AnyMethod[iI" to_a:ETI""Matrix::LUPDecomposition#to_a;TF: publico:RDoc::Markup::Document: @parts[: @fileI"$lib/matrix/lup_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI"LUPDecomposition;TcRDoc::NormalClass0[I"Matrix::LUPDecomposition;TFI" to_ary;FLUPDecomposition/to_ary-i.ri000064400000000563152414432470012032 0ustar00U:RDoc::AnyMethod[iI" to_ary:EFI"$Matrix::LUPDecomposition#to_ary;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"&Returns +L+, +U+, +P+ in an array;T: @fileI"$lib/matrix/lup_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[[I" to_a;To;; [; @; 0I"();T@FI"LUPDecomposition;TcRDoc::NormalClass00LUPDecomposition/l-i.ri000064400000000406152414432470010764 0ustar00U:RDoc::AnyMethod[iI"l:EFI"Matrix::LUPDecomposition#l;TF: publico:RDoc::Markup::Document: @parts[: @fileI"$lib/matrix/lup_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI"LUPDecomposition;TcRDoc::NormalClass00LUPDecomposition/pivots-i.ri000064400000000516152414432470012057 0ustar00U:RDoc::Attr[iI" pivots:ETI"$Matrix::LUPDecomposition#pivots;TI"R;T: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"!Returns the pivoting indices;T: @fileI"$lib/matrix/lup_decomposition.rb;T:0@omit_headings_from_table_of_contents_below0F@I"Matrix::LUPDecomposition;TcRDoc::NormalClass0LUPDecomposition/new-c.ri000064400000000414152414432470011313 0ustar00U:RDoc::AnyMethod[iI"new:ETI""Matrix::LUPDecomposition::new;TT: publico:RDoc::Markup::Document: @parts[: @fileI"$lib/matrix/lup_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"(a);T@ FI"LUPDecomposition;TcRDoc::NormalClass00LUPDecomposition/solve-i.ri000064400000000665152414432470011670 0ustar00U:RDoc::AnyMethod[iI" solve:EFI"#Matrix::LUPDecomposition#solve;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"+Returns +m+ so that A*m = b, ;TI"2or equivalently so that L*U*m = P*b ;TI"$+b+ can be a Matrix or a Vector;T: @fileI"$lib/matrix/lup_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"(b);T@FI"LUPDecomposition;TcRDoc::NormalClass00LUPDecomposition/determinant-i.ri000064400000000505152414432470013043 0ustar00U:RDoc::AnyMethod[iI"determinant:ETI")Matrix::LUPDecomposition#determinant;TF: publico:RDoc::Markup::Document: @parts[: @fileI"$lib/matrix/lup_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI"LUPDecomposition;TcRDoc::NormalClass0[I"Matrix::LUPDecomposition;TFI"det;FLUPDecomposition/p-i.ri000064400000000516152414432470010772 0ustar00U:RDoc::AnyMethod[iI"p:EFI"Matrix::LUPDecomposition#p;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"'Returns the permutation matrix +P+;T: @fileI"$lib/matrix/lup_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"LUPDecomposition;TcRDoc::NormalClass00LUPDecomposition/cdesc-LUPDecomposition.ri000064400000002364152414432470014564 0ustar00U:RDoc::NormalClass[iI"LUPDecomposition:ETI"Matrix::LUPDecomposition;TI" Object;To:RDoc::Markup::Document: @parts[o;;[o:RDoc::Markup::Paragraph;[ I"KFor an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n ;TI"Junit lower triangular matrix L, an n-by-n upper triangular matrix U, ;TI":and a m-by-m permutation matrix P so that L*U = P*A. ;TI"0If m < n, then L is m-by-m and U is m-by-n.;To:RDoc::Markup::BlankLineo; ;[ I"NThe LUP decomposition with pivoting always exists, even if the matrix is ;TI"Ksingular, so the constructor will never fail. The primary use of the ;TI"KLU decomposition is in the solution of square systems of simultaneous ;TI"Alinear equations. This will fail if singular? returns true.;T: @fileI"$lib/matrix/lup_decomposition.rb;T:0@omit_headings_from_table_of_contents_below0; 0; 0[[ I" pivots;TI"R;T: publicFI"$lib/matrix/lup_decomposition.rb;T[[[[I" class;T[[; [[I"new;T@ [:protected[[: private[[I" instance;T[[; [[I"det;F@ [I"determinant;T@ [I"l;F@ [I"p;F@ [I"singular?;F@ [I" solve;F@ [I" to_a;T@ [I" to_ary;F@ [I"u;F@ [;[[;[[[U:RDoc::Context::Section[i0o;;[; 0; 0[@I" Matrix;TcRDoc::NormalClassLUPDecomposition/singular%3f-i.ri000064400000000556152414432470012661 0ustar00U:RDoc::AnyMethod[iI"singular?:EFI"'Matrix::LUPDecomposition#singular?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"7Returns +true+ if +U+, and hence +A+, is singular.;T: @fileI"$lib/matrix/lup_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"LUPDecomposition;TcRDoc::NormalClass00LUPDecomposition/det-i.ri000064400000000650152414432470011306 0ustar00U:RDoc::AnyMethod[iI"det:EFI"!Matrix::LUPDecomposition#det;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I" 1 4 ;TI" 9 16;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below00I"e;F[[I"map;Fo;; [; @;0I"();T@FI" Matrix;TcRDoc::NormalClass00determinant-i.ri000064400000001211152414432470007641 0ustar00U:RDoc::AnyMethod[iI"determinant:EFI"Matrix#determinant;TF: publico:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"+Returns the determinant of the matrix.;To:RDoc::Markup::BlankLineo; ; [I"@Beware that using Float values can yield erroneous results ;TI")because of their lack of precision. ;TI"DConsider using exact types like Rational or BigDecimal instead.;T@o:RDoc::Markup::Verbatim; [I"&Matrix[[7,6], [3,9]].determinant ;TI" => 45;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[[I"det;To;; [;@;0I"();T@FI" Matrix;TcRDoc::NormalClass00I-c.ri000064400000000355152414432470005521 0ustar00U:RDoc::AnyMethod[iI"I:EFI"Matrix::I;TT: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"(n);T@ FI" Matrix;TcRDoc::NormalClass0[@TI" identity;Fcolumn-i.ri000064400000000671152414432470006635 0ustar00U:RDoc::AnyMethod[iI" column:EFI"Matrix#column;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"OReturns column vector number +j+ of the matrix as a Vector (starting at 0 ;TI"Mlike an array). When a block is given, the elements of that vector are ;TI"iterated.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below00I"e;F[I"(j);T@FI" Matrix;TcRDoc::NormalClass00zero-c.ri000064400000000633152414432470006307 0ustar00U:RDoc::AnyMethod[iI" zero:EFI"Matrix::zero;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Creates a zero matrix.;To:RDoc::Markup::Verbatim; [I"Matrix.zero(2) ;TI" => 0 0 ;TI" 0 0;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"*(row_count, column_count = row_count);T@FI" Matrix;TcRDoc::NormalClass00permutation%3f-i.ri000064400000000562152414432470010204 0ustar00U:RDoc::AnyMethod[iI"permutation?:EFI"Matrix#permutation?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"4Returns +true+ is this is a permutation matrix ;TI"-Raises an error if matrix is not square.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00conjugate-i.ri000064400000001123152414432470007310 0ustar00U:RDoc::AnyMethod[iI"conjugate:EFI"Matrix#conjugate;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I")Returns the conjugate of the matrix.;To:RDoc::Markup::Verbatim; [ I"8Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]] ;TI" => 1+2i i 0 ;TI" 1 2 3 ;TI"BMatrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].conjugate ;TI" => 1-2i -i 0 ;TI" 1 2 3;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[[I" conj;Fo;; [; @;0I"();T@FI" Matrix;TcRDoc::NormalClass00%2a%2a-i.ri000064400000001053152414432470006172 0ustar00U:RDoc::AnyMethod[iI"**:ETI"Matrix#**;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Matrix exponentiation. ;TI"=Equivalent to multiplying the matrix by itself N times. ;TI"GNon integer exponents will be handled by diagonalizing the matrix.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [I"Matrix[[7,6], [3,9]] ** 2 ;TI" => 67 96 ;TI" 48 99;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I" (other);T@FI" Matrix;TcRDoc::NormalClass00imaginary-i.ri000064400000001124152414432470007312 0ustar00U:RDoc::AnyMethod[iI"imaginary:EFI"Matrix#imaginary;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I".Returns the imaginary part of the matrix.;To:RDoc::Markup::Verbatim; [ I"8Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]] ;TI" => 1+2i i 0 ;TI" 1 2 3 ;TI"BMatrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].imaginary ;TI" => 2i i 0 ;TI" 0 0 0;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[[I" imag;Fo;; [; @;0I"();T@FI" Matrix;TcRDoc::NormalClass00%2f-i.ri000064400000000661152414432470005713 0ustar00U:RDoc::AnyMethod[iI"/:EFI" Matrix#/;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"5Matrix division (multiplication by the inverse).;To:RDoc::Markup::Verbatim; [I"1Matrix[[7,6], [3,9]] / Matrix[[2,9], [3,1]] ;TI" => -7 1 ;TI" -3 -6;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I" (other);T@FI" Matrix;TcRDoc::NormalClass00%5b%5d-i.ri000064400000000613152414432470006205 0ustar00U:RDoc::AnyMethod[iI"[]:EFI"Matrix#[];TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"LReturns element (+i+,+j+) of the matrix. That is: row +i+, column +j+.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[[I" element;Fo;; [; @; 0[I"component;Fo;; [; @; 0I" (i, j);T@FI" Matrix;TcRDoc::NormalClass00to_s-i.ri000064400000000431152414432470006276 0ustar00U:RDoc::AnyMethod[iI" to_s:EFI"Matrix#to_s;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Overrides Object#to_s;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00diagonal-c.ri000064400000000741152414432470007106 0ustar00U:RDoc::AnyMethod[iI" diagonal:EFI"Matrix::diagonal;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"KCreates a matrix where the diagonal elements are composed of +values+.;To:RDoc::Markup::Verbatim; [ I"Matrix.diagonal(9, 5, -3) ;TI" => 9 0 0 ;TI" 0 5 0 ;TI" 0 0 -3;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"(*values);T@FI" Matrix;TcRDoc::NormalClass00index-i.ri000064400000001423152414432470006443 0ustar00U:RDoc::AnyMethod[iI" index:EFI"Matrix#index;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"JThe index method is specialized to return the index as [row, column] ;TI"LIt also accepts an optional +selector+ argument, see #each for details.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [I"7Matrix[ [1,2], [3,4] ].index(&:even?) # => [0, 1] ;TI"?Matrix[ [1,1], [1,1] ].index(1, :strict_lower) # => [1, 0];T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below0I"ˆindex(value, selector = :all) -> [row, column] index(selector = :all){ block } -> [row, column] index(selector = :all) -> an_enumerator ;TI"e;T[[I"find_index;To;; [;@;0I" (*args);T@FI" Matrix;TcRDoc::NormalClass00lup-i.ri000064400000001230152414432470006130 0ustar00U:RDoc::AnyMethod[iI"lup:EFI"Matrix#lup;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"IReturns the LUP decomposition of the matrix; see +LUPDecomposition+.;To:RDoc::Markup::Verbatim; [ I" a = Matrix[[1, 2], [3, 4]] ;TI"l, u, p = a.lup ;TI"#l.lower_triangular? # => true ;TI"#u.upper_triangular? # => true ;TI"#p.permutation? # => true ;TI"#l * u == p * a # => true ;TI"2a.lup.solve([2, 5]) # => Vector[(1/1), (1/2)];T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[[I"lup_decomposition;Fo;; [; @;0I"();T@FI" Matrix;TcRDoc::NormalClass00determinant_bareiss-i.ri000064400000001526152414432470011362 0ustar00U:RDoc::AnyMethod[iI"determinant_bareiss:EFI"Matrix#determinant_bareiss;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"$Private. Use Matrix#determinant;To:RDoc::Markup::BlankLineo; ; [ I"2Returns the determinant of the matrix, using ;TI"ABareiss' multistep integer-preserving gaussian elimination. ;TI"WIt has the same computational cost order O(n^3) as standard Gaussian elimination. ;TI"EIntermediate results are fraction free and of lower complexity. ;TI"VA matrix of Integers will have thus intermediate results that are also Integers, ;TI"Nwith smaller bignums (if any), while a matrix of Float will usually have ;TI"0intermediate results with better precision.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00eigen-i.ri000064400000000366152414432470006430 0ustar00U:RDoc::AnyMethod[iI" eigen:EFI"Matrix#eigen;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI" Matrix;TcRDoc::NormalClass0[@FI"eigensystem;Ffind_index-i.ri000064400000000377152414432470007452 0ustar00U:RDoc::AnyMethod[iI"find_index:ETI"Matrix#find_index;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I" (*args);T@ FI" Matrix;TcRDoc::NormalClass0[@FI" index;Finverse-i.ri000064400000000673152414432470007015 0ustar00U:RDoc::AnyMethod[iI" inverse:EFI"Matrix#inverse;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"'Returns the inverse of the matrix.;To:RDoc::Markup::Verbatim; [I"'Matrix[[-1, -1], [0, -1]].inverse ;TI" => -1 1 ;TI" 0 -1;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[[I"inv;Fo;; [; @;0I"();T@FI" Matrix;TcRDoc::NormalClass00determinant_e-i.ri000064400000000525152414432470010154 0ustar00U:RDoc::AnyMethod[iI"determinant_e:EFI"Matrix#determinant_e;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"'deprecated; use Matrix#determinant;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[[I" det_e;Fo;; [; @; 0I"();T@FI" Matrix;TcRDoc::NormalClass00row_vectors-i.ri000064400000000521152414432470007706 0ustar00U:RDoc::AnyMethod[iI"row_vectors:EFI"Matrix#row_vectors;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"DReturns an array of the row vectors of the matrix. See Vector.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00symmetric%3f-i.ri000064400000000555152414432470007653 0ustar00U:RDoc::AnyMethod[iI"symmetric?:EFI"Matrix#symmetric?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"3Returns +true+ is this is a symmetric matrix. ;TI"-Raises an error if matrix is not square.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00singular%3f-i.ri000064400000000472152414432470007461 0ustar00U:RDoc::AnyMethod[iI"singular?:EFI"Matrix#singular?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"1Returns +true+ is this is a singular matrix.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00map-i.ri000064400000000356152414432470006115 0ustar00U:RDoc::AnyMethod[iI"map:EFI"Matrix#map;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI" Matrix;TcRDoc::NormalClass0[@FI" collect;Fcolumn_size-i.ri000064400000000444152414432470007665 0ustar00U:RDoc::Attr[iI"column_size:ETI"Matrix#column_size;TI"R;T: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"#Returns the number of columns.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below0F@I" Matrix;TcRDoc::NormalClass0%5b%5d%3d-i.ri000064400000000454152414432470006504 0ustar00U:RDoc::AnyMethod[iI"[]=:EFI"Matrix#[]=;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[[I"set_element;Fo;; [; @ ; 0[I"set_component;Fo;; [; @ ; 0I"(i, j, v);T@ FI" Matrix;TcRDoc::NormalClass00EigenvalueDecomposition/tridiagonalize-i.ri000064400000000620152414432470015160 0ustar00U:RDoc::AnyMethod[iI"tridiagonalize:EFI"3Matrix::EigenvalueDecomposition#tridiagonalize;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"9Symmetric Householder reduction to tridiagonal form.;T: @fileI"+lib/matrix/eigenvalue_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"EigenvalueDecomposition;TcRDoc::NormalClass00EigenvalueDecomposition/to_a-i.ri000064400000000526152414432470013102 0ustar00U:RDoc::AnyMethod[iI" to_a:ETI")Matrix::EigenvalueDecomposition#to_a;TF: publico:RDoc::Markup::Document: @parts[: @fileI"+lib/matrix/eigenvalue_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI"EigenvalueDecomposition;TcRDoc::NormalClass0[I"$Matrix::EigenvalueDecomposition;TFI" to_ary;FEigenvalueDecomposition/eigenvalues-i.ri000064400000000570152414432470014466 0ustar00U:RDoc::AnyMethod[iI"eigenvalues:EFI"0Matrix::EigenvalueDecomposition#eigenvalues;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"(Returns the eigenvalues in an array;T: @fileI"+lib/matrix/eigenvalue_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"EigenvalueDecomposition;TcRDoc::NormalClass00EigenvalueDecomposition/to_ary-i.ri000064400000000656152414432470013461 0ustar00U:RDoc::AnyMethod[iI" to_ary:EFI"+Matrix::EigenvalueDecomposition#to_ary;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"LReturns [eigenvector_matrix, eigenvalue_matrix, eigenvector_matrix_inv];T: @fileI"+lib/matrix/eigenvalue_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[[I" to_a;To;; [; @; 0I"();T@FI"EigenvalueDecomposition;TcRDoc::NormalClass00EigenvalueDecomposition/new-c.ri000064400000000606152414432470012742 0ustar00U:RDoc::AnyMethod[iI"new:ETI")Matrix::EigenvalueDecomposition::new;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"DConstructs the eigenvalue decomposition for a square matrix +A+;T: @fileI"+lib/matrix/eigenvalue_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"(a);T@FI"EigenvalueDecomposition;TcRDoc::NormalClass00EigenvalueDecomposition/v-i.ri000064400000000534152414432470012424 0ustar00U:RDoc::AnyMethod[iI"v:EFI"&Matrix::EigenvalueDecomposition#v;TF: publico:RDoc::Markup::Document: @parts[: @fileI"+lib/matrix/eigenvalue_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI"EigenvalueDecomposition;TcRDoc::NormalClass0[I"$Matrix::EigenvalueDecomposition;TFI"eigenvector_matrix;FEigenvalueDecomposition/eigenvector_matrix_inv-i.ri000064400000000671152414432470016733 0ustar00U:RDoc::AnyMethod[iI"eigenvector_matrix_inv:EFI";Matrix::EigenvalueDecomposition#eigenvector_matrix_inv;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"6Returns the inverse of the eigenvector matrix +V+;T: @fileI"+lib/matrix/eigenvalue_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[[I" v_inv;Fo;; [; @; 0I"();T@FI"EigenvalueDecomposition;TcRDoc::NormalClass00EigenvalueDecomposition/diagonalize-i.ri000064400000000571152414432470014446 0ustar00U:RDoc::AnyMethod[iI"diagonalize:EFI"0Matrix::EigenvalueDecomposition#diagonalize;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"(Symmetric tridiagonal QL algorithm.;T: @fileI"+lib/matrix/eigenvalue_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"EigenvalueDecomposition;TcRDoc::NormalClass00EigenvalueDecomposition/build_eigenvectors-i.ri000064400000000476152414432470016040 0ustar00U:RDoc::AnyMethod[iI"build_eigenvectors:EFI"7Matrix::EigenvalueDecomposition#build_eigenvectors;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"+lib/matrix/eigenvalue_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI"EigenvalueDecomposition;TcRDoc::NormalClass00EigenvalueDecomposition/v_inv-i.ri000064400000000550152414432470013276 0ustar00U:RDoc::AnyMethod[iI" v_inv:EFI"*Matrix::EigenvalueDecomposition#v_inv;TF: publico:RDoc::Markup::Document: @parts[: @fileI"+lib/matrix/eigenvalue_decomposition.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI"EigenvalueDecomposition;TcRDoc::NormalClass0[I"$Matrix::EigenvalueDecomposition;TFI"eigenvector_matrix_inv;FEigenvalueDecomposition/cdesc-EigenvalueDecomposition.ri000064400000002471152414432470017633 0ustar00U:RDoc::NormalClass[iI"EigenvalueDecomposition:ETI"$Matrix::EigenvalueDecomposition;TI" Object;To:RDoc::Markup::Document: @parts[o;;[ o:RDoc::Markup::Paragraph;[I"3Eigenvalues and eigenvectors of a real matrix.;To:RDoc::Markup::BlankLineo; ;[I"=Computes the eigenvalues and eigenvectors of a matrix A.;T@o; ;[I" Matrix[[0, 1, 2, 3], [-1, 0, 1, 2]] ;TI""m = Matrix.build(3) { rand } ;TI"+ => a 3x3 matrix with random elements;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below00I" i, j;T[I"*(row_count, column_count = row_count);T@FI" Matrix;TcRDoc::NormalClass00cdesc-Matrix.ri000064400000013753152414432470007442 0ustar00U:RDoc::NormalClass[iI" Matrix:ET@I" Object;To:RDoc::Markup::Document: @parts[o;;[o:RDoc::Markup::Paragraph;[I"[The +Matrix+ class represents a mathematical matrix. It provides methods for creating ;TI"Cmatrices, operating on them arithmetically and algebraically, ;TI"Wand determining their mathematical properties (trace, rank, inverse, determinant).;To:RDoc::Markup::BlankLineS:RDoc::Markup::Heading: leveli: textI"Method Catalogue;T@o; ;[I"To create a matrix:;To:RDoc::Markup::List: @type: BULLET: @items[o:RDoc::Markup::ListItem: @label0;[o; ;[I"Matrix[*rows];To;;0;[o; ;[I"Matrix.[](*rows);To;;0;[o; ;[I"#Matrix.rows(rows, copy = true);To;;0;[o; ;[I"Matrix.columns(columns);To;;0;[o; ;[I"2Matrix.build(row_count, column_count, &block);To;;0;[o; ;[I"Matrix.diagonal(*values);To;;0;[o; ;[I"Matrix.scalar(n, value);To;;0;[o; ;[I"Matrix.identity(n);To;;0;[o; ;[I"Matrix.unit(n);To;;0;[o; ;[I"Matrix.I(n);To;;0;[o; ;[I"Matrix.zero(n);To;;0;[o; ;[I"Matrix.row_vector(row);To;;0;[o; ;[I"!Matrix.column_vector(column);T@o; ;[I"CTo access Matrix elements/columns/rows/submatrices/properties:;To;;;;[o;;0;[o; ;[I"#[](i, j);To;;0;[o; ;[I"#row_count (row_size);To;;0;[o; ;[I" #column_count (column_size);To;;0;[o; ;[I" #row(i);To;;0;[o; ;[I"#column(j);To;;0;[o; ;[I" #collect;To;;0;[o; ;[I" #map;To;;0;[o; ;[I" #each;To;;0;[o; ;[I"#each_with_index;To;;0;[o; ;[I"#find_index;To;;0;[o; ;[I"#minor(*param);T@o; ;[I"Properties of a matrix:;To;;;;[o;;0;[o; ;[I"#diagonal?;To;;0;[o; ;[I" #empty?;To;;0;[o; ;[I"#hermitian?;To;;0;[o; ;[I"#lower_triangular?;To;;0;[o; ;[I" #normal?;To;;0;[o; ;[I"#orthogonal?;To;;0;[o; ;[I"#permutation?;To;;0;[o; ;[I" #real?;To;;0;[o; ;[I"#regular?;To;;0;[o; ;[I"#singular?;To;;0;[o; ;[I" #square?;To;;0;[o; ;[I"#symmetric?;To;;0;[o; ;[I"#unitary?;To;;0;[o; ;[I"#upper_triangular?;To;;0;[o; ;[I" #zero?;T@o; ;[I"Matrix arithmetic:;To;;;;[ o;;0;[o; ;[I" #*(m);To;;0;[o; ;[I" #+(m);To;;0;[o; ;[I" #-(m);To;;0;[o; ;[I" #/(m);To;;0;[o; ;[I" #inverse;To;;0;[o; ;[I" #inv;To;;0;[o; ;[I"#**;T@o; ;[I"Matrix functions:;To;;;;[ o;;0;[o; ;[I"#determinant;To;;0;[o; ;[I" #det;To;;0;[o; ;[I" #rank;To;;0;[o; ;[I" #round;To;;0;[o; ;[I" #trace;To;;0;[o; ;[I"#tr;To;;0;[o; ;[I"#transpose;To;;0;[o; ;[I"#t;T@o; ;[I"Matrix decompositions:;To;;;;[ o;;0;[o; ;[I" #eigen;To;;0;[o; ;[I"#eigensystem;To;;0;[o; ;[I" #lup;To;;0;[o; ;[I"#lup_decomposition;T@o; ;[I"Complex arithmetic:;To;;;;[ o;;0;[o; ;[I" conj;To;;0;[o; ;[I"conjugate;To;;0;[o; ;[I" imag;To;;0;[o; ;[I"imaginary;To;;0;[o; ;[I" real;To;;0;[o; ;[I" rect;To;;0;[o; ;[I"rectangular;T@o; ;[I"$Conversion to other data types:;To;;;;[ o;;0;[o; ;[I"#coerce(other);To;;0;[o; ;[I"#row_vectors;To;;0;[o; ;[I"#column_vectors;To;;0;[o; ;[I" #to_a;T@o; ;[I"String representations:;To;;;;[o;;0;[o; ;[I" #to_s;To;;0;[o; ;[I" #inspect;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below0o;;[;I"+lib/matrix/eigenvalue_decomposition.rb;T;0o;;[;I"$lib/matrix/lup_decomposition.rb;T;0;0;0[[ I"column_count;TI"R;T: publicFI"lib/matrix.rb;T[ I"column_size;T@ª;F@«[ I" rows;TI"R;T:protectedF@«[U:RDoc::Constant[iI"SELECTORS;FI"Matrix::SELECTORS;T00o;;[;@ ;0@ @cRDoc::NormalClass0[[I"Enumerable;To;;[;@ ;0@«[[I" class;T[[;[[I"I;F@«[I"[];F@«[I" build;F@«[I"column_vector;F@«[I" columns;F@«[I" diagonal;F@«[I" empty;F@«[I" identity;F@«[I"new;T@«[I"row_vector;F@«[I" rows;F@«[I" scalar;F@«[I" unit;F@«[I" zero;F@«[;[[: private[[I" instance;T[[;[L[I"*;T@«[I"**;T@«[I"+;T@«[I"-;T@«[I"/;F@«[I"==;T@«[I"[];F@«[I" clone;F@«[I" coerce;F@«[I" collect;F@«[I" column;F@«[I"column_vectors;F@«[I"component;F@«[I" conj;F@«[I"conjugate;F@«[I"det;T@«[I" det_e;F@«[I"determinant;F@«[I"determinant_e;F@«[I"diagonal?;F@«[I" each;F@«[I"each_with_index;F@«[I" eigen;F@«[I"eigensystem;F@«[I" element;F@«[I"elements_to_f;F@«[I"elements_to_i;F@«[I"elements_to_r;F@«[I" empty?;F@«[I" eql?;F@«[I"find_index;T@«[I" hash;F@«[I"hermitian?;F@«[I" imag;F@«[I"imaginary;F@«[I" index;F@«[I" inspect;F@«[I"inv;F@«[I" inverse;F@«[I"lower_triangular?;F@«[I"lup;F@«[I"lup_decomposition;F@«[I"map;F@«[I" minor;F@«[I" normal?;F@«[I"orthogonal?;F@«[I"permutation?;F@«[I" rank;F@«[I" rank_e;F@«[I" real;F@«[I" real?;F@«[I" rect;F@«[I"rectangular;F@«[I" regular?;F@«[I" round;F@«[I"row;F@«[I"row_count;F@«[I" row_size;T@«[I"row_vectors;F@«[I"singular?;F@«[I" square?;F@«[I"symmetric?;F@«[I"t;F@«[I" to_a;F@«[I" to_s;F@«[I"tr;F@«[I" trace;F@«[I"transpose;F@«[I" unitary?;F@«[I"upper_triangular?;F@«[I" zero?;F@«[;[[;[ [I"[]=;F@«[I"determinant_bareiss;F@«[I"set_component;F@«[I"set_element;F@«[[I"ConversionHelper;To;;[;@ ;0@«[U:RDoc::Context::Section[i0o;;[;0;0[@ @£@¦@¦cRDoc::TopLevelcolumn_vector-c.ri000064400000000762152414432470010212 0ustar00U:RDoc::AnyMethod[iI"column_vector:EFI"Matrix::column_vector;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"QCreates a single-column matrix where the values of that column are as given ;TI"in +column+.;To:RDoc::Markup::Verbatim; [ I"#Matrix.column_vector([4,5,6]) ;TI" => 4 ;TI" 5 ;TI" 6;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I" (column);T@FI" Matrix;TcRDoc::NormalClass00transpose-i.ri000064400000001026152414432470007351 0ustar00U:RDoc::AnyMethod[iI"transpose:EFI"Matrix#transpose;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I")Returns the transpose of the matrix.;To:RDoc::Markup::Verbatim; [ I"!Matrix[[1,2], [3,4], [5,6]] ;TI" => 1 2 ;TI" 3 4 ;TI" 5 6 ;TI"+Matrix[[1,2], [3,4], [5,6]].transpose ;TI" => 1 3 5 ;TI" 2 4 6;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[[I"t;Fo;; [; @;0I"();T@FI" Matrix;TcRDoc::NormalClass00real-i.ri000064400000001044152414432470006256 0ustar00U:RDoc::AnyMethod[iI" real:EFI"Matrix#real;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I")Returns the real part of the matrix.;To:RDoc::Markup::Verbatim; [ I"8Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]] ;TI" => 1+2i i 0 ;TI" 1 2 3 ;TI"=Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].real ;TI" => 1 0 0 ;TI" 1 2 3;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00lower_triangular%3f-i.ri000064400000000522152414432470011211 0ustar00U:RDoc::AnyMethod[iI"lower_triangular?:EFI"Matrix#lower_triangular?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"9Returns +true+ is this is a lower triangular matrix.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00empty-c.ri000064400000001273152414432470006467 0ustar00U:RDoc::AnyMethod[iI" empty:EFI"Matrix::empty;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"=Creates a empty matrix of +row_count+ x +column_count+. ;TI"=At least one of +row_count+ or +column_count+ must be 0.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [ I"m = Matrix.empty(2, 0) ;TI"m == Matrix[ [], [] ] ;TI" => true ;TI"n = Matrix.empty(0, 3) ;TI")n == Matrix.columns([ [], [], [] ]) ;TI" => true ;TI" m * n ;TI"& => Matrix[[0, 0, 0], [0, 0, 0]];T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"&(row_count = 0, column_count = 0);T@FI" Matrix;TcRDoc::NormalClass00%2b-i.ri000064400000000614152414432470005705 0ustar00U:RDoc::AnyMethod[iI"+:ETI" Matrix#+;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Matrix addition.;To:RDoc::Markup::Verbatim; [I"0Matrix.scalar(2,5) + Matrix[[1,0], [-4,7]] ;TI" => 6 0 ;TI" -4 12;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"(m);T@FI" Matrix;TcRDoc::NormalClass00real%3f-i.ri000064400000000473152414432470006561 0ustar00U:RDoc::AnyMethod[iI" real?:EFI"Matrix#real?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I":Returns +true+ if all entries of the matrix are real.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00clone-i.ri000064400000000673152414432470006442 0ustar00U:RDoc::AnyMethod[iI" clone:EFI"Matrix#clone;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"RReturns a clone of the matrix, so that the contents of each do not reference ;TI"identical objects. ;TI"LThere should be no good reason to do this since Matrices are immutable.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00det-i.ri000064400000000362152414432470006111 0ustar00U:RDoc::AnyMethod[iI"det:ETI"Matrix#det;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI" Matrix;TcRDoc::NormalClass0[@FI"determinant;Flup_decomposition-i.ri000064400000000406152414432470011070 0ustar00U:RDoc::AnyMethod[iI"lup_decomposition:EFI"Matrix#lup_decomposition;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI" Matrix;TcRDoc::NormalClass0[@FI"lup;Feach-i.ri000064400000002427152414432470006241 0ustar00U:RDoc::AnyMethod[iI" each:EFI"Matrix#each;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"NYields all elements of the matrix, starting with those of the first row, ;TI"1or returns an Enumerator is no block given. ;TI"7Elements can be restricted by passing an argument:;To:RDoc::Markup::List: @type: BULLET: @items[ o:RDoc::Markup::ListItem: @label0; [o; ; [I"(:all (default): yields all elements;To;;0; [o; ; [I"4:diagonal: yields only elements on the diagonal;To;;0; [o; ; [I">:off_diagonal: yields all elements except on the diagonal;To;;0; [o; ; [I"::lower: yields only elements on or below the diagonal;To;;0; [o; ; [I";:strict_lower: yields only elements below the diagonal;To;;0; [o; ; [I";:strict_upper: yields only elements above the diagonal;To;;0; [ o; ; [I"::upper: yields only elements on or above the diagonal;To:RDoc::Markup::BlankLineo; ; [I"/Matrix[ [1,2], [3,4] ].each { |e| puts e };To:RDoc::Markup::Verbatim; [I"$# => prints the numbers 1 to 4 ;T: @format0o; ; [I"=Matrix[ [1,2], [3,4] ].each(:strict_lower).to_a # => [3];T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below00I"e;F[I"(which = :all);T@?FI" Matrix;TcRDoc::NormalClass00upper_triangular%3f-i.ri000064400000000523152414432470011215 0ustar00U:RDoc::AnyMethod[iI"upper_triangular?:EFI"Matrix#upper_triangular?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I":Returns +true+ is this is an upper triangular matrix.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00scalar-c.ri000064400000000707152414432470006577 0ustar00U:RDoc::AnyMethod[iI" scalar:EFI"Matrix::scalar;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"JCreates an +n+ by +n+ diagonal matrix where each diagonal element is ;TI" +value+.;To:RDoc::Markup::Verbatim; [I"Matrix.scalar(2, 5) ;TI" => 5 0 ;TI" 0 5;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"(n, value);T@FI" Matrix;TcRDoc::NormalClass00each_with_index-i.ri000064400000001257152414432470010463 0ustar00U:RDoc::AnyMethod[iI"each_with_index:EFI"Matrix#each_with_index;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"QSame as #each, but the row index and column index in addition to the element;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [ I"=Matrix[ [1,2], [3,4] ].each_with_index do |e, row, col| ;TI"% puts "#{e} at #{row}, #{col}" ;TI" end ;TI" # => Prints: ;TI" # 1 at 0, 0 ;TI" # 2 at 0, 1 ;TI" # 3 at 1, 0 ;TI" # 4 at 1, 1;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below00I"e, row, column;F[I"(which = :all);T@FI" Matrix;TcRDoc::NormalClass00%2d-i.ri000064400000000621152414432470005705 0ustar00U:RDoc::AnyMethod[iI"-:ETI" Matrix#-;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Matrix subtraction.;To:RDoc::Markup::Verbatim; [I"2Matrix[[1,5], [4,2]] - Matrix[[9,3], [-4,1]] ;TI" => -8 2 ;TI" 8 1;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"(m);T@FI" Matrix;TcRDoc::NormalClass00rectangular-i.ri000064400000000373152414432470007646 0ustar00U:RDoc::AnyMethod[iI"rectangular:EFI"Matrix#rectangular;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI" Matrix;TcRDoc::NormalClass0[@FI" rect;Fminor-i.ri000064400000001604152414432470006461 0ustar00U:RDoc::AnyMethod[iI" minor:EFI"Matrix#minor;TF: publico:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"AReturns a section of the matrix. The parameters are either:;To:RDoc::Markup::List: @type: BULLET: @items[o:RDoc::Markup::ListItem: @label0; [o; ; [I"+start_row, nrows, start_col, ncols; OR;To;;0; [o; ; [I"row_range, col_range;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [I"1Matrix.diagonal(9, 5, -3).minor(0..1, 0..2) ;TI" => 9 0 0 ;TI" 0 5 0 ;T: @format0o; ; [I"HLike Array#[], negative indices count backward from the end of the ;TI"Irow or column (-1 is the last element). Returns nil if the starting ;TI"Jrow or column is greater than row_count or column_count respectively.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I" (*param);T@%FI" Matrix;TcRDoc::NormalClass00unitary%3f-i.ri000064400000000546152414432470007332 0ustar00U:RDoc::AnyMethod[iI" unitary?:EFI"Matrix#unitary?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"0Returns +true+ is this is a unitary matrix ;TI"-Raises an error if matrix is not square.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00%3d%3d-i.ri000064400000000513152414432470006202 0ustar00U:RDoc::AnyMethod[iI"==:ETI"Matrix#==;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"KReturns +true+ if and only if the two matrices contain equal elements.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I" (other);T@FI" Matrix;TcRDoc::NormalClass00zero%3f-i.ri000064400000000500152414432470006604 0ustar00U:RDoc::AnyMethod[iI" zero?:EFI"Matrix#zero?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"?Returns +true+ is this is a matrix with only zero elements;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00row_count-i.ri000064400000000511152414432470007350 0ustar00U:RDoc::AnyMethod[iI"row_count:EFI"Matrix#row_count;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I" Returns the number of rows.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[[I" row_size;To;; [; @; 0I"();T@FI" Matrix;TcRDoc::NormalClass00columns-c.ri000064400000000714152414432470007010 0ustar00U:RDoc::AnyMethod[iI" columns:EFI"Matrix::columns;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"DCreates a matrix using +columns+ as an array of column vectors.;To:RDoc::Markup::Verbatim; [I"*Matrix.columns([[25, 93], [-1, 66]]) ;TI" => 25 -1 ;TI" 93 66;T: @format0: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"(columns);T@FI" Matrix;TcRDoc::NormalClass00hash-i.ri000064400000000447152414432470006264 0ustar00U:RDoc::AnyMethod[iI" hash:EFI"Matrix#hash;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"(Returns a hash-code for the matrix.;T: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Matrix;TcRDoc::NormalClass00inv-i.ri000064400000000356152414432470006134 0ustar00U:RDoc::AnyMethod[iI"inv:EFI"Matrix#inv;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/matrix.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI" Matrix;TcRDoc::NormalClass0[@FI" inverse;F