Shlomi Fish >
PDL-Lib-Linear-Solve-0.002 >
PDL::Lib::Linear::Solve

PDL::Lib::Linear::Solve -- Linear Equations Set Solution or Matrix Inversion using Hard-Coded Routines

use PDL; use PDL::Lib::Linear::Solve; my $coeffs = pdl([[1,1],[0,1]]); my $values = pdl([[5],[2]]); my ($new_coeffs, $new_values) = linear_solve($coeffs, $values);

This package provides routines for solving a set of linear equations and inverting a matrix using hard-coded routines written in C.

Copyright (C) 2003 Shlomi Fish. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file.

`linear_solve`

provides a solving algorithm for a set of linear equations.

($result_coeffs, $result_values) = linear_solve($coeffs, $values);

`linear_solve`

accepts two arguments - a square matrix representing the linear equation coefficients, and a tensors that contains their values. As a result it produces a matrix with the final coefficients (an identity matrix if the coefficients form a regular matrix), and the final values.

Inverts a matrix

$inverted_matrix = inv($matrix);

$inverted_matrix = inv($matrix);

syntax highlighting: