Miscellaneous Utilities of the Optimisation Shell INVERSE
(for Version 3.11)
Igor Grešovnik
Ljubljana, 27 September, 2005
Contents:
9.1 Various File Interpreter Functions
9.1.2 checkvalarg { < numarg > }
9.1.4 setoutdig,
setoutputdigits { numdigits }
9.1.5 setoutchar,
setoutputcharacters { numcharacters }
9.1.6 setintfcdigits
{ numdigits }
9.1.7 setintfccharacters
{ numcharacters }
9.2 Various Expression Evaluator Functions
9.3 Accessing command-line arguments
9.3.1 argstr
{ strname < numname > }
10.1 File Interpreter Functions for Controlling Time
10.1.4 fileprinttime
{ filespec }
10.1.8 filewritetime
{ filespec }
10.1.12 fileprintdate
{ filespec }
10.1.16 filewritedate
{ filespec }
10.2 Expression Evaluator Functions for Controlling Time
11. Printing Programme
Information
11.1 File Interpreter Functions for Printing Programme
Information
Prints the information about the current directory of the programme to the standard output and to the programme-s output file (the pre/defined file variable outfile).
This function
currently works only on UNIX systems.
This function takes a single numerical argument numarg and prints its value and the return value of the function for extraction of numerical arguments. Value of numerical argument is printed in the same way as numerical values are currently printed in Inverse.
The function is intended for checking whether statement of numerical argument is correct as well as for showing how numerical values are printed out.
Sets or unsets avoiding exponential notation (such as 1.3e-5) in input of floating point numbers (i.e. printing numbers to files and strings).
If there are no arguments or if numerical argument avoid is non-zero then avoiding of exponential notation is set. This means e.g. that value 1.3e-5 will be written as “0.000013” rather than “1.3e-5”.
If avoid is specified and evaluates to 0 then use of exponential notation is allowed.
The setting specified by this function affects functions such as write{}, fwrite{}, dwrite{}, stringwrite{}, stringappend{}.
Warning:
Avoiding exponential notation should be used only in exceptional situations, and should be set back to 0 when not needed any more. Reason for this is that printing in the form that does not use exponential notation is not convenient for small numbers, because number of output digits is in this case simply the number of digits following the decimal point (and not the number of significant digits). If the number is small, then it can happen that no significant digits are printed (i.e. if we print 1.0e-10 and the number of output digits is 8). Therefore, it is at least desirable to increase the number of output digits by setoutputdigits when avoiding exponential notation is set.
You can check by checkvalarg how numbers are currently printed.
Sets the number of digits used for output of decimal numbers to numdigits. This number is used e.g. at output of numbers with the write, fwrite and dwrite functions, but also with functions for printing vectors, matrices and other variables, e.g. printvector or printvectorvar.
Interfacing functions like setparam are affected by another function, namely setintfcdigits.
Sets the minimal number of characters used for output of decimal numbers to numcharacters. This number is used e.g. at output of numbers with the write, fwrite and dwrite functions, but also with functions for printing vectors, matrices and other variables, e.g. printvector or printvectorvar. There is seldomly a need to use this function. One example is when we want to output numbers in a table format so that all numbers in a column occupy the same amount of space. In this case the number of characters for output must be set appropriately greater than the number of digits which are written, so that the width of output numbers does not exceed numcharacters and all number outputs take the same amount of space. By default the minimal number of characters is less than the number of digits, so that each number that is written takes just as much space as necessary.
Sets the number of digits used while writing parameter values to the direct analysis input file aninfile by the function setparam to numdigits.
Sets the minimal length of output strings when writing parameter values to the direct analysis input file aninfile by the function setparam to numcharacters.
Returns the current status of avoiding output of numerical values in exponential notation.
Returns the current number of output digits.
Returns the current number of characters used for output of numerical values.
Returns the current number of digits used while writing parameter values to the direct analysis input file aninfile by the function setparam.
Returns the current number of characters used while writing parameter values to the direct analysis input file aninfile by the function setparam.
Stores command line arguments aimed for access from within the command file, to a string variable named strname. If numname is also specified, the number of these arguments is assigned to a calculator variable named numname.
In order to store arguments, a string variable of rank 1 named strname is initialized, unless there are no arguments (in that case the variable named strname will not exist after a call to this function). Variable dimension corresponds to the number of transferred arguments.
Command line arguments that are stored by this function must be passed by specifying the command-line option –arg when invoking the shell Inverse. All command-line arguments that follow this option are transferred and will be stored when argstr is invoked. This function can be called several times during program execution if several copies of the command-line argumets passed by the user are needed.
Both strname and numname are string arguments which specify a variable name, therefore their values must follow variable naming conventions.
Prints the current time of the day to programme output file.
Prints the current time of the day to programme standard output.
Prints the current time of the day to both programme output file and standard output.
Prints the current time of the day to the file specified by filespec.
Does the same as fprinttime, except that merely the time is printed without any acompanying comment, spaces or empty lines.
Does the same as printtime, except that merely the time is printed without any acompanying comment, spaces or empty lines.
Does the same as dprinttime, except that merely the time is printed without any acompanying comment, spaces or empty lines.
Does the same as fileprinttime, except that merely the time is printed without any acompanying comment, spaces or empty lines.
Prints the current date to programme output file.
Prints the current date to programme standard output.
Prints the current date to both programme output file and standard output.
Prints the current date to the file specified by filespec.
Does the same as fprintdate, except that merely the date is printed without any acompanying comment, spaces or empty lines.
Does the same as printdate, except that merely the date is printed without any acompanying comment, spaces or empty lines.
Does the same as dprintdate, except that merely the date is printed without any acompanying comment, spaces or empty lines.
Does the same as fileprintdate, except that merely the date is printed without any acompanying comment, spaces or empty lines.
Marks the current time and prints information about this mark to programme output file. Some measure of the current time in seconds is printed, as well as the time elapsed from the last time mark (i.e. call to any of the functions fmarktime, marktime, or dmarktime).
Optional numerical argument id is the identification number (should be integer) of the cpu mark, which is printed together with other data if it is specified.
Does the same as fmarktime, except that information is printed to programme standard output.
Does the same as fmarktime, except that information is printed to both programme output file and standard output.
Marks the CPU time spent by the programme and prints information about this mark to programme output file. The CPU time spent for the programme since the beginning of its execution is printed, as well as the CPU time spent since the last CPU time mark (i.e. call to any of the functions fmarkCPUtime, markCPUtime, or dmarkCPUtime).
Optional numerical argument id is the identification number (should be integer) of the cpu time mark, which is printed together with other data if it is specified.
Does the same as fmarkCPUtime, except that information is printed to programme standard output.
Does the same as fmarkCPUtime, except that information is printed to both programme output file and standard output.
Prints basic information about the programme (such as name, version, support address) to the standard output and the programme output file.
Prints basic information about the programme to the programme output file.
Prints basic information about the programme to the programme standard output.
Prints basic information about the programme to the programme output file and standard output.
Prints basic information about the programme to the programme output file. No empty lines are printed before and after the data.
Prints basic information about the programme to the programme standard output. No empty lines are printed before and after the data.
Prints basic information about the programme to the programme output file and standard output. No empty lines are printed before and after the data.