mitsuki31 / jmatrix

A lightweight Java library for basic introduction to matrix and linear algebra concepts.
https://mitsuki31.github.io/jmatrix/
Apache License 2.0
1 stars 0 forks source link

feat(matrix): Introduce methods for swapping specified rows and columns #108

Closed mitsuki31 closed 5 months ago

mitsuki31 commented 5 months ago

Overview

This pull request introduces several enhancements and improvements to the Matrix class, focusing on documentation updates, refactoring, and the addition of methods for swapping specified rows and columns within the matrix.

Notable Changes

Description

Features Addition

Documentation Enhancement

Refactoring

Summary

This pull request enhances the Matrix class by focusing on refactoring code for better maintainability, and introducing efficient methods for swapping specified rows and columns within the matrix. These changes aim to streamline development processes, optimize performance, and enrich the overall user experience when working with matrices in the application.

mitsuki31 commented 5 months ago

There's a bad logic inside the body insertRow method on row index checker.

https://github.com/mitsuki31/jmatrix/blob/ebd80dd78cc2eec1a34b2591f46c5d9ce0d5fc11/src/main/java/com/mitsuki/jmatrix/Matrix.java#L958-L963

It should be like this:

-    } else if (row < 0 || row > mRows) {  // Check for the index is out of bounds
+    } else if (row < 0 || row >= mRows) {  // Check for the index is out of bounds

Where the given row must be lower than (and not equals) to mRows (the total rows of the matrix).

This issue was moved to #110.