This method is a shortcut for converting a single row (Array
) into a CSV
String
.
The options
parameter can be anything CSV::new()
understands. This method understands an additional :encoding
parameter to set the base Encoding
for the output. This method will try to guess your Encoding
from the first non-nil
field in row
, if possible, but you may need to use this parameter as a backup plan.
The :row_sep
option
defaults to $INPUT_RECORD_SEPARATOR
($/
) when calling this method.
This method is a shortcut for converting a single line of a CSV
String
into an Array
. Note that if line
contains multiple rows, anything beyond the first row is ignored.
The options
parameter can be anything CSV::new()
understands.
Returns true
if illegal input is handled. See CSV::new
for details.
Return the appropriate error message in POSIX-defined format. If no error has occurred, returns nil.
Returns a string for DNS reverse lookup compatible with RFC3172.
Returns the Ruby source filename and line number of the binding object.
Returns the Laplace expansion along given row or column.
Matrix[[7,6], [3,9]].laplace_expansion(column: 1) => 45 Matrix[[Vector[1, 0], Vector[0, 1]], [2, 3]].laplace_expansion(row: 0) => Vector[3, -2]
Hadamard product
Matrix[[1,2], [3,4]].hadamard_product(Matrix[[1,2], [3,2]]) => 1 4 9 8
Private. Use Matrix#determinant
Returns the determinant of the matrix, using Bareiss’ multistep integer-preserving gaussian elimination. It has the same computational cost order O(n^3) as standard Gaussian elimination. Intermediate results are fraction free and of lower complexity. A matrix of Integers will have thus intermediate results that are also Integers, with smaller bignums (if any), while a matrix of Float
will usually have intermediate results with better precision.
Explicit conversion to a Matrix
. Returns self
Returns an angle with another vector. Result is within the [0..Math::PI].
Vector[1,0].angle_with(Vector[0,1]) # => Math::PI / 2
Return a single-column matrix from this vector