package com.imsl.test.example.math; import com.imsl.math.*; /** *
* Prints a simple matrix.
* * The 1 norm of a matrix is found using a method from the Matrix class. The * matrix is printed using the PrintMatrix class. * * * @see Code * @see Output * */ public class PrintMatrixEx1 { public static void main(String args[]) { double nrm1; double a[][] = { {0., 1., 2., 3.}, {4., 5., 6., 7.}, {8., 9., 8., 1.}, {6., 3., 4., 3.} }; // Get the 1 norm of matrix a nrm1 = Matrix.oneNorm(a); // Construct a PrintMatrix object with a title PrintMatrix p = new PrintMatrix("A Simple Matrix"); // Print the matrix and its 1 norm p.print(a); System.out.println("The 1 norm of the matrix is " + nrm1); } }