Skip to content

Commit

Permalink
Fixed bugs when emtpy equation list
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1439 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Jan 31, 2005
1 parent 4a0f139 commit 2051f0f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion modeq/daelow.rml
Expand Up @@ -1921,6 +1921,8 @@ relation matching_algorithm: (DAELow,IncidenceMatrix, IncidenceMatrixT)

rule array_length(m) => nvars &
array_length(mt) => neqns &
int_gt(nvars,0) => true &
int_gt(neqns,0) => true &
int_real(nvars) => nrvars &
real_mul(nrvars,2.0)=> nrvars' &
real_int(nrvars') => memsize &
Expand All @@ -1933,6 +1935,12 @@ relation matching_algorithm: (DAELow,IncidenceMatrix, IncidenceMatrixT)
assignments_vector(ass2) => vec2
--------------------------
matching_algorithm(dae,m,mt) => (vec1,vec2,dae,m,mt)

rule list_vector([]) => v1 &
list_vector([]) => v2
------------------------
matching_algorithm(dae,m,mt) => (v1,v2,dae,m,mt)

end

(** relation assignments_vector
Expand Down Expand Up @@ -2638,7 +2646,12 @@ end
** Transform the expandable Equation array to a list of Equations.
**)
relation equation_list:(EquationArray) => Equation list =


axiom equation_list(EQUATION_ARRAY(0,_,arr)) => []
rule array_nth(arr,0) => SOME(elt)
-----------------------------
equation_list(EQUATION_ARRAY(1,_,arr)) => [elt]

rule n - 1 => lastpos &
equation_list2(arr,0,lastpos) => lst
-----------------------
Expand Down

0 comments on commit 2051f0f

Please sign in to comment.