Skip to content

Commit

Permalink
Eliminate expression node from 1x1 Solve() (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Jun 28, 2024
1 parent 566630f commit cd3257f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/autodiff/VariableMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ VariableMatrix Solve(const VariableMatrix& A, const VariableMatrix& B) {

if (A.Rows() == 1 && A.Cols() == 1) {
// Compute optimal inverse instead of using Eigen's general solver
return 1.0 / A(0, 0) * B;
return B(0, 0) / A(0, 0);
} else if (A.Rows() == 2 && A.Cols() == 2) {
// Compute optimal inverse instead of using Eigen's general solver
//
Expand Down

0 comments on commit cd3257f

Please sign in to comment.