Math2mat
Public Member Functions | Protected Member Functions | Protected Attributes

m2m.backend.structure.Function Class Reference

Inheritance diagram for m2m.backend.structure.Function:
Inheritance graph
[legend]
Collaboration diagram for m2m.backend.structure.Function:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Function ()
void modifyNumType (BuildingBlock.NumType type)
String getXmlTagName ()
boolean fromXml (org.w3c.dom.Element el)
boolean insideFromXml (org.w3c.dom.Element el, Function newFunc)
void superInsideToXml (org.w3c.dom.Element el, Document dom, boolean shortRef)
void insideToXml (org.w3c.dom.Element el, Document dom, boolean shortRef)
Element copy (Function newFunc)
void copyTo (Element to, Function newFunc)
Element findElement (String name)
void modifAllNames (String prefix)
void addInput (Element var)
void setInput (Vector< Element > in)
Vector< ElementgetInput ()
void addOutput (Element var)
void setOutput (Vector< Element > out)
Vector< ElementgetOutput ()
void addInternalVar (Element var)
void setInternalVars (Vector< Element > list)
Vector< ElementgetInternalVars ()
Vector< ElementgetMonitoringElement ()
void addBody (Element el)
void addBody (Vector< Element > vec)
void addBodyToTop (Element el)
void setBody (Vector< Element > body)
Vector< ElementgetBody ()
String toString (int level)
String toSchematic (int level, String prefix, String boxFormat, String color)
String toOctave (int level)
boolean isInput (Element element)
boolean containsOuputName (String name)
boolean containsInputName (String name)
void setMaxCost (int cost)
int getMaxCost ()
void setRelativeMaxCost ()
int getRelativeMaxCost ()

Protected Member Functions

String toStringParam (int level)

Protected Attributes

Vector< ElementinputVars
Vector< ElementoutputVars
Vector< ElementinternalVars
Vector< Elementbody
int maxCost
int maxRelativeCost

Detailed Description

Describe a function. Contains inputs, outputs, temp variables and a body.

Author:
Trolliet Gregory
gregory.trolliet@hesge.ch
Version:
0.1

Definition at line 27 of file Function.java.


Constructor & Destructor Documentation

m2m.backend.structure.Function.Function ( )

Construct an empty function

Definition at line 57 of file Function.java.


Member Function Documentation

void m2m.backend.structure.Function.addBody ( Element  el)

Add an element to the body

Parameters:
elElement to add

Definition at line 367 of file Function.java.

void m2m.backend.structure.Function.addBody ( Vector< Element vec)

Add a vector of Element to the body

Parameters:
vecVector of Element to add

Definition at line 375 of file Function.java.

void m2m.backend.structure.Function.addBodyToTop ( Element  el)

Add an element to the top of the body

Parameters:
elElement to add

Definition at line 383 of file Function.java.

void m2m.backend.structure.Function.addInput ( Element  var)

Add variable to input

Parameters:
varVariable

Definition at line 253 of file Function.java.

void m2m.backend.structure.Function.addInternalVar ( Element  var)

Add a variable to the internal variables list

Parameters:
varVariable

Definition at line 301 of file Function.java.

void m2m.backend.structure.Function.addOutput ( Element  var)

Add variable to output

Parameters:
varVariable

Definition at line 277 of file Function.java.

boolean m2m.backend.structure.Function.containsInputName ( String  name)

Check if a variable name is an input name.

Parameters:
namethe string to check
Returns:
if a string is an input name

Definition at line 590 of file Function.java.

boolean m2m.backend.structure.Function.containsOuputName ( String  name)

Check if a string is an output name.

Parameters:
namethe string to check
Returns:
if a string is an output name

Definition at line 575 of file Function.java.

Element m2m.backend.structure.Function.copy ( Function  newFunc) [virtual]

Copy entirely the function.

Returns:
The new function.

Implements m2m.backend.structure.Element.

Reimplemented in m2m.backend.structure.IfThenElse, and m2m.backend.structure.LoopFor.

Definition at line 199 of file Function.java.

void m2m.backend.structure.Function.copyTo ( Element  to,
Function  newFunc 
)

Reimplemented from m2m.backend.structure.Element.

Definition at line 205 of file Function.java.

Element m2m.backend.structure.Function.findElement ( String  name)

Reimplemented from m2m.backend.structure.Element.

Definition at line 219 of file Function.java.

boolean m2m.backend.structure.Function.fromXml ( org.w3c.dom.Element  el)

Definition at line 74 of file Function.java.

Vector<Element> m2m.backend.structure.Function.getBody ( )

Get the body element list

Returns:
Element list

Definition at line 399 of file Function.java.

Vector<Element> m2m.backend.structure.Function.getInput ( )

Get the input variable list

Returns:
Variable list

Definition at line 269 of file Function.java.

Vector<Element> m2m.backend.structure.Function.getInternalVars ( )

Get the internal variable list

Returns:
List of the internal variables

Definition at line 317 of file Function.java.

