Skip to content

Commit

Permalink
- Replaced tab characters with 2 spaces (mostly in C sources since Ec…
Browse files Browse the repository at this point in the history
…lipse/MDT usually manages to avoid using tabs)

$ svn diff Compiler/ | grep ^- | grep -v ^--- | wc -l
4771
$ svn diff c_runtime/ | grep ^- | grep -v ^--- | wc -l
13365
$ svn diff OMNotebook/ | grep ^- | grep -v ^--- | wc -l
17341
$ svn diff OMShell/ | grep ^- | grep -v ^--- | wc -l
582


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7662 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jan 7, 2011
1 parent 1922351 commit 441450c
Show file tree
Hide file tree
Showing 304 changed files with 18,442 additions and 18,442 deletions.
16 changes: 8 additions & 8 deletions Compiler/BackEnd/BackendDAE.mo
Expand Up @@ -30,7 +30,7 @@
*/

package BackendDAE
" file: BackendDAE.mo
" file: BackendDAE.mo
package: BackendDAE
description: BackendDAE contains the datatypes used by the backend.

Expand Down Expand Up @@ -381,14 +381,14 @@ type IncidenceMatrixT = IncidenceMatrix "IncidenceMatrixT : a list of equation i
public
uniontype JacobianType "- Jacobian Type"
record JAC_CONSTANT "If jacobian has only constant values, for system
of equations this means that it can be solved statically." end JAC_CONSTANT;
of equations this means that it can be solved statically." end JAC_CONSTANT;

record JAC_TIME_VARYING "If jacobian has time varying parts, like parameters or
algebraic variables" end JAC_TIME_VARYING;
algebraic variables" end JAC_TIME_VARYING;

record JAC_NONLINEAR "If jacobian contains variables that are solved for,
means that a nonlinear system of equations needs to be
solved" end JAC_NONLINEAR;
means that a nonlinear system of equations needs to be
solved" end JAC_NONLINEAR;

record JAC_NO_ANALYTIC "No analytic jacobian available" end JAC_NO_ANALYTIC;

Expand All @@ -405,11 +405,11 @@ end IndexReduction;
public
uniontype EquationConstraints "- Equation Constraints"
record ALLOW_UNDERCONSTRAINED "for e.g. initial eqns.
where not all variables
have a solution" end ALLOW_UNDERCONSTRAINED;
where not all variables
have a solution" end ALLOW_UNDERCONSTRAINED;

record EXACT "exact as many equations
as variables" end EXACT;
as variables" end EXACT;

end EquationConstraints;

Expand Down
12 changes: 6 additions & 6 deletions Compiler/BackEnd/BackendDAECreate.mo
Expand Up @@ -2197,25 +2197,25 @@ algorithm
end extendRange;

protected function expInt "returns the int value of an expression"
input DAE.Exp exp;
input BackendDAE.Variables inKnVariables;
output Integer i;
input DAE.Exp exp;
input BackendDAE.Variables inKnVariables;
output Integer i;
algorithm
i := match(exp,inKnVariables)
i := match(exp,inKnVariables)
local
Integer i2;
DAE.ComponentRef cr;
BackendDAE.Variables knv;
DAE.Exp e;
case (DAE.ICONST(integer = i2),_) then i2;
case (DAE.ICONST(integer = i2),_) then i2;
case (DAE.ENUM_LITERAL(index = i2),_) then i2;
case (DAE.CREF(componentRef=cr),knv)
equation
((BackendDAE.VAR(bindExp=SOME(e)):: _),_) = BackendVariable.getVar(cr, knv);
i2 = expInt(e,knv);
then
i2;
end match;
end match;
end expInt;

protected function sortEqn
Expand Down
14 changes: 7 additions & 7 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -30,7 +30,7 @@
*/

package BackendDAEOptimize
" file: BackendDAEOptimize.mo
" file: BackendDAEOptimize.mo
package: BackendDAEOptimize
description: BackendDAEOPtimize contains functions that do some kind of
optimazation on the BackendDAE datatype:
Expand Down Expand Up @@ -1629,16 +1629,16 @@ algorithm
nvars = arrayLength(m_1);
neqns = arrayLength(mT_1);
memsize = nvars + nvars "Worst case, all eqns are differentiated once. Create nvars2 assignment elements" ;
assign1 = BackendDAETransform.assignmentsCreate(nvars, memsize, 0);
assign2 = BackendDAETransform.assignmentsCreate(nvars, memsize, 0);
assign1 = BackendDAETransform.assignmentsCreate(nvars, memsize, 0);
assign2 = BackendDAETransform.assignmentsCreate(nvars, memsize, 0);
// try matching
BackendDAETransform.checkMatching(dlow_1, (BackendDAE.NO_INDEX_REDUCTION(), BackendDAE.EXACT(), BackendDAE.KEEP_SIMPLE_EQN()));
BackendDAETransform.checkMatching(dlow_1, (BackendDAE.NO_INDEX_REDUCTION(), BackendDAE.EXACT(), BackendDAE.KEEP_SIMPLE_EQN()));
Debug.fcall("tearingdump", BackendDump.dumpIncidenceMatrix, m_1);
Debug.fcall("tearingdump", BackendDump.dumpIncidenceMatrixT, mT_1);
Debug.fcall("tearingdump", BackendDump.dump, dlow_1);
(ass1,ass2,dlow_2,m_2,mT_2,_,_) = BackendDAETransform.matchingAlgorithm2(dlow_1, m_1, mT_1, nvars, neqns, 1, assign1, assign2, (BackendDAE.NO_INDEX_REDUCTION(), BackendDAE.EXACT(), BackendDAE.KEEP_SIMPLE_EQN()),DAEUtil.avlTreeNew(),{},{});
v1_1 = BackendDAETransform.assignmentsVector(ass1);
v2_1 = BackendDAETransform.assignmentsVector(ass2);
(ass1,ass2,dlow_2,m_2,mT_2,_,_) = BackendDAETransform.matchingAlgorithm2(dlow_1, m_1, mT_1, nvars, neqns, 1, assign1, assign2, (BackendDAE.NO_INDEX_REDUCTION(), BackendDAE.EXACT(), BackendDAE.KEEP_SIMPLE_EQN()),DAEUtil.avlTreeNew(),{},{});
v1_1 = BackendDAETransform.assignmentsVector(ass1);
v2_1 = BackendDAETransform.assignmentsVector(ass2);
(comps) = BackendDAETransform.strongComponents(m_2, mT_2, v1_1, v2_1);
Debug.fcall("tearingdump", BackendDump.dumpMatching, v1_1);
Debug.fcall("tearingdump", BackendDump.dumpComponents, comps);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDAETransform.mo
Expand Up @@ -30,7 +30,7 @@
*/

package BackendDAETransform
" file: BackendDAETransform.mo
" file: BackendDAETransform.mo
package: BackendDAETransform
description: BackendDAETransform contains functions that are needed to perform
a transformation to a Block-Lower-Triangular-DAE.
Expand Down
96 changes: 48 additions & 48 deletions Compiler/BackEnd/BackendDAEUtil.mo
Expand Up @@ -30,7 +30,7 @@
*/

package BackendDAEUtil
" file: BackendDAEUtil.mo
" file: BackendDAEUtil.mo
package: BackendDAEUtil
description: BackendDAEUtil comprised functions for BackendDAE data types.

Expand Down Expand Up @@ -192,24 +192,24 @@ algorithm
end checkBackendDAEExp;

protected function traversecheckBackendDAEExp
input tuple<DAE.Exp, tuple<BackendDAE.Variables,list<DAE.ComponentRef>>> inTuple;
output tuple<DAE.Exp, tuple<BackendDAE.Variables,list<DAE.ComponentRef>>> outTuple;
algorithm
outTuple := matchcontinue(inTuple)
local
DAE.Exp e;
BackendDAE.Variables vars,vars1;
DAE.ComponentRef cr;
list<DAE.ComponentRef> crefs,crefs1;
list<DAE.Exp> expl;
list<DAE.ExpVar> varLst;
DAE.Ident ident;
BackendDAE.Var backendVar;

// special case for time, it is never part of the equation system
case ((e as DAE.CREF(componentRef = DAE.CREF_IDENT(ident="time")),(vars,crefs)))
then ((e, (vars,crefs)));
input tuple<DAE.Exp, tuple<BackendDAE.Variables,list<DAE.ComponentRef>>> inTuple;
output tuple<DAE.Exp, tuple<BackendDAE.Variables,list<DAE.ComponentRef>>> outTuple;
algorithm
outTuple := matchcontinue(inTuple)
local
DAE.Exp e;
BackendDAE.Variables vars,vars1;
DAE.ComponentRef cr;
list<DAE.ComponentRef> crefs,crefs1;
list<DAE.Exp> expl;
list<DAE.ExpVar> varLst;
DAE.Ident ident;
BackendDAE.Var backendVar;

// special case for time, it is never part of the equation system
case ((e as DAE.CREF(componentRef = DAE.CREF_IDENT(ident="time")),(vars,crefs)))
then ((e, (vars,crefs)));

// Special Case for Records
case ((e as DAE.CREF(componentRef = cr,ty= DAE.ET_COMPLEX(varLst=varLst,complexClassType=ClassInf.RECORD(_))),(vars,crefs)))
Expand All @@ -220,35 +220,35 @@ algorithm
((e, (vars1,crefs1)));

