Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- genMain :: OOProg r => GenState (SFile r)
- genMainFunc :: OOProg r => GenState (Maybe (SMethod r))
- chooseInModule :: OOProg r => InputModule -> GenState [SFile r]
- genInputClass :: OOProg r => ClassType -> GenState (Maybe (SClass r))
- genInputDerived :: OOProg r => ScopeTag -> GenState (Maybe (SMethod r))
- genInputConstraints :: OOProg r => ScopeTag -> GenState (Maybe (SMethod r))
- genInputFormat :: OOProg r => ScopeTag -> GenState (Maybe (SMethod r))
- genConstMod :: OOProg r => GenState [SFile r]
- genConstClass :: OOProg r => ClassType -> GenState (Maybe (SClass r))
- genCalcMod :: OOProg r => GenState (SFile r)
- genCalcFunc :: OOProg r => CodeDefinition -> GenState (SMethod r)
- genOutputMod :: OOProg r => GenState [SFile r]
- genOutputFormat :: OOProg r => GenState (Maybe (SMethod r))
- genSampleInput :: AuxiliarySym r => GenState (Maybe (r (Auxiliary r)))
Documentation
genMainFunc :: OOProg r => GenState (Maybe (SMethod r)) Source #
Generates a main function, to act as the controller for an SCS program. The controller declares input and constant variables, then calls the functions for reading input values, calculating derived inputs, checking constraints, calculating outputs, and printing outputs. Returns Nothing if the user chose to generate a library.
chooseInModule :: OOProg r => InputModule -> GenState [SFile r] Source #
Generates either a single module containing all input-related components, or separate modules for each input-related component, depending on the user's modularity choice.
genInputClass :: OOProg r => ClassType -> GenState (Maybe (SClass r)) Source #
Returns Nothing
if no inputs or constants are mapped to InputParameters in
the class definition map.
If any inputs or constants are defined in InputParameters, this generates
the InputParameters class containing the inputs and constants as state
variables. If the InputParameters constructor is also exported, then the
generated class also contains the input-related functions as private methods.
genInputDerived :: OOProg r => ScopeTag -> GenState (Maybe (SMethod r)) Source #
Generates a function for calculating derived inputs.
genInputConstraints :: OOProg r => ScopeTag -> GenState (Maybe (SMethod r)) Source #
Generates function that checks constraints on the input.
genInputFormat :: OOProg r => ScopeTag -> GenState (Maybe (SMethod r)) Source #
| Generates a function for reading inputs from a file.
genConstMod :: OOProg r => GenState [SFile r] Source #
Generates a module containing the class where constants are stored.
genConstClass :: OOProg r => ClassType -> GenState (Maybe (SClass r)) Source #
Generates a class to store constants, if constants are mapped to the Constants class in the class definition map, otherwise returns Nothing.
genCalcMod :: OOProg r => GenState (SFile r) Source #
Generates a module containing calculation functions.
genCalcFunc :: OOProg r => CodeDefinition -> GenState (SMethod r) Source #
Generates a calculation function corresponding to the CodeDefinition
.
For solving ODEs, the ExtLibState
containing the information needed to
generate code is found by looking it up in the external library map.
genOutputMod :: OOProg r => GenState [SFile r] Source #
Generates a module containing the function for printing outputs.
genOutputFormat :: OOProg r => GenState (Maybe (SMethod r)) Source #
Generates a function for printing output values.
genSampleInput :: AuxiliarySym r => GenState (Maybe (r (Auxiliary r))) Source #
Generates a sample input file compatible with the generated program, if the user chose to.