Package com.imsl.math
Class PrintMatrix
java.lang.Object
com.imsl.math.PrintMatrix
Matrix printing utilities.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThis flag as the argument to setMatrixType, indicates that the full matrix is to be printed.static final intThis flag as the argument to setMatrixType, indicates that only the lower triangular elements of the matrix are to be printed.static final intThis flag as the argument to setMatrixType, indicates that only the strict lower triangular elements of the matrix are to be printed.static final intThis flag as the argument to setMatrixType, indicates that only the strict upper triangular elements of the matrix are to be printed.static final intThis flag as the argument to setMatrixType, indicates that only the upper triangular elements of the matrix are to be printed. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of the PrintMatrix class.PrintMatrix(PrintStream out) Creates an instance of the PrintMatrix class with the specified PrintStream.PrintMatrix(PrintStream out, String title) Creates a PrintMatrix object with the specified PrintStream and sets its title.PrintMatrix(String title) Creates a PrintMatrix object and sets its title. -
Method Summary
Modifier and TypeMethodDescriptionvoidprint(PrintMatrixFormat pmf, Object array) Prints a matrix with specified format.voidPrints a matrix with a default format.protected voidPrint a string.voidprintHTML(PrintMatrixFormat pmf, Object array, int nRows, int nColumns) Prints an nRows by nColumns matrix with specified format for HTML output.protected voidprintln()Print a newline.setColumnSpacing(int columnSpacing) Sets the number of spaces between columns.setEqualColumnWidths(boolean equalColumnWidths) Force all of the columns to have the same width.setMatrixType(int matrixType) Set matrix type.setPageWidth(int pageWidth) Sets the page width.Sets matrix title
-
Field Details
-
FULL
public static final int FULLThis flag as the argument to setMatrixType, indicates that the full matrix is to be printed.- See Also:
-
UPPER_TRIANGULAR
public static final int UPPER_TRIANGULARThis flag as the argument to setMatrixType, indicates that only the upper triangular elements of the matrix are to be printed. The matrix still must be a rectangular matrix.- See Also:
-
LOWER_TRIANGULAR
public static final int LOWER_TRIANGULARThis flag as the argument to setMatrixType, indicates that only the lower triangular elements of the matrix are to be printed. The matrix still must be a rectangular matrix.- See Also:
-
STRICT_UPPER_TRIANGULAR
public static final int STRICT_UPPER_TRIANGULARThis flag as the argument to setMatrixType, indicates that only the strict upper triangular elements of the matrix are to be printed. The matrix still must be a rectangular matrix.- See Also:
-
STRICT_LOWER_TRIANGULAR
public static final int STRICT_LOWER_TRIANGULARThis flag as the argument to setMatrixType, indicates that only the strict lower triangular elements of the matrix are to be printed. The matrix still must be a rectangular matrix.- See Also:
-
-
Constructor Details
-
PrintMatrix
public PrintMatrix()Creates an instance of the PrintMatrix class. -
PrintMatrix
Creates an instance of the PrintMatrix class with the specified PrintStream.- Parameters:
out- aPrintStream
-
PrintMatrix
Creates a PrintMatrix object and sets its title.- Parameters:
title- aStringspecifying the title
-
PrintMatrix
Creates a PrintMatrix object with the specified PrintStream and sets its title.- Parameters:
out- aPrintStreamtitle- aStringspecifying the title
-
-
Method Details
-
setTitle
Sets matrix title- Parameters:
title- aStringspecifying the title of the matrix- Returns:
- the
PrintMatrixobject
-
setEqualColumnWidths
Force all of the columns to have the same width.- Parameters:
equalColumnWidths- abooleanwhich specifies that all column widths will be equal- Returns:
- the
PrintMatrixobject
-
setColumnSpacing
Sets the number of spaces between columns. The default value is 2.- Parameters:
columnSpacing- anintspecifying the number of spaces between columns, default is 2- Returns:
- the
PrintMatrixobject
-
setPageWidth
Sets the page width. The default value is the largest possible integer.- Parameters:
pageWidth- anintspecifying the page width, default is the largest possible integer- Returns:
- the
PrintMatrixobject
-
setMatrixType
Set matrix type.- Parameters:
matrixType-intspecifying the matrix type. Values for matrixType are:0 FULL 1 UPPER_TRIANGULAR 2 LOWER_TRIANGULAR 3 STRICT_UPPER_TRIANGULAR 4 STRICT_LOWER_TRIANGULAR - Returns:
- the
PrintMatrixobject
-
print
Print a string. This function can be overridden to print to something other than a PrintStream.- Parameters:
string- theStringto be printed
-
println
protected void println()Print a newline. This function can be overridden to print to something other than a PrintStream. -
print
Prints a matrix with a default format.- Parameters:
array- a two-dimensional, non-empty, rectangular array
-
print
Prints a matrix with specified format.- Parameters:
pmf- aPrintMatrixFormatmatrix formatarray- a two-dimensional, non-empty, rectangular array
-
printHTML
Prints an nRows by nColumns matrix with specified format for HTML output.- Parameters:
pmf- aPrintMatrixFormatmatrix formatnRows- anintspecifying the number of rows in the matrixnColumns- anintspecifying the number of columns in the matrix
-