// case for Reductions
case ((e as DAE.REDUCTION(ident = ident),(vars,crefs)))
equation
// add ident to vars
cr = ComponentReference.makeCrefIdent(ident,DAE.ET_INT(),{});
backendVar = BackendDAE.VAR(cr,BackendDAE.VARIABLE(),DAE.BIDIR(),BackendDAE.INT(),NONE(),NONE(),{},0,
DAE.emptyElementSource,NONE(),NONE(),DAE.NON_CONNECTOR(),DAE.NON_STREAM_CONNECTOR());
vars = BackendVariable.addVar(backendVar,vars);
then
((e, (vars,crefs)));
// case for functionpointers
case ((e as DAE.CREF(ty=DAE.ET_FUNCTION_REFERENCE_FUNC(builtin=_)),(vars,crefs)))
then
((e, (vars,crefs)));
case ((e as DAE.CREF(componentRef = cr),(vars,crefs)))
equation
(_,_) = BackendVariable.getVar(cr, vars);
then
((e, (vars,crefs)));
case ((e as DAE.CREF(componentRef = cr),(vars,crefs)))
equation
failure((_,_) = BackendVariable.getVar(cr, vars));
then
((e, (vars,cr::crefs)));
case inTuple then inTuple;
end matchcontinue;
case ((e as DAE.REDUCTION(ident = ident),(vars,crefs)))
equation
// add ident to vars
cr = ComponentReference.makeCrefIdent(ident,DAE.ET_INT(),{});
backendVar = BackendDAE.VAR(cr,BackendDAE.VARIABLE(),DAE.BIDIR(),BackendDAE.INT(),NONE(),NONE(),{},0,
DAE.emptyElementSource,NONE(),NONE(),DAE.NON_CONNECTOR(),DAE.NON_STREAM_CONNECTOR());
vars = BackendVariable.addVar(backendVar,vars);
then
((e, (vars,crefs)));
// case for functionpointers
case ((e as DAE.CREF(ty=DAE.ET_FUNCTION_REFERENCE_FUNC(builtin=_)),(vars,crefs)))
then
((e, (vars,crefs)));
case ((e as DAE.CREF(componentRef = cr),(vars,crefs)))
equation
(_,_) = BackendVariable.getVar(cr, vars);
then
((e, (vars,crefs)));
case ((e as DAE.CREF(componentRef = cr),(vars,crefs)))
equation
failure((_,_) = BackendVariable.getVar(cr, vars));
then
((e, (vars,cr::crefs)));
case inTuple then inTuple;
end matchcontinue;
end traversecheckBackendDAEExp;

/*************************************************
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendEquation.mo
Expand Up @@ -30,7 +30,7 @@
*/

package BackendEquation
" file: BackendEquation.mo
" file: BackendEquation.mo
package: BackendEquation
description: BackendEquation contains functions that do something with
BackendDAEEquation datatype.
Expand Down
10 changes: 5 additions & 5 deletions Compiler/BackEnd/BackendVariable.mo
Expand Up @@ -30,10 +30,10 @@
*/

package BackendVariable
" file: mo
" file: mo
package: BackendVariable
description: BackendVariables contains the function that deals with the datytypes
BackendDAE.VAR BackendDAE.Variables and BackendVariablesArray.
BackendDAE.VAR BackendDAE.Variables and BackendVariablesArray.
RCS: $Id$
"
Expand Down Expand Up @@ -499,9 +499,9 @@ algorithm
outBoolean:=
matchcontinue (inVar)
case (inVar)
equation
equation
failIfNonState(inVar);
then true;
then true;
case (_) then false;
end matchcontinue;
end isNonStateVar;
Expand Down Expand Up @@ -535,7 +535,7 @@ end isDummyStateVar;

public function isVarDiscrete
" This functions checks if BackendDAE.Var is discrete"
input BackendDAE.Var inVar;
input BackendDAE.Var inVar;
output Boolean outBoolean;
algorithm
outBoolean :=
Expand Down
14 changes: 7 additions & 7 deletions Compiler/BackEnd/DAEQuery.mo
Expand Up @@ -30,7 +30,7 @@
*/

package DAEQuery
" file: DAEQuery.mo
" file: DAEQuery.mo
package: DAEQuery
description: DAEQuery contains functionality for query of Incidence Matrix.

Expand Down Expand Up @@ -600,10 +600,10 @@ algorithm
res;

