Skip to content

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

@bramhaag

Description

@bramhaag

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions