diff --git a/src/restrictions_zero.cpp b/src/restrictions_zero.cpp index 5397ba6..981c664 100644 --- a/src/restrictions_zero.cpp +++ b/src/restrictions_zero.cpp @@ -37,12 +37,12 @@ arma::colvec zero_restrictions( mat A0 = reshape(vec_structural.rows(0, N * N - 1), N, N); - field ZF = ZIRF(Z, inv(A0.t())); + mat irf_0 = inv(A0.t()); vec z; - for (int j = 0; j < ZF.n_elem; j++) { - mat ZF_j = ZF(j); - z = join_vert(z, ZF_j.col(j)); + for (int j = 0; j < Z.n_elem; j++) { + mat ZF = Z(j) * irf_0; + z = join_vert(z, ZF.col(j)); } return z;