diff --git a/casadi/core/solve_impl.hpp b/casadi/core/solve_impl.hpp index 433ad83b9d..a077ae8bcb 100644 --- a/casadi/core/solve_impl.hpp +++ b/casadi/core/solve_impl.hpp @@ -432,7 +432,7 @@ namespace casadi { } // Perform sparse matrix multiplication g << g.triusolve(this->dep(1).sparsity(), g.work(arg[1], this->dep(1).nnz()), - g.work(arg[1], this->dep(1).nnz()), Tr, false, nrhs) << '\n'; + g.work(res[0], this->nnz()), Tr, false, nrhs) << '\n'; } template @@ -446,7 +446,7 @@ namespace casadi { } // Perform sparse matrix multiplication g << g.trilsolve(this->dep(1).sparsity(), g.work(arg[1], this->dep(1).nnz()), - g.work(arg[1], this->dep(1).nnz()), Tr, false, nrhs) << '\n'; + g.work(res[0], this->nnz()), Tr, false, nrhs) << '\n'; } template @@ -460,7 +460,7 @@ namespace casadi { } // Perform sparse matrix multiplication g << g.triusolve(this->dep(1).sparsity(), g.work(arg[1], this->dep(1).nnz()), - g.work(arg[1], this->dep(1).nnz()), Tr, true, nrhs) << '\n'; + g.work(res[0], this->nnz()), Tr, true, nrhs) << '\n'; } template @@ -474,7 +474,7 @@ namespace casadi { } // Perform sparse matrix multiplication g << g.trilsolve(this->dep(1).sparsity(), g.work(arg[1], this->dep(1).nnz()), - g.work(arg[1], this->dep(1).nnz()), Tr, true, nrhs) << '\n'; + g.work(res[0], this->nnz()), Tr, true, nrhs) << '\n'; } } // namespace casadi