Project

## extendmatrix

0.02
No commit activity in last 3 years
No release in over 3 years
The project consists of some enhancements to the Ruby "Matrix" module and includes: LU and QR (Householder, Givens, Gram Schmidt, Hessenberg) decompositions, bidiagonalization, eigenvalue and eigenvector calculations. Includes some aditional code to obtains marginal for rows and columns.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Popularity
Development
Primary Language
Ruby
Apache v2
Dependencies

>= 0
>= 0

# extendmatrix

## DESCRIPTION:

The project consists of some enhancements to the Ruby "Matrix" module and includes: LU and QR (Householder, Givens, Gram Schmidt, Hessenberg) decompositions, bidiagonalization, eigenvalue and eigenvector calculations. Include some aditional code to obtains marginal for rows and columns.

Original code done by Cosmin Bonchis as a Google Summer of Code 2007 project for Ruby Central Inc.

Gem, github repository and current version mantained by Claudio Bustos and the Ruby Science Foundation.

## SYNOPSIS:

require 'extendmatrix' v = Vector[1, 2, 3, 4]

v.magnitude # => 5.47722557505166

v.normalize # => Vector[0.182574185835055, 0.365148371670111, 0.547722557505166, 0.730296743340221]

# Backport from Ruby 1.9.2+

m = Matrix.build(4, 3){|i, j| i * 3 + j}

# You could modify the matrix

m = Matrix.I(3) m[0,1]=m[1,0]=0.5 m[0,2]=m[2,0]=0.7 m[1,2]=m[2,1]=0.9 m # => Matrix[[1, 0.5, 0.7], [0.5, 1, 0.9], [0.7, 0.9, 1]]

# Eigenvalues and EigenVectors. PCA at sight :)

m.eigenvaluesJacobi => Vector[0.523942339006665, 0.0632833995384682, 2.41277426145487] m.cJacobiV

# => Matrix[[0.818814082563014, 0.249617871497675, 0.516947208547894], [-0.550168858227442, 0.598307531004925, 0.58253096551128], [-0.163883268313767, -0.761392813580323, 0.62723461144538]]

• Ruby > 1.9.3

## INSTALL:

• sudo gem install extendmatrix