// ALGORITHM For now assume that algorithm will be solvable for correct
// variables. I.e. find all variables in algorithm and add to lst.
// If algorithm later on needs to be inverted, i.e. solved for
// different variables than calculated, a non linear solver or
// analysis of algorithm itself needs to be implemented.
// variables. I.e. find all variables in algorithm and add to lst.
// If algorithm later on needs to be inverted, i.e. solved for
// different variables than calculated, a non linear solver or
// analysis of algorithm itself needs to be implemented.
case (vars,BackendDAE.ALGORITHM(index = indx,in_ = inputs,out = outputs))
equation
lstlst1 = Util.listMap1(inputs, incidenceRowExp, vars);
Expand Down Expand Up @@ -728,8 +728,8 @@ algorithm
equation
((BackendDAE.VAR(varKind = BackendDAE.STATE()) :: _),p) =
BackendVariable.getVar(cr, vars) "If variable x is a state, der(x) is a variable in incidence matrix,
x is inserted as negative value, since it is needed by debugging and index
reduction using dummy derivatives" ;
x is inserted as negative value, since it is needed by debugging and index
reduction using dummy derivatives" ;
p_1 = Util.listMap1r(p, intSub, 0);
pStr = Util.listMap(p_1, intString);
then
Expand Down
26 changes: 13 additions & 13 deletions Compiler/BackEnd/Derive.mo
Expand Up @@ -1220,7 +1220,7 @@ algorithm
DAE.Operator op;
String e_str,s,s2,str;
list<DAE.Exp> expl_1,expl,sub;
list<Boolean> bLst;
list<Boolean> bLst;

case (DAE.ICONST(integer = _),_,_) then DAE.RCONST(0.0);

Expand Down Expand Up @@ -1294,7 +1294,7 @@ algorithm
true = Expression.expContains(e2,Expression.makeCrefExp(tv,tp));
d_e2 = differentiateExp(e2, tv, differentiateIfExp);
exp = DAE.BINARY(d_e2,DAE.MUL(tp),
DAE.BINARY(e,DAE.MUL(tp),DAE.CALL(Absyn.IDENT("log"),{e1},false,true,tp,DAE.NO_INLINE()))
DAE.BINARY(e,DAE.MUL(tp),DAE.CALL(Absyn.IDENT("log"),{e1},false,true,tp,DAE.NO_INLINE()))
);
then
exp;
Expand Down Expand Up @@ -1329,9 +1329,9 @@ algorithm
then
DAE.BINARY(
DAE.BINARY(
DAE.BINARY(e1_1,DAE.MUL(tp),e2),
DAE.SUB(tp),
DAE.BINARY(e1,DAE.MUL(tp),e2_1)),
DAE.BINARY(e1_1,DAE.MUL(tp),e2),
DAE.SUB(tp),
DAE.BINARY(e1,DAE.MUL(tp),e2_1)),
DAE.DIV(tp),
DAE.BINARY(e2,DAE.MUL(tp),e2));

Expand Down Expand Up @@ -1510,7 +1510,7 @@ algorithm
DAE.RCONST(rval);

// derivative of arbitrary function, not dependent of variable, i.e. constant
case (DAE.CALL(fname,expl,b,c,tp,inl),tv,differentiateIfExp)
case (DAE.CALL(fname,expl,b,c,tp,inl),tv,differentiateIfExp)
equation
bLst = Util.listMap1(expl,Expression.expContains, Expression.crefExp(tv));
false = Util.listReduce(bLst,boolOr);
Expand Down Expand Up @@ -1541,8 +1541,8 @@ algorithm
e2_1 = differentiateExp(e2, tv, differentiateIfExp);
then
DAE.RELATION(e1_1,rel,e2_1);
*/
*/
// der(x)
case (DAE.CALL(path = (a as Absyn.IDENT(name = "der")),expLst =
{(exp as DAE.CREF(componentRef = cr))},tuple_ = b,builtin = c,ty=tp,inlineType=inl),tv,differentiateIfExp)
Expand Down Expand Up @@ -1594,11 +1594,11 @@ algorithm
equation
false = Expression.expContains(e, Expression.crefExp(cr))
"If the expression does not contain the variable,
the derivative is zero. For efficiency reasons this rule
is last. Otherwise expressions is allways traversed twice
when differentiating." ;
the derivative is zero. For efficiency reasons this rule
is last. Otherwise expressions is allways traversed twice
when differentiating." ;
tp = Expression.typeof(e);
(zero,_) = Expression.makeZeroExpression(Expression.arrayDimension(tp));
(zero,_) = Expression.makeZeroExpression(Expression.arrayDimension(tp));
then
zero;

Expand All @@ -1612,7 +1612,7 @@ algorithm

case (e,cr,differentiateIfExp)
equation
true = RTOpts.debugFlag("failtrace");
true = RTOpts.debugFlag("failtrace");
s = ExpressionDump.printExpStr(e);
s2 = ComponentReference.printComponentRefStr(cr);
str = stringAppendList({"- Derive.differentiateExp ",s," w.r.t: ",s2," failed\n"});
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/ExpressionSolve.mo
Expand Up @@ -31,7 +31,7 @@

package ExpressionSolve
"
file: ExpressionSolve.mo
file: ExpressionSolve.mo
package: ExpressionSolve
description: ExpressionSolve

Expand Down

0 comments on commit 441450c

Please sign in to comment.