SIGN IN SIGN UP

Adding method to check wether a matrix is stochastic (#7184)

* Add StochasticMatrix utility class

This class provides methods to check if a matrix is row-stochastic or column-stochastic, ensuring all elements are non-negative and the sums of rows or columns equal 1.

* Change package from maths to matrix

Updated package declaration for StochasticMatrix class.

* Change package declaration in StochasticMatrixTest

* Delete src/test/java/com/thealgorithms/StochasticMatrixTest.java

* Refactor matrix initialization for test cases

* Fix formatting of matrix initialization in tests

* Remove unnecessary newline in StochasticMatrix

* Add import statement for JUnit in StochasticMatrixTest

* Add additional assertions to StochasticMatrixTest

* Clean up import statements in StochasticMatrixTest

Removed unused import statements for cleaner code.

* Reorder import statements in StochasticMatrixTest

* Remove unused import assertThrows from StochasticMatrixTest

Removed unused import for assertThrows.
D
Daniel Sánchez Núñez committed
d382e656f20eaddc2d91c723519a2d8775e7dc57
Parent: 51335cc
Committed by GitHub <noreply@github.com> on 12/28/2025, 9:53:12 AM