Changeset e668b3ca in OpenModelica
- Timestamp:
- 2022-05-17T20:22:52+02:00 (2 years ago)
- Children:
- 9d6e2961
- Parents:
- ed50d7d
- git-author:
- perost <perost86@…> (05/09/22 11:54:20)
- git-committer:
- kabdelhak <karim.abdelhak@…> (05/17/22 20:22:52)
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
OMCompiler/Compiler/NFFrontEnd/NFSimplifyExp.mo
rca7559a re668b3ca 253 253 case "fill" then simplifyFill(listHead(args), listRest(args), call); 254 254 case "homotopy" then simplifyHomotopy(args, call); 255 case "max" guard listLength(args) == 1 then simplifyReducedArrayConstructor(listHead(args), call);256 case "min" guard listLength(args) == 1 then simplifyReducedArrayConstructor(listHead(args), call);255 case "max" then simplifyMinMax(args, call, isMin = false); 256 case "min" then simplifyMinMax(args, call, isMin = true); 257 257 case "ones" then simplifyFill(Expression.INTEGER(1), args, call); 258 258 case "product" then simplifySumProduct(listHead(args), call, isSum = false); … … 265 265 end match; 266 266 end simplifyBuiltinCall; 267 268 function simplifyMinMax 269 input list<Expression> args; 270 input Call call; 271 input Boolean isMin; 272 output Expression exp; 273 protected 274 Expression arg; 275 Type ty; 276 algorithm 277 if listLength(args) == 1 then 278 arg := listHead(args); 279 ty := Expression.typeOf(arg); 280 281 if Type.isEmptyArray(ty) then 282 ty := Type.arrayElementType(ty); 283 exp := if isMin then Expression.makeMaxValue(ty) else 284 Expression.makeMinValue(ty); 285 else 286 exp := simplifyReducedArrayConstructor(arg, call); 287 end if; 288 else 289 exp := Expression.CALL(call); 290 end if; 291 end simplifyMinMax; 267 292 268 293 function simplifySumProduct -
testsuite/flattening/modelica/scodeinst/Makefile
r0f91fa08 re668b3ca 525 525 FuncBuiltinMatrixWrongType1.mo \ 526 526 FuncBuiltinMax.mo \ 527 FuncBuiltinMax2.mo \ 527 528 FuncBuiltinMin.mo \ 529 FuncBuiltinMin2.mo \ 528 530 FuncBuiltinMod.mo \ 529 531 FuncBuiltinNdims.mo \
Note: See TracChangeset
for help on using the changeset viewer.