double[][] coefficients = { { 3.0, 20.0, 89.0 },
{ 4.0, 40.0, 298.0 },
{ 7.0, 21.0, 0.42 } };
double[] values = { 1324, 2999, 2039 };
RealMatrix matrix = new RealMatrixImpl( coefficients );
double[] answers = matrix.solve( values );
System.out.println( "Answers: " + ArrayUtils.toString( answers ) );
double[][] badCoefficients = { { 1, 1, 1 },
{ 1, 1, 1 },
{ 1, 1, 1 } };
double[] badValues = { 0, 1, 3 };
matrix = new RealMatrixImpl( badCoefficients );
answers = matrix.solve( badValues );
System.out.println( "Answers: " + ArrayUtils.toString( answers ) );