ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- PKK]4 unit-c.rinu[U: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;FPKK] component-i.rinu[U: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"[];FPKK]jjdiagonal%3f-i.rinu[U: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::NormalClass00PKK]Zelements_to_i-i.rinu[U: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::NormalClass00PKK] ߞdd round-i.rinu[U: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::NormalClass00PKK]ܦ trace-i.rinu[U: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::NormalClass00PKK] element-i.rinu[U: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"[];FPKK]^R## rank_e-i.rinu[U: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::NormalClass00PKK]4ʊrow_vector-c.rinu[U: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::NormalClass00PKK]\KKregular%3f-i.rinu[U: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::NormalClass00PKK]tXO"" inspect-i.rinu[U: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::NormalClass00PKK]ZToo rows-c.rinu[U: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::NormalClass00PKK]Kd&&column_count-i.rinu[U: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::NormalClass0PKK]-,DD to_a-i.rinu[U: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::NormalClass00PKK]q rect-i.rinu[U: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::NormalClass00PKK]#BvZZcolumn_vectors-i.rinu[U: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::NormalClass00PKK]9bf imag-i.rinu[U: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;FPKK]\LLeigensystem-i.rinu[U: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::NormalClass00PKK]^4 %5b%5d-c.rinu[U: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::NormalClass00PKK]Uy0nnhermitian%3f-i.rinu[U: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::NormalClass00PKK]5 eql%3f-i.rinu[U: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::NormalClass00PKK]-elements_to_f-i.rinu[U: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::NormalClass00PKK]ZX det_e-i.rinu[U: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;FPKK]BGjjnew-c.rinu[U: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::NormalClass00PKK]#ƭHH rank-i.rinu[U: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::NormalClass00PKK]6=ۡddnormal%3f-i.rinu[U: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::NormalClass00PKK]!tset_component-i.rinu[U: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"[]=;FPKK],9#ss empty%3f-i.rinu[U: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::NormalClass00PKK]v   rows-i.rinu[U: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::NormalClass0PKK]: row_size-i.rinu[U: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;FPKK]0r'' coerce-i.rinu[U: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::NormalClass00PKK]=nset_element-i.rinu[U: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"[]=;FPKK]R?mrow-i.rinu[U: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::NormalClass00PKK]Z0Ks%2a-i.rinu[U: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::NormalClass00PKK]Ct-i.rinu[U: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;FPKK]X744square%3f-i.rinu[U: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::NormalClass00PKK]Www identity-c.rinu[U: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::NormalClass00PKK]63USSLUPDecomposition/u-i.rinu[U: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::NormalClass00PKK]H::LUPDecomposition/to_a-i.rinu[U: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;FPKK].DssLUPDecomposition/to_ary-i.rinu[U: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::NormalClass00PKK]ӂLUPDecomposition/l-i.rinu[U: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::NormalClass00PKK]e NNLUPDecomposition/pivots-i.rinu[U: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::NormalClass0PKK][tq  LUPDecomposition/new-c.rinu[U: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::NormalClass00PKK]cLUPDecomposition/solve-i.rinu[U: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::NormalClass00PKK]%&EE!LUPDecomposition/determinant-i.rinu[U: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;FPKK]ٓVNNLUPDecomposition/p-i.rinu[U: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::NormalClass00PKK]R[*LUPDecomposition/cdesc-LUPDecomposition.rinu[U: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::NormalClassPKK]cnn!LUPDecomposition/singular%3f-i.rinu[U: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::NormalClass00PKK] JLUPDecomposition/det-i.rinu[U:RDoc::AnyMethod[iI"det:EFI"!Matrix::LUPDecomposition#det;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I" collect-i.rinu[U:RDoc::AnyMethod[iI" collect:EFI"Matrix#collect;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"RReturns a matrix that is the result of iteration of the given block over all ;TI"elements of the matrix.;To:RDoc::Markup::Verbatim; [I"1Matrix[ [1,2], [3,4] ].collect { |e| e**2 } ;TI" => 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::NormalClass00PKK]Qgdeterminant-i.rinu[U: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::NormalClass00PKK]:I-c.rinu[U: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;FPKK]\9 column-i.rinu[U: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::NormalClass00PKK]t} zero-c.rinu[U: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::NormalClass00PKK]#Brrpermutation%3f-i.rinu[U: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::NormalClass00PKK]n7BSSconjugate-i.rinu[U: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::NormalClass00PKK]++ %2a%2a-i.rinu[U: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::NormalClass00PKK]/TTimaginary-i.rinu[U: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::NormalClass00PKK](N%2f-i.rinu[U: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::NormalClass00PKK]jC7 %5b%5d-i.rinu[U: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::NormalClass00PKK] to_s-i.rinu[U: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::NormalClass00PKK]F\A diagonal-c.rinu[U: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::NormalClass00PKK] index-i.rinu[U: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::NormalClass00PKK]E lup-i.rinu[U: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::NormalClass00PKK]۸VVdeterminant_bareiss-i.rinu[U: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::NormalClass00PKK]UtK eigen-i.rinu[U: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;FPKK]1find_index-i.rinu[U: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;FPKK]8m inverse-i.rinu[U: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::NormalClass00PKK]whUUdeterminant_e-i.rinu[U: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::NormalClass00PKK]l0QQrow_vectors-i.rinu[U: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::NormalClass00PKK]ԕ!mmsymmetric%3f-i.rinu[U: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::NormalClass00PKK]#X::singular%3f-i.rinu[U: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::NormalClass00PKK]>map-i.rinu[U: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;FPKK]z $$column_size-i.rinu[U: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::NormalClass0PKK]{{,,%5b%5d%3d-i.rinu[U: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::NormalClass00PKK]X+EigenvalueDecomposition/tridiagonalize-i.rinu[U: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::NormalClass00PKK]zVV!EigenvalueDecomposition/to_a-i.rinu[U: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;FPKK]Qhxx(EigenvalueDecomposition/eigenvalues-i.rinu[U: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::NormalClass00PKK]"#EigenvalueDecomposition/to_ary-i.rinu[U: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::NormalClass00PKK]  EigenvalueDecomposition/new-c.rinu[U: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::NormalClass00PKK]0,\\EigenvalueDecomposition/v-i.rinu[U: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;FPKK]wY3EigenvalueDecomposition/eigenvector_matrix_inv-i.rinu[U: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::NormalClass00PKK]u>ayy(EigenvalueDecomposition/diagonalize-i.rinu[U: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::NormalClass00PKK]XD |>>/EigenvalueDecomposition/build_eigenvectors-i.rinu[U: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::NormalClass00PKK]iGqhh"EigenvalueDecomposition/v_inv-i.rinu[U: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;FPKK], 998EigenvalueDecomposition/cdesc-EigenvalueDecomposition.rinu[U: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::NormalClass00PKK]csNcdesc-Matrix.rinu[U: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::TopLevelPKK]|column_vector-c.rinu[U: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::NormalClass00PKK]{'Ttranspose-i.rinu[U: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::NormalClass00PKK]{ؓ$$ real-i.rinu[U: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::NormalClass00PKK]vRRlower_triangular%3f-i.rinu[U: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::NormalClass00PKK]i empty-c.rinu[U: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::NormalClass00PKK]>%2b-i.rinu[U: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::NormalClass00PKK]/\;; real%3f-i.rinu[U: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::NormalClass00PKK]p9 clone-i.rinu[U: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::NormalClass00PKK]Ldet-i.rinu[U: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;FPKK]wGlup_decomposition-i.rinu[U: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;FPKK]ׂ~ each-i.rinu[U: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::NormalClass00PKK]]SSupper_triangular%3f-i.rinu[U: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::NormalClass00PKK]CY scalar-c.rinu[U: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::NormalClass00PKK]74each_with_index-i.rinu[U: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::NormalClass00PKK]-ߑ%2d-i.rinu[U: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::NormalClass00PKK]S'rectangular-i.rinu[U: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;FPKK] minor-i.rinu[U: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::NormalClass00PKK]Cffunitary%3f-i.rinu[U: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::NormalClass00PKK]ZvKK %3d%3d-i.rinu[U: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::NormalClass00PKK]C[@@ zero%3f-i.rinu[U: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::NormalClass00PKK]/IIrow_count-i.rinu[U: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::NormalClass00PKK]z(O columns-c.rinu[U: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::NormalClass00PKK]'' hash-i.rinu[U: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::NormalClass00PKK])inv-i.rinu[U: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;FPKK]4 unit-c.rinu[PKK] ,component-i.rinu[PKK]jjcdiagonal%3f-i.rinu[PKK]Z elements_to_i-i.rinu[PKK] ߞdd ?round-i.rinu[PKK]ܦ trace-i.rinu[PKK] element-i.rinu[PKK]^R##  rank_e-i.rinu[PKK]4ʊY row_vector-c.rinu[PKK]\KK] regular%3f-i.rinu[PKK]tXO"" inspect-i.rinu[PKK]ZToo Erows-c.rinu[PKK]Kd&&column_count-i.rinu[PKK]-,DD Tto_a-i.rinu[PKK]q rect-i.rinu[PKK]#BvZZcolumn_vectors-i.rinu[PKK]9bf imag-i.rinu[PKK]\LLeigensystem-i.rinu[PKK]^4 O%5b%5d-c.rinu[PKK]Uy0nn1hermitian%3f-i.rinu[PKK]5  eql%3f-i.rinu[PKK]-!elements_to_f-i.rinu[PKK]ZX 0#det_e-i.rinu[PKK]BGjjb$new-c.rinu[PKK]#ƭHH &rank-i.rinu[PKK]6=ۡdd(normal%3f-i.rinu[PKK]!t'*set_component-i.rinu[PKK],9#ss o+empty%3f-i.rinu[PKK]v   -rows-i.rinu[PKK]: e.row_size-i.rinu[PKK]0r'' /coerce-i.rinu[PKK]=n1set_element-i.rinu[PKK]R?m@3row-i.rinu[PKK]Z0Ks!5%2a-i.rinu[PKK]C6t-i.rinu[PKK]X7448square%3f-i.rinu[PKK]Www z9identity-c.rinu[PKK]63USS;LUPDecomposition/u-i.rinu[PKK]H::=LUPDecomposition/to_a-i.rinu[PKK].Dss>LUPDecomposition/to_ary-i.rinu[PKK]ӂ^@LUPDecomposition/l-i.rinu[PKK]e NNALUPDecomposition/pivots-i.rinu[PKK][tq  ECLUPDecomposition/new-c.rinu[PKK]cDLUPDecomposition/solve-i.rinu[PKK]%&EE!FLUPDecomposition/determinant-i.rinu[PKK]ٓVNN0HLUPDecomposition/p-i.rinu[PKK]R[*ILUPDecomposition/cdesc-LUPDecomposition.rinu[PKK]cnn!OLUPDecomposition/singular%3f-i.rinu[PKK] JPLUPDecomposition/det-i.rinu[PKK]P.Rtr-i.rinu[PKK]Z Selements_to_r-i.rinu[PKK]ppUorthogonal%3f-i.rinu[PKK] Vconj-i.rinu[PKK]w> Wcollect-i.rinu[PKK]QgBZdeterminant-i.rinu[PKK]: ]I-c.rinu[PKK]\9 .^column-i.rinu[PKK]t} "`zero-c.rinu[PKK]#Brrapermutation%3f-i.rinu[PKK]n7BSScconjugate-i.rinu[PKK]++ }find_index-i.rinu[PKK]8m |~inverse-i.rinu[PKK]whUUsdeterminant_e-i.rinu[PKK]l0QQ row_vectors-i.rinu[PKK]ԕ!mmsymmetric%3f-i.rinu[PKK]#X::Isingular%3f-i.rinu[PKK]>Æmap-i.rinu[PKK]z $$column_size-i.rinu[PKK]{{,,M%5b%5d%3d-i.rinu[PKK]X+EigenvalueDecomposition/tridiagonalize-i.rinu[PKK]zVV!EigenvalueDecomposition/to_a-i.rinu[PKK]Qhxx(IEigenvalueDecomposition/eigenvalues-i.rinu[PKK]"#EigenvalueDecomposition/to_ary-i.rinu[PKK]  EigenvalueDecomposition/new-c.rinu[PKK]0,\\EigenvalueDecomposition/v-i.rinu[PKK]wY3EigenvalueDecomposition/eigenvector_matrix_inv-i.rinu[PKK]u>ayy(EigenvalueDecomposition/diagonalize-i.rinu[PKK]XD |>>/EigenvalueDecomposition/build_eigenvectors-i.rinu[PKK]iGqhh"$EigenvalueDecomposition/v_inv-i.rinu[PKK], 998ޜEigenvalueDecomposition/cdesc-EigenvalueDecomposition.rinu[PKK]eE [[EigenvalueDecomposition/d-i.rinu[PKK]k<.(EigenvalueDecomposition/eigenvalue_matrix-i.rinu[PKK]Q ;50EigenvalueDecomposition/hessenberg_to_real_schur-i.rinu[PKK]:nn!?EigenvalueDecomposition/cdiv-i.rinu[PKK]D/EigenvalueDecomposition/eigenvector_matrix-i.rinu[PKK]7Q{{)EigenvalueDecomposition/eigenvectors-i.rinu[PKK]1ϭEigenvalueDecomposition/reduce_to_hessenberg-i.rinu[PKK]J  ¯build-c.rinu[PKK]csNcdesc-Matrix.rinu[PKK]|column_vector-c.rinu[PKK]{'TStranspose-i.rinu[PKK]{ؓ$$ real-i.rinu[PKK]vRRlower_triangular%3f-i.rinu[PKK]i empty-c.rinu[PKK]>%2b-i.rinu[PKK]/\;; Wreal%3f-i.rinu[PKK]p9 clone-i.rinu[PKK]Ldet-i.rinu[PKK]wGlup_decomposition-i.rinu[PKK]ׂ~ 9each-i.rinu[PKK]]SSupper_triangular%3f-i.rinu[PKK]CY $scalar-c.rinu[PKK]74&each_with_index-i.rinu[PKK]-ߑ%2d-i.rinu[PKK]S'rectangular-i.rinu[PKK] minor-i.rinu[PKK]Cffunitary%3f-i.rinu[PKK]ZvKK %3d%3d-i.rinu[PKK]C[@@ zero%3f-i.rinu[PKK]/IIrow_count-i.rinu[PKK]z(O  columns-c.rinu[PKK]'' hash-i.rinu[PKK])qinv-i.rinu[PK{{'