-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Introduce pretty display functionality for matrix
* Added `prettyDisplay()` methods to the `Matrix` class for enhanced visualization of matrix data. - `prettyDisplay()` (no arguments): Displays the entire matrix with optional column and row indices. - `prettyDisplay(boolean)`: Allows toggling of row and column index display. - `prettyDisplay(int)`: Displays a specific row of the matrix with optional row and column indices. - `prettyDisplay(int, boolean)`: Provides the option to specify whether to show row and column indices for a specific row. - `prettyDisplay(double[][])`: Static method to pretty print a 2D array, with an option to show indices. - `prettyDisplay(double[][], boolean)`: Static method to pretty print a 2D array with index display option. - `prettyDisplay(double[][], int)`: Static method to pretty print a specific row of a 2D array with optional index display. - `prettyDisplay(double[][], int, boolean)`: Static method to pretty print a specific row of a 2D array, with customizable index display. * Each `prettyDisplay()` method formats the matrix or array into a neatly aligned grid, making it easier to read and interpret the data. It calculates the maximum width for each column to ensure proper alignment and provides options for including row and column indices. * Added handling for null matrices and arrays, ensuring that `<null_matrix>` or `<null_2darray>` is displayed when appropriate. * Implemented support for negative row indices, allowing users to specify indices relative to the end of the matrix or array. * Improved the `prettyDisplay()` methods to raise `InvalidIndexException` for out-of-bounds indices, providing error messages when invalid indices are used. These enhancements improve the usability and readability of matrix data, especially for debugging and data analysis purposes.
- Loading branch information
Showing
1 changed file
with
214 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters