The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Bio::Metabolic::MatrixOps - Operations on PDL::Matrix objects

SYNOPSIS

  use Bio::Metabolic::MatrixOps;

DESCRIPTION

This module contains all matrix operations that are needed for calculations involving the stoichiometric matrix

AUTHOR

Oliver Ebenhoeh, oliver.ebenhoeh@rz.hu-berlin.de

SEE ALSO

Bio::Metabolic Bio::Metabolic::Substrate Bio::Metabolic::Substrate::Cluster Bio::Metabolic::Reaction Bio::Metabolic::Network

METHODS

method xrow

$m->xrow($r1,$r2); Exchanges rows $r1 and $r2 in matrix $m.

method xcol

$m->xcol($r1,$r2); Exchanges columns $r1 and $r2 in matrix $m.

method addrows

$m->addrows($r1,$r2[,$lambda]); Adds $lambda times the $r2-th row to $r1

method addcols

$m->addcols($c1,$c2[,$lambda]); Adds $lambda times the $c2-th column to $c1

method delcol

$m->delcol($c); Sets all coefficients in the column $c to zero.

method delcols

$m->delcols(@c); Sets all coefficients in the columns specified in @c to zero.

method delrow

$m->delrow($r); Sets all coefficients in the row $r to zero.

method delrows

$m->delrows(@r); Sets all coefficients in the rows specified in @r to zero.

method det # probably obsolete!!!! Check with PDL::Matrix / PDL::MatrixOps

$det = $m->det; Returns the determinant of matrix $m, undef if $m is not square.

method is_pos_def

$m->is_pos_def; Returns true if matrix $m is truely positive definite, false otherwise

method row_echelon_int;

$row_echelon_matrix = $m->row_echelon_int; ($row_echelon_matrix, $permutation_vector, $rank) = $m->row_echelon_int;

Returns the integer row echelon form of matrix $m. In array context also returns the permutation vector indication how the rows of $m were permuted while calculating the row echelon form and the rank of the matrix $m.

method cutrow

$mnew = $m->cutrow($r); Returns a matrix without row $r, i.e. the number of rows is reduced by one.

method cutcol

$mnew = $m->cutcol($c); Returns a matrix without column $c, i.e. the number of columns is reduced by one.

method cutrows

$mnew = $m->cutrows(@r); Returns a matrix without all rows specified in @r, i.e. the number of rows is reduced by the number of elements in @r.

method cutcols

$mnew = $m->cutcols(@c); Returns a matrix without all columns specified in @c, i.e. the number of columns is reduced by the number of elements in @c.

method permrows

$mnew = $m->permrows($permutation_vector);

Returns a matrix with the rows permuted as specified by $permutation_vector. $permutation_vector must be a PDL.

EXAMPLE: If $m is a 3x3 matrix, then $p = $m->permrows(pdl [2,0,1]); will return a matrix with the last row of $m as first row, the first row of $m as the second and the second row of $m as the last row.

method kernel

$ker = $m->kernel; Returns the kernel of matrix $m, i.e. the matrix with linearly independent column vectors $c satisfying the equation $m x $c = 0.

method invert # probably obsolete!!!! Check with PDL::Matrix / PDL::MatrixOps

$inv = $m->invert; Returns the inverse of $m, undef if $m is not invertible.

method char_pol

$coefficient_vector = $m->char_pol;

Returns a PDL with the coefficients of the characteristic polynomial of $m.

EXAMPLE: [1 2 1] The matrix M=[2 0 3] has the characeristic polynomial [1 1 1] p(x) = det(M-x1) = a_3 x^3 + a_2 x^2 + a_1 x + a_0 = -x^3+2x^2+7x+1.

  $m = mdpl [[1,2,1],[2,0,3],[1,1,1]];
  $cp = $m->char_pol;
This returns [1,7,2,-1]. $cp->at(n) contains the coefficient a_n.

method to_Hurwitz

$hurwitz_matrix = $m->to_Hurwitz;

Returns the Hurwitz matrix. The coefficients of the Hurwitz matrix are defined to be: H_ij = a_{n-2i+j} if 0 < 2i-j <= n, 0 otherwise where a_n are the coefficients of the characteristic polynomial.

method Hurwitz_crit

if ($m->Hurwitz_crit) { ... }

Returns true if the Hurwitz condition is fulfilled, i.e. if all sub-determinants are larger than zero and a_n/a_0 > 0 for all n >= 1.