@@ -12,94 +12,10 @@ namespace amici {
1212 * Holds number of state variables, observables, etc.
1313 */
1414struct ModelDimensions {
15- /* * Default ctor */
16- ModelDimensions () = default ;
17-
1815 /* *
19- * @brief Constructor with model dimensions
20- * @param nx_rdata Number of state variables
21- * @param nxtrue_rdata Number of state variables of the non-augmented model
22- * @param nx_solver Number of state variables with conservation laws applied
23- * @param nxtrue_solver Number of state variables of the non-augmented model
24- * with conservation laws applied
25- * @param nx_solver_reinit Number of state variables with conservation laws
26- * subject to reinitialization
27- * @param np Number of parameters
28- * @param nk Number of constants
29- * @param ny Number of observables
30- * @param nytrue Number of observables of the non-augmented model
31- * @param nz Number of event observables
32- * @param nztrue Number of event observables of the non-augmented model
33- * @param ne Number of events
34- * @param ne_solver Number of events that require root-finding
35- * @param nspl Number of splines
36- * @param nJ Number of objective functions
37- * @param nw Number of repeating elements
38- * @param ndwdx Number of nonzero elements in the `x` derivative of the
39- * repeating elements
40- * @param ndwdp Number of nonzero elements in the `p` derivative of the
41- * repeating elements
42- * @param ndwdw Number of nonzero elements in the `w` derivative of the
43- * repeating elements
44- * @param ndxdotdw Number of nonzero elements in the \f$ w\f$ derivative of
45- * \f$ xdot\f$
46- * @param ndJydy Number of nonzero elements in the \f$ y\f$ derivative of
47- * \f$ dJy\f$ (shape `nytrue`)
48- * @param ndxrdatadxsolver Number of nonzero elements in the \f$ x\f$
49- * derivative of \f$ x_rdata\f$
50- * @param ndxrdatadtcl Number of nonzero elements in the \f$ tcl\f$
51- * derivative of \f$ x_rdata\f$
52- * @param ndtotal_cldx_rdata Number of nonzero elements in the
53- * \f$ x_rdata \f$ derivative of \f$ total_cl \f$
54- * @param nnz Number of nonzero elements in Jacobian
55- * @param ubw Upper matrix bandwidth in the Jacobian
56- * @param lbw Lower matrix bandwidth in the Jacobian
57- * @param ndxdotdp_explicit Number of nonzero elements in `dxdotdp_explicit`
58- * @param ndxdotdx_explicit Number of nonzero elements in `dxdotdx_explicit`
59- * @param w_recursion_depth Recursion depth of fw
16+ * @brief Validate dimensions.
6017 */
61- ModelDimensions (
62- int const nx_rdata, int const nxtrue_rdata, int const nx_solver,
63- int const nxtrue_solver, int const nx_solver_reinit, int const np,
64- int const nk, int const ny, int const nytrue, int const nz,
65- int const nztrue, int const ne, int const ne_solver, int const nspl,
66- int const nJ, int const nw, int const ndwdx, int const ndwdp,
67- int const ndwdw, int const ndxdotdw, std::vector<int > ndJydy,
68- int const ndxrdatadxsolver, int const ndxrdatadtcl,
69- int const ndtotal_cldx_rdata, int const nnz, int const ubw,
70- int const lbw, int ndxdotdp_explicit = 0 , int ndxdotdx_explicit = 0 ,
71- int w_recursion_depth = 0
72- )
73- : nx_rdata(nx_rdata)
74- , nxtrue_rdata(nxtrue_rdata)
75- , nx_solver(nx_solver)
76- , nxtrue_solver(nxtrue_solver)
77- , nx_solver_reinit(nx_solver_reinit)
78- , np(np)
79- , nk(nk)
80- , ny(ny)
81- , nytrue(nytrue)
82- , nz(nz)
83- , nztrue(nztrue)
84- , ne(ne)
85- , ne_solver(ne_solver)
86- , nspl(nspl)
87- , nw(nw)
88- , ndwdx(ndwdx)
89- , ndwdp(ndwdp)
90- , ndwdw(ndwdw)
91- , ndxdotdw(ndxdotdw)
92- , ndJydy(std::move(ndJydy))
93- , ndxrdatadxsolver(ndxrdatadxsolver)
94- , ndxrdatadtcl(ndxrdatadtcl)
95- , ndtotal_cldx_rdata(ndtotal_cldx_rdata)
96- , nnz(nnz)
97- , nJ(nJ)
98- , ubw(ubw)
99- , lbw(lbw)
100- , ndxdotdp_explicit(ndxdotdp_explicit)
101- , ndxdotdx_explicit(ndxdotdx_explicit)
102- , w_recursion_depth(w_recursion_depth) {
18+ void validate () const {
10319 Expects (nxtrue_rdata >= 0 );
10420 Expects (nxtrue_rdata <= nx_rdata);
10521 Expects (nxtrue_solver >= 0 );
@@ -139,23 +55,22 @@ struct ModelDimensions {
13955 Expects (ndxdotdx_explicit >= 0 );
14056 Expects (w_recursion_depth >= 0 );
14157 }
142-
143- /* * Number of states */
58+ /* * Number of state variables */
14459 int nx_rdata{0 };
14560
146- /* * Number of states in the unaugmented system */
61+ /* * Number of state variables in the unaugmented system */
14762 int nxtrue_rdata{0 };
14863
149- /* * Number of states with conservation laws applied */
64+ /* * Number of state variables with conservation laws applied */
15065 int nx_solver{0 };
15166
15267 /* *
153- * Number of states in the unaugmented system with conservation laws
154- * applied
68+ * Number of state variables in the unaugmented system with conservation
69+ * laws applied
15570 */
15671 int nxtrue_solver{0 };
15772
158- /* * Number of solver states subject to reinitialization */
73+ /* * Number of solver state variables subject to reinitialization */
15974 int nx_solver_reinit{0 };
16075
16176 /* * Number of parameters */
@@ -240,10 +155,10 @@ struct ModelDimensions {
240155 /* * Lower bandwidth of the Jacobian */
241156 int lbw{0 };
242157
243- /* * Number of nonzero elements in `dxdotdx_explicit ` */
158+ /* * Number of nonzero elements in `dxdotdp_explicit ` */
244159 int ndxdotdp_explicit = 0 ;
245160
246- /* * Number of nonzero elements in `dxdotdp_explicit ` */
161+ /* * Number of nonzero elements in `dxdotdx_explicit ` */
247162 int ndxdotdx_explicit = 0 ;
248163
249164 /* * Recursion depth of fw */
0 commit comments