Skip to content

Commit 79c4c23

Browse files
[Janitor mode] Fix whitespace
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20620 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 276403a commit 79c4c23

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

Compiler/BackEnd/Differentiate.mo

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ algorithm
665665

666666
(res, functionTree) = differentiateCrefs(e, inDiffwrtCref, inInputData, inDiffType, inFunctionTree);
667667
(res,_) = ExpressionSimplify.simplify1(res);
668-
668+
669669
//se1 = ExpressionDump.printExpStr(res);
670670
//print("\nresults to exp: " +& se1);
671671
then (res, functionTree);
@@ -2146,9 +2146,9 @@ algorithm
21462146
(outDiffedExp, outFunctionTree) :=
21472147
matchcontinue(inExp, inDiffwrtCref, inInputData, inDiffType, inFunctionTree)
21482148
local
2149-
2149+
21502150
BackendDAE.DifferentiateInputData inputData, diffFuncData;
2151-
2151+
21522152
DAE.Exp e, zero, ezero;
21532153
list<DAE.Exp> expl,expl1,dexpl,dexplZero;
21542154
BackendDAE.Variables timevars;
@@ -2165,13 +2165,13 @@ algorithm
21652165
String typstring, dastring, funstring, str;
21662166
list<String> typlststring;
21672167
DAE.TailCall tc;
2168-
2168+
21692169
list<DAE.Element> funcbody, funcbodyDer;
21702170
list<DAE.Element> inputVars, inputVarsNoDer, inputVarsDer;
21712171
list<DAE.Element> outputVars, outputVarsNoDer, outputVarsDer;
21722172
list<DAE.Element> protectedVars, protectedVarsNoDer, protectedVarsDer, newProtectedVars;
21732173
list<DAE.Statement> bodyStmts, derbodyStmts;
2174-
2174+
21752175
DAE.FunctionDefinition derfuncdef;
21762176
DAE.Function func,dfunc;
21772177
list<DAE.Function> fns;
@@ -2187,7 +2187,7 @@ algorithm
21872187
(mapper, tp) = getFunctionMapper(path, inFunctionTree);
21882188
(dpath, blst) = differentiateFunction1(path,mapper, tp, expl, (inDiffwrtCref, inInputData, inDiffType, inFunctionTree));
21892189
SOME(DAE.FUNCTION(type_=dtp,inlineType=dinl)) = DAEUtil.avlTreeGet(inFunctionTree, dpath);
2190-
// check if derivativ function has all expected inputs
2190+
// check if derivativ function has all expected inputs
21912191
(true,_) = checkDerivativeFunctionInputs(blst, tp, dtp);
21922192
(expl1,_) = List.splitOnBoolList(expl, blst);
21932193
(dexpl, functions) = List.map3Fold(expl1, differentiateExp, inDiffwrtCref, inInputData, inDiffType, inFunctionTree);
@@ -2197,7 +2197,7 @@ algorithm
21972197
//dexpl = listAppend(expl, dexpl);
21982198
//print("Start creation of partial Der\n");
21992199
//print("Diffed ExpList: \n");
2200-
//print(stringDelimitList(List.map(dexpl, ExpressionDump.printExpStr), ", ") +& "\n");
2200+
//print(stringDelimitList(List.map(dexpl, ExpressionDump.printExpStr), ", ") +& "\n");
22012201
e = DAE.CALL(dpath,expl1,DAE.CALL_ATTR(ty,b,c,isImpure,dinl,tc));
22022202
e = createPartialArguments(ty, dexpl, dexplZero, expl, e);
22032203
then
@@ -2206,11 +2206,11 @@ algorithm
22062206
case (DAE.CALL(path=path,expLst=expl), _, _, _, _)
22072207
equation
22082208
// get function mapper
2209-
//print("Search for function mapper2\n");
2209+
//print("Search for function mapper2\n");
22102210
(mapper, tp) = getFunctionMapper(path, inFunctionTree);
22112211
(dpath, blst) = differentiateFunction1(path, mapper, tp, expl, (inDiffwrtCref, inInputData, inDiffType, inFunctionTree));
22122212
SOME(DAE.FUNCTION(type_=dtp,inlineType=dinl)) = DAEUtil.avlTreeGet(inFunctionTree, dpath);
2213-
// check if derivativ function has all expected inputs
2213+
// check if derivativ function has all expected inputs
22142214
(false, tlst) = checkDerivativeFunctionInputs(blst, tp, dtp);
22152215
// add Warning
22162216
typlststring = List.map(tlst, Types.unparseType);
@@ -2224,22 +2224,22 @@ algorithm
22242224
// differentiate function
22252225
case (e as DAE.CALL(path=path,expLst=expl,attr=DAE.CALL_ATTR(tuple_=b,builtin=false,isImpure=isImpure,ty=ty,tailCall=tc)), _, _, _, _)
22262226
equation
2227-
// TODO: FIXIT! expressionSolve and analyticJacobian don't
2227+
// TODO: FIXIT! expressionSolve and analyticJacobian don't
22282228
// return new functionTree, so we can't differentiate functions then.
22292229
failure(BackendDAE.SIMPLE_DIFFERENTAION() = inDiffType);
22302230
failure(BackendDAE.DIFF_FULL_JACOBIAN() = inDiffType);
2231-
2231+
22322232
// get algorithm of the function
22332233
SOME(func) = DAEUtil.avlTreeGet(inFunctionTree,path);
2234-
2234+
22352235
// differentiate function
22362236
(dfunc, functions, blst) = differentiatePartialFunction(func, inDiffwrtCref, NONE(), inInputData, inDiffType, inFunctionTree);
22372237

22382238
dpath = DAEUtil.functionName(dfunc);
22392239
// debug
22402240
//funstring = Tpl.tplString(DAEDumpTpl.dumpFunction, dfunc);
22412241
//print("\n\nDER.Function: \n" +& funstring +& "\n\n");
2242-
2242+
22432243
functions = DAEUtil.addDaeFunction({dfunc}, functions);
22442244
// add differentiated function as function mapper
22452245
func = DAEUtil.addFunctionDefinition(func, DAE.FUNCTION_DER_MAPPER(path, dpath, 1, {}, NONE(), {}));
@@ -2253,8 +2253,8 @@ algorithm
22532253
//print(stringDelimitList(List.map(expl, ExpressionDump.printExpStr), ", ") +& "\n");
22542254
//print("Diff ExpList Types: \n");
22552255
//print(stringDelimitList(List.map(List.map(expl, Expression.typeof), Types.printTypeStr), " | ") +& "\n");
2256-
2257-
2256+
2257+
22582258
// create differentiated call arguments
22592259
expBoolLst = List.threadTuple(expl, blst);
22602260
expBoolLst = List.filterOnTrue(expBoolLst, Util.tuple22);
@@ -2268,19 +2268,19 @@ algorithm
22682268
//print(" output Type: " +& Types.printTypeStr(ty) +& "\n");
22692269
e = DAE.CALL(dpath,dexpl,DAE.CALL_ATTR(ty,b,false,isImpure,DAE.NO_INLINE(),tc));
22702270
e = createPartialArguments(ty, dexpl, dexplZero, expl, e);
2271-
2271+
22722272
// debug
22732273
//print("Finished differentiate Expression in Call.\n");
22742274
//print("DER.Function call : \n" +& ExpressionDump.printExpStr(e) +& "\n");
2275-
2275+
22762276
then
22772277
(e, functions);
2278-
2278+
22792279
else
22802280
equation
22812281
str = "Differentiate.differentiateFunctionCallPartial failed for " +& ExpressionDump.printExpStr(inExp) +& "\n";
22822282
Debug.fprint(Flags.FAILTRACE, str);
2283-
then fail();
2283+
then fail();
22842284
end matchcontinue;
22852285
end differentiateFunctionCallPartial;
22862286

@@ -2471,7 +2471,7 @@ algorithm
24712471
DAE.Function dfunc;
24722472
Absyn.Path path, dpath;
24732473
String str;
2474-
2474+
24752475
case (_, {}, _, _, _, _) then (inFunction, inFunctionTree);
24762476

24772477
// differentiate functions
@@ -2542,7 +2542,7 @@ algorithm
25422542
outputVars = DAEUtil.getFunctionOutputVars(func);
25432543
protectedVars = DAEUtil.getFunctionProtectedVars(func);
25442544
bodyStmts = DAEUtil.getFunctionAlgorithmStmts(func);
2545-
2545+
25462546
path = DAEUtil.functionName(func);
25472547
funcname = Util.modelicaStringToCStr(Absyn.pathString(path), false);
25482548
diffFuncData = BackendDAE.DIFFINPUTDATA(NONE(),NONE(),NONE(),NONE(),NONE(),NONE(),SOME(funcname));
@@ -2558,29 +2558,29 @@ algorithm
25582558

25592559
//add protected variables to dependent Vars
25602560
(inputData,_) = addElementVars2Dep(protectedVarsNoDer, functions, inputData);
2561-
2561+
25622562
// differentiate algorithm statemeants
25632563
//print("Function diff: statemeants");
25642564
(derbodyStmts, functions) = differentiateStatements(listReverse(bodyStmts), inDiffwrtCref, inputData, BackendDAE.DIFFERENTAION_FUNCTION(), {}, functions);
25652565

25662566
// create function and add it to function tree
25672567
dpath = Util.getOptionOrDefault(dpathOption, Absyn.stringPath("$DER" +& funcname));
2568-
2568+
25692569
tp = DAEUtil.getFunctionType(func);
25702570
dtp = Types.extendsFunctionTypeArgs(tp, inputVarsDer, blst);
2571-
2571+
25722572
inputVars = listAppend(inputVars, inputVarsDer);
25732573
protectedVars = listAppend(protectedVars, protectedVarsDer);
25742574
funcbodyDer = listAppend(inputVars, outputVarsDer);
25752575
funcbodyDer = listAppend(funcbodyDer, protectedVars);
2576-
2576+
25772577
//change output vars to protected vars and direction bidir
25782578
newProtectedVars = List.map1(outputVars, DAEUtil.setElementVarVisibility, DAE.PROTECTED());
25792579
newProtectedVars = List.map1(newProtectedVars, DAEUtil.setElementVarDirection, DAE.BIDIR());
25802580
funcbodyDer = listAppend(funcbodyDer, newProtectedVars);
2581-
2581+
25822582
funcbodyDer = listAppend(funcbodyDer, {DAE.ALGORITHM(DAE.ALGORITHM_STMTS(derbodyStmts), DAE.emptyElementSource)});
2583-
2583+
25842584
isImpure = DAEUtil.getFunctionImpureAttribute(func);
25852585
dinl = DAEUtil.getFunctionInlineType(func);
25862586
dfunc = DAE.FUNCTION(dpath, {DAE.FUNCTION_DEF(funcbodyDer)}, dtp, false, isImpure, dinl, DAE.emptyElementSource, NONE());

0 commit comments

Comments
 (0)