Skip to content
Snippets Groups Projects
Verified Commit a40a9b07 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

sparse_hessian_times_B_kronecker_C MEX: bugfix relating to number of rows of B and C

In practice however, it seems that this bug never hits, because B and C always
have the same number of rows when the MEX is called.
parent 3bd3c78e
Branches
Tags
No related merge requests found
/* /*
* Copyright © 2007-2020 Dynare Team * Copyright © 2007-2021 Dynare Team
* *
* This file is part of Dynare. * This file is part of Dynare.
* *
...@@ -114,8 +114,8 @@ sparse_hessian_times_B_kronecker_C(const mwIndex *isparseA, const mwIndex *jspar ...@@ -114,8 +114,8 @@ sparse_hessian_times_B_kronecker_C(const mwIndex *isparseA, const mwIndex *jspar
if (k1 < k2) // otherwise column ii of A does not have non zero elements (and there is nothing to compute). if (k1 < k2) // otherwise column ii of A does not have non zero elements (and there is nothing to compute).
{ {
++nz_in_column_ii_of_A; ++nz_in_column_ii_of_A;
mwIndex iC = ii % mB; mwIndex iC = ii % mC;
mwIndex iB = ii / mB; mwIndex iB = ii / mC;
double cb = C[jC*mC+iC]*B[jB*mB+iB]; double cb = C[jC*mC+iC]*B[jB*mB+iB];
/* /*
** Loop over the non zero entries of A(:,ii). ** Loop over the non zero entries of A(:,ii).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment