Skip to content

Commit

Permalink
check stacked time system size to make sure it's square (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbejanov authored Nov 5, 2024
1 parent 8446b04 commit d637c49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
julia-version: ["1.7", "1.8", "1.9"]
julia-version: ["1.9", "lts", "1"]
julia-arch: [x64]
os: [ubuntu-latest, windows-latest, macOS-latest]

Expand Down
4 changes: 3 additions & 1 deletion src/stackedtime/solverdata.jl
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ function update_plan!(sd::StackedTimeSolverData, model::Model, plan::Plan; chang
if changed
@. sd.solve_mask = !(sd.fc_mask | sd.exog_mask)
@assert !any(sd.exog_mask .& sd.fc_mask)
@assert sum(sd.solve_mask) == size(sd.J, 1)
if sum(sd.solve_mask) != size(sd.J, 1)
throw(ArgumentError("Mismatch in the numbers of equations ($(size(sd.J, 1))) and unknowns ($(sum(sd.solve_mask))).\nCheck the model definition and the simulation plan."))
end
sm_index = cumsum(sd.solve_mask)

# Update the Jacobian correction matrix, if exogenous plan changed
Expand Down

0 comments on commit d637c49

Please sign in to comment.