#!/usr/bin/perl

use lib 'd:/Programs/Perl/lib';

use strict;
use Sci::MyMatrixReal;

# $M * $X = $A => $X
my $M = new MyMatrixReal( [
	[ 50.0, -1.0,  0.0],
	[  0.0, -1.0,  1.0],
	[100.0,  1.0, -1.0]
	] );
my $A = new MyMatrixReal( [
	[-200.0], 
	[1000.0], 
	[-400.0]
	] );

print "Equation\n", $M, " x X = \n", $A;

my $SolutionMatrix = MyMatrixReal::LinearSolve($M, $A);
if($SolutionMatrix) {
	print "solution=\n$SolutionMatrix\n";
}
else {
	print "The given equation does not have an answer.\n";
}

exit;

