Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix multiplication bug: "1 does not equal to 1." #288

Open
bramhaag opened this issue Mar 1, 2018 · 0 comments · May be fixed by #289
Open

Matrix multiplication bug: "1 does not equal to 1." #288

bramhaag opened this issue Mar 1, 2018 · 0 comments · May be fixed by #289

Comments

@bramhaag
Copy link

bramhaag commented Mar 1, 2018

I got a rather interesting stacktrace:

Exception in thread "main" java.lang.IllegalArgumentException: The number of rows in the left-hand matrix should be equal to the number of columns in the right-hand matrix: 1 does not equal to 1.
	at org.la4j.operation.ooplace.OoPlaceMatricesMultiplication.ensureApplicableTo(OoPlaceMatricesMultiplication.java:209)
	at org.la4j.operation.MatrixMatrixOperation$1.ensureApplicableTo(MatrixMatrixOperation.java:64)
	at org.la4j.matrix.DenseMatrix.apply(DenseMatrix.java:173)
	at org.la4j.matrix.DenseMatrix.apply(DenseMatrix.java:179)
	at org.la4j.Matrix.multiply(Matrix.java:619)

1 does not equal to 1 in particular is interesting here. It appears that in the error message, Matrix#rows() and Matrix#columns are reversed compared to the if statement, see this

I've made #289 to fix this issue.

bramhaag added a commit to bramhaag/la4j that referenced this issue Mar 1, 2018
@bramhaag bramhaag linked a pull request Mar 1, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant