Last change
11/2/14: Updated ReadArg to allow specifying possible inputs, e.g. if a vector of numbers below 10 should be given on the command line.Latest version: oxutils.zip. See also change log.
OxUtils
In the course of the several years, it became convenient for me to have some routines at hand which execute common tasks in Ox for me. Creating graphs, tables, checking the time a program lasts, or also the profiling of a program to find out where all the time was spent, became tasks for which I created libraries or simple include-files.The graphics routines are combined into the package GnuDraw, with a description in separate pages.
The OxUtils package contains the following routines:
- info
A small routine which prints information on the screen concerning the remaining time a program is expected to run - lockfile
A routine which can be used to lock a file while Ox is performing computations on it, to make sure that a second instance of Ox is not using the same file - printtex/fprinttex
Print a matrix in a LaTeX table format, including the '&'s, with longer lines allowed.
The printtex statement is meant to work as a drop-in replacement for the standard Ox print statement. Phillip Gould mentioned the use of having a fprinttex version as well. - ReadArg
A routine for quickly checking if a certain command line parameter was given along when starting Ox. - loadtab
and savetab
Save a table, i.e. a matrix with row and column labels. If an older table of the same name exists, the table can be appended to, joining rows or columns if they have the same name. - SetSeed
Set the random seed to a number based on the current time, which is more random than the standard start-up value of the seed - TrackTime
A set of routines which help in profiling a program, to find out which routine should be speeded up first. - size
A terribly simple routine which I find myself using all the time, to return at once both the number of rows and columns of a matrix.
The use of these routines is most easily appreciated by reading through the page with examples, or checking out the manual and the example ox-files mentioned there.
Installation instructions
To install the package,- download oxutils.zip and unzip this file from
your Ox folder (using folder names). This creates files in the
directory <ox-home>/packages/oxutils. In this case, no change of the
OX7PATH environment variable is needed.
Installation in a local directory is also possible; e.g. if you install under Windows in c:\myox, resulting in files inc:\myox\packages\oxutils
then make sure that the directory c:\myox is included in the OX7PATH variable. - Option A:
Put the file <ox-home>/packages/oxutils/doc/oxutils.html in your list of bookmarks, or, better even,
Option B:
Edit <ox-home>/doc/oxmenu.html, adding a line<tr><td><a href="../packages/oxutils/doc/oxutils.html">OxUtils reference</a></td></tr>
before the line referring to the Predefined constants such that the documentation is available from the standard Ox documentation.
Oxutils change log
Below a list of the changes in Oxutils. The latest version is available as oxutils.zip.
- 11/2/14
- Updated ReadArg to allow specifying possible inputs, e.g. if a vector of numbers below 10 should be given on the command line.
- 30/7/13
- Updated ReadArg to react more logically to its arguments; return value now indicates number of elements correctly read, or a TRUE if a boolean was found.
- 4/1/13
- Corrected small bug in printtex concerning missings in the first column of a matrix.
- 3/3/12
- Simplified example files, got rid of a small bug in printcsv.
- 2/5/08
- Tiny change in ReadArg()when reading a boolean.
- 11/2/08
- Finetuned printing strings in printtex().
- 3/10/06
- Added option to ReadArg() to read an array of strings.
- 12/9/06
- Updated the manual on TrackTime().
- 9/5/06
- Introduced ReadArgUsed() to get an overview of the commandline arguments read in your program.
- 10/10/2005
- Added fprinttex,
generalised the ReadArg
command, and added the loadtab/
savetab commands.
- 02/02/2005
- Added support for printing parentheses in format string, see example in extable.ox
- 05/01/2005
- Added internal references to acfisq, and included it in the reference.