From cf9883ef619329cf80b52bd09211afaddfde1b60 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Hermes=29?=
<stephane.adjemian@univ-lemans.fr>
Date: Thu, 19 May 2016 21:43:36 +0200
Subject: [PATCH] Bug fix in assert (Julia output).
See PR #1102 by spencerlyon2.
size always returns a tuple, and we were comparing to an int. Dispatch restricts these arguments to all be vectors so length works here.
---
preprocessor/DynamicModel.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/preprocessor/DynamicModel.cc b/preprocessor/DynamicModel.cc
index ccebb9ec97..2d53e19aa0 100644
--- a/preprocessor/DynamicModel.cc
+++ b/preprocessor/DynamicModel.cc
@@ -2409,9 +2409,9 @@ DynamicModel::writeDynamicModel(ostream &DynamicOutput, bool use_dll, bool julia
<< " steady_state::Vector{Float64}, it_::Int, "
<< "residual::Vector{Float64})" << endl
<< "#=" << endl << comments.str() << "=#" << endl
- << " @assert size(y) == " << dynJacobianColsNbr << endl
- << " @assert size(params) == " << symbol_table.param_nbr() << endl
- << " @assert size(residual) == " << nrows << endl
+ << " @assert length(y) == " << dynJacobianColsNbr << endl
+ << " @assert length(params) == " << symbol_table.param_nbr() << endl
+ << " @assert length(residual) == " << nrows << endl
<< " #" << endl
<< " # Model equations" << endl
<< " #" << endl
--
GitLab