int m2m.backend.structure.Function.getMaxCost ( )

Get the maximum cost of the function.

Returns:
the maximum cost of the function

Definition at line 613 of file Function.java.

Vector<Element> m2m.backend.structure.Function.getMonitoringElement ( )

Get the all the variables that should be monitored

Returns:
all monitored variables

Definition at line 325 of file Function.java.

Vector<Element> m2m.backend.structure.Function.getOutput ( )

Get the output variable list

Returns:
Variable list

Definition at line 293 of file Function.java.

int m2m.backend.structure.Function.getRelativeMaxCost ( )

Get the maximum relative cost of the function.

Returns:
the maximum relative cost of the function

Definition at line 635 of file Function.java.

String m2m.backend.structure.Function.getXmlTagName ( ) [virtual]
boolean m2m.backend.structure.Function.insideFromXml ( org.w3c.dom.Element  el,
Function  newFunc 
)
void m2m.backend.structure.Function.insideToXml ( org.w3c.dom.Element  el,
Document  dom,
boolean  shortRef 
)
boolean m2m.backend.structure.Function.isInput ( Element  element)

Check if an element is an input of the function

Parameters:
elementthe element to check
Returns:
if an element is an input of the function

Definition at line 556 of file Function.java.

void m2m.backend.structure.Function.modifAllNames ( String  prefix)

Definition at line 235 of file Function.java.

void m2m.backend.structure.Function.modifyNumType ( BuildingBlock.NumType  type)

Reimplemented from m2m.backend.structure.Element.

Reimplemented in m2m.backend.structure.IfThenElse, and m2m.backend.structure.Switch.

Definition at line 64 of file Function.java.

void m2m.backend.structure.Function.setBody ( Vector< Element body)

Set a new body element list

Parameters:
bodyElement list

Definition at line 391 of file Function.java.

void m2m.backend.structure.Function.setInput ( Vector< Element in)

Set a new input variable list

Parameters:
inVariable list

Definition at line 261 of file Function.java.

void m2m.backend.structure.Function.setInternalVars ( Vector< Element list)

Set a new internal variable list

Parameters:
statVariable list

Definition at line 309 of file Function.java.

void m2m.backend.structure.Function.setMaxCost ( int  cost)

Set the maximum cost of the function.

Parameters:
costthe maximum cost to set to the function

Definition at line 604 of file Function.java.

void m2m.backend.structure.Function.setOutput ( Vector< Element out)

Set a new output variable list

Parameters:
outVariable list

Definition at line 285 of file Function.java.

void m2m.backend.structure.Function.setRelativeMaxCost ( )

Set the maximum relative cost of the function.

Parameters:
costthe maximum relative cost to set to the function

Definition at line 622 of file Function.java.

void m2m.backend.structure.Function.superInsideToXml ( org.w3c.dom.Element  el,
Document  dom,
boolean  shortRef 
)

Definition at line 166 of file Function.java.

String m2m.backend.structure.Function.toOctave ( int  level)

Generate the octave code for the element

Parameters:
levelIndent level
Returns:
Octave code

Reimplemented from m2m.backend.structure.Element.

Reimplemented in m2m.backend.structure.IfThenElse, m2m.backend.structure.LoopFor, and m2m.backend.structure.LoopWhile.

Definition at line 508 of file Function.java.

String m2m.backend.structure.Function.toSchematic ( int  level,
String  prefix,
String  boxFormat,
String  color 
)

Create the schematic file, use with graphviz to generate schematic

Parameters:
levelLevel of tab
prefixPrefix for the element name
boxFormatFormat of box (rectangle, triangle, ...)
colorColor of the block
Returns:
Generate string

Reimplemented from m2m.backend.structure.Element.

Reimplemented in m2m.backend.structure.IfThenElse, m2m.backend.structure.LoopFor, m2m.backend.structure.LoopWhile, and m2m.backend.structure.Switch.

Definition at line 454 of file Function.java.

String m2m.backend.structure.Function.toString ( int  level)

Convert the object to a string that contains all the parametres

Parameters:
levelIndent of the string
Returns:
String

Reimplemented from m2m.backend.structure.Element.

Reimplemented in m2m.backend.structure.IfThenElse, m2m.backend.structure.LoopFor, m2m.backend.structure.LoopWhile, and m2m.backend.structure.Switch.

Definition at line 404 of file Function.java.

String m2m.backend.structure.Function.toStringParam ( int  level) [protected]

Convert all the input, output and internal to a String

Parameters:
levelIndentation level
Returns:
String

Definition at line 420 of file Function.java.


Member Data Documentation

Function body

Definition at line 44 of file Function.java.

Function input variables

Definition at line 32 of file Function.java.

Function temp variables

Definition at line 40 of file Function.java.

Maximum cost of the function

Definition at line 48 of file Function.java.

Maximum relative cost of the function

Definition at line 52 of file Function.java.

Function output variables

Definition at line 36 of file Function.java.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations