Next: Pattern-Matching Facilities
Up: Simple functions
Previous: Array padding
The array dimension interchange transformation
exchanges two dimensions of an array. The transformation is applied to a
Foresys unit AST.
-
Fits:SwapDim:Check(UNIT,DIAGMESG,ARRAY,DIM1,DIM2)
-
This function checks if the array padding transformation can be applied.
- AST (input AST) is a Foresys unit.
- DIAGMESG (output STRING) is a diagnostic string for the user.
- ARRAY (input STRING) is the name of the array.
- DIM1 (input INT) is the first dimension to be exchanged.
- DIM2 (input INT) is the second dimension to be exchanged.
- The function returns an error code (return INT):
- 1 if all is correct.
- 0 if the function is not an unit AST.
- -1 if no variable of name ARRAY is not declared.
- -2 if DIM1 is not a valid dimension for the variable ARRAY.
- -3 if DIM2 is not a valid dimension for the variable ARRAY or is equal to DIM2.
-
Fits:SwapDim:Advice(UNIT,DIAGMESG,ARRAY,DIM1,DIM2)
-
This function emits a diagnostic about the interest of the array dimension interchange transformation.
- AST (input AST) is a Foresys function AST.
- DIAGMESG (output STRING) is a diagnostic string for the user.
- ARRAY (input STRING) is the name of the array.
- DIM1 (input INT) is the first dimension.
- DIM2 (input INT) is the second dimension.
- The function returns a diagnostic code (return INT) :
- 1 if the transformation is recommended
- 0 if the transformation may be interesting
- -1 if the transformation in not recommended
-
Fits:SwapDim:Safe(UNIT,DIAGMESG,ARRAY,DIM1,DIM2)
-
This function emits a diagnostic about the validity of the code produced by
the array dimension interchange transformation.
- AST (input AST) is a Foresys function AST.
- DIAGMESG (output STRING) is a diagnostic string for the user.
- ARRAY (input STRING) is the array name.
- DIM1 (input INT) is the first dimension.
- DIM2 (input INT) is the second dimension.
- The function returns a diagnostic code (return INT) :
- 1 if the transformation is safe
- 0 if the transformation may be safe. More informations are given by the text in DIAGMESG.
- -1 if the transformation is not safe
-
Fits:SwapDim:Apply(UNIT,VERBOSE,ARRAY,DIM1,DIM2)
-
This statement applies the array dimension interchange transformation.
- AST (input AST) is a Foresys function AST.
- VERBOSE (input INT) is the comment level.
- ARRAY (input STRING) is the name of the array.
- DIM1 (input INT) is the first dimension.
- DIM2 (input INT) is the second dimension.
Next: Pattern-Matching Facilities
Up: Simple functions
Previous: Array padding
Yann Mevel
1999-04-30