LIST OF ENHANCEMENTS IN ANSI-C DEVELOPMENT
===========================================================================
Prty 0: Nice upgrade feature
1: Minor bug but not severe, or high priority feature upgrade
2: Major annoying bug but not computationally wrong
3: Error in results -- must be fixed now
===========================================================================
MOT - 2/20/02
Modified the handling of the history retrieval commands. If you use
!, this is the UNIX command completion command. The previous stack
of commands is scanned for one beginning with the specified text. If you
press , the command is simply executed. This has always been the
case. But now, if you press , the matching command line will be
put on the line for editing. Only the last matching line is given.
! - find the last line with as starting
! - retrieve the command line.
history - shows the history of command lines (to determine nn)
TAB on the first two will complete the command line without executing.
In addition, if the command processor interprets the ! command,
it will print out the actual command line pulled from the history.
MOT - 2/12/02
Fixed the dev -t (alias t) and dev -g (alias g) commands so they work
with the newest changes forced by Microshaft in XP.
MOT - 2/11/02
XGENPLOT and XRUMP now respond to key presses ^L and ^Z as follows:
^L - redraw both the text and graph screens if visible
^Z - minimize (iconize) both the text and graph screens
MOT - 2/7/02
Added \Ohm, \ohm, \Mho and \mho as aliases to \Omega and 'S' respectively.
MOT - 2/4/02
Added link to internal variable for the search path for macros. Like
the command, it is $BaseMacro. You can set or modify it as you please.
Basemacro c:\user\macros;c:\progra~\cgs\genplot\nt\local;
let $basemacro = "c:\user\macros;c:\progra~\cgs\genplot\nt\local;"
let $basemacro = "c:\user\macros;%$basemacro%"a
As per Kevin request.
MOT - 2/4/02
After much prodding, have changed keyboard control so the TAB works
for filename completion as in Windows XP. On the first press, it scans
backwards for the start of a filename and then searches for all files
that match the given text. If there are no wildcards in the string, an
implicit * is appended. TAB then cycles through each of the files in
turn until you press some other key. TAB walks backwards through
the same files. To see every file in the current directory, just type
* and then TAB.
This code should work in UNIX as well - though it has not been tested.
The TAB works only in the XGenplot/XRump versions in windows
and almost certainly not at all in UNIX.
MOT - 9/30/01
Pat's been at it again. fgets now permits up to 4096 characters.
MOT - 7/17/01
Kludged the ability to get time/size info on files when specified as
a UNC with //name/share instead of \\name\share. (forward/back slash
problem in windows). Handles only filesize, filedate, isfile and isdir.
MOT - 7/17/01
Pat's been at it again. The sprintf (and hence printf and fprintf)
functions were limited to 256 character output strings. This has now
been increased to arbitrary, subject to the limitation that printf
specifiers other than %s (ie. %f, %d, %p, etc.) are only GUARANTEED
to have 2048 bytes available to them. %s specifiers are guarenteed to
have the larger of 2048 bytes or the length of the string to be printed.
Also fixed EVAL to be able to print arbitrary long strongs. THIS HAS
ONLY BEEN TESTED TO 120,000 CHARACTERS :-)
MOT - 6/23/01
Added DEV -REPAINT or DEV -REDRAW to force redraw of the graph screen
MOT - 5/8/01 - still long time
Added reset option
genplot reset -silent
This just doesn't spit out the version info - nice for macros
MOT - 3/11/01 - been a long time since adding anything :-)
New plot options
PLot -SCOPE - erases the existing screen and draws a "scope" face
with the data. Cute, but not terribly functional.
PLot -NPOint - single use varient of the NPOINT command. Causes
only every nth point to be used for drawing. This
applies to both lines and symbols, but obviously
is useful primarily for symbols.
New command
SCOPE - draws a scope face. You must use REGION commands to set the
range, or use the PLOT -SCOPE option.
MOT - 9/26/00
Added the functions:
sech(x) csch(x) coth(x)
asech(x) acsch(x) acoth(x)
Surprised that they were not already there.
MOT - 9/3/00
Minor change in how dots in dash-dot line types are drawn in the
Word Perfect driver. Primarily to enable publication quality plots.
MOT - 6/26/00
Changed "menu" read/save/save as routines so that they use the current
working directory when first opened.
Speed-up: Windows 95/98 are absolutely abysmal with respect to the standard
memory management functions malloc(), calloc(0, free(), etc. These
are supposed to be "free" functions in a modern operating system,
but obviously no has bothered to tell the Microshaft engineers
that fact of life. NT has very good algorithms, but 95/98 are
an abomination before the Lord. This severely impacts the
performance, especially on computation extensive operations like
NLSFIT (lots of allocations in the thousands of dynamic evaluations
required). Since I am forced by the Microshit engineers to live
with 98 on my laptop, the code has been kludged to bypass this
restriction. I manage the memory myself now for a factor of 4-6
improvement (yes, not a percentage but huge factors). The change
under NT is negligible (but not any worse). Please write and
support the breakup of Microslave to multiple companies,
especially operating system companies that will truly compete.
Added: forlists command. This is similar to foreach but the variables in the
list are taken to be string arguments and expanded before the wildcard
processing and list processing.
declare alist = "a b c"
declare blist = "c d e"
forlist (alist blist) echo %f
Modified: The SOLVE now has an -noerrors options which prevents aborting when
the root does not exist in the specified interval. Useful mainly
for macros that can deal with that condition otherwise. Will return
the limit with the smallest absolute error.
Added: Function @index(,value)
Returns index of first point in the array equal to or greater than
the specified value. If no values are above the given constant,
-1 is returned.
Modified: The @min type functions now have an optional two arguments giving
a beginning and ending index point for the scans. The defaults
are 0 to len-1, and given values will be limited within this
range.
@min(y)
@min(y,npt/2,npt-1) = @min(y,npt/2,10000)
The arguments are sorted so order does not matter. Also, limited
in range to [0,len-1] so can specify well beyond expected maximum
for unknown length arrays.
Affected functions:
@min @max @sum @ave @avg @mean
@median @variance @var @std @rms @skew
@kurt @range @span @absmin @absmax @abssum
@absavg
Added: Write -? is now implemented. Also changed -NOTEXT option so it
also turns off writing of the default curve identifier.
Added: Multiple symbols on same line now enabled on IDENTIFY command
identify "text" -MSYMbol 3 4 5 /
Added: 48 bit versions of random number generators.
drand48() -> returns uniform [0,1] with 48 bit cycle
lrand48() -> returns uniform [0,2^31-1] with 48 bit cycle
mrand48() -> returns uniform [-2^31-1,+2^31-1]
srand48(int seed) -> changes initial seed for all 48() routines
The routines
drand(), lrand() and mrand() are aliased to the above.
In addition, the gnoise() function now uses this random number seed
instead of the default rand() earlier provided.
These routines will eventually replace rand() and rnd() [ie. they will
become aliased to drand48()].
Added: Alias in expression evaluator
isvar("var") <==> exists("var")
return 1 (TRUE) if the variable has been defined in the function
evaluator.
Modified: The PM device driver now looks to see if you are running
Windows NT or Windows 95. If not NT, then it automatically
does the bug fix kludge on printing and copying to the
clipboard. So the titles on the toolbar buttons are now
correct for both NT and 95. Don't know if Microsoft has
fixed the bug in 98 yet.
Modified: The file opening functions in the function evaluator now
trap and allow opening of the standard file handles. This
allows use of novel screen controls. Use of stdin is
considered *VERY* dangerous and I don't warrent any use.
It is okay under NT, but has not been tested otherwise.
fopen(filename [, mode])
filename == stdout : Open standard output (screen)
stdin : Open standard input (keyboard)
stderr : Open standard error (normally screen)
con : Open stdin or stdout depending on
if mode contains 'r' or 'R'
/dev/tty : Identical to con
Example: Outputting a countdown timer. Reading in a character.
setv stdout = fopen("stdout")
setv stdin = fopen("stdin")
loop %j=100,0,-1 { qev fprintf(stdout, "`%j\r") sleep .1 }
setv one_char = fgetc(stdin) eval one_char
declare a_string = fgets(stdin)
Caveat -- it isn't possible to close any of the standard handles.
fclose() always returns 0 but the handle remains valid. This is
only true for the standard in/out/error.
Change: Precision of the error functions has been dramatically
improved. erf(x), erfc(x), ndtri(x) are now valid to
an fractional error on the order of 7E-10 over almost the
full range. These include the functions:
erf, erfi
erfc, erfci
ndtr, ndtri
Added: Function for inverse error functions. Similar to ndtri(x)
erfi(x) - inverse error function
erfci(x) - inverse complementary error function
Extended range for ndtri and validity to better match the
new ERFC range/precision. ndtri(x) now valid
[1E-307,1.0] < 1E-8 absolute error
[1E-307,1.0] < 1E-8 relative error
Addition: FIT SPLINE has changed with addition of the -LINEAR option.
Also, it is no longer necessary to do a sort before the spline
fit call. The data will be sorted if necessary by the spline
routine. However, the STRICT requirement remains (ie. the data
cannot contain two points with the same X value). Use
SORT -STRICT to eliminate duplicate points.
[ FIT ] SPLINE {-options}
Options:
-SMooth - minimizes curvature by allowing
finite variation from the given knots
-SIlent - Don't print smoothing info during processing
-LINear - Piecewise linear, rather than cubic, spline
but otherwise using spline formalism. Makes
it easy to use spline functions (dspln, etc.)
Ignored with -SMOOTH option
Addition: File control in function evaluator now includes pipe capability.
setvar funit = popen("unzip -lqq zipfile", "r")
qev pclose(funit)
Usage: FileHandle = popen("command string" [, "mode"])
int = pclose(FileHandle)
popen() opens an external pipe using the specified command and
directs the input/output from/to the file handle. Normal fgets()
and similar commands can be used to read/write to the pipe.
Example:
setv funit = popen("unzip -lqq aziz")
while (feof(funit) == 0) fgets(funit)
qev pclose(funit)
A somewhat complex way to print out the contents of a zip file.
Clarification: Handling of escape sequences in character strings.
There are several complications arising from the use of the
backslash character in strings - which unfortunately will not
generally go away. The C language escape characters are very
useful, and indeed necessary, for the printf functions. But
they make use of special strings and paths very difficult.
(how to specify Microsoft paths, how to get \beta chars).
So, there are now two types of string constants.
Regular string constants - no escape constants
C string constants - full escape constant processing
A string is taken to be a C string constant if it is enclosed
in "" and the first character is a ` (the character may change
if someone has a better idea - but the behavior described below
will stay). In C string mode, the \ character identifies an
escape character to follow -- with the following recognized.
\a -> alert (bell sounds)
\b -> backspace
\f -> formfeed
\n -> newline
\r -> carriage return
\t -> horizontal tab
\v -> vertical tab
\\ -> backslash
\xbb -> hexadecimal constant where b is [0-f]
\ooo -> octal constant where o is [0-7]
Any other character returns just the character, so \w is
identical to w.
To force a regular string beginning with the ` character,
use it twice. This will disable the C string processing.
"``0.834\beta" gives the string `0.834\beta
"`\`0.834\beta" gives the string `0.345eta
Eventually all strings will run through this processing. At
the moment, it is still a bit mixed.
For example:
strlen("`\n") = 1
now returns 1 instead of 2 (or 3). This is necessary to implement
the fputs() function with line feeds etc. I have resolved much of
the trouble this may present elsewhere, but probably not all. Let
me know.
Addition: lnerfc(x) - returns ln(erfc(x)) valid over entire domain. Uses
alternate expansions near 0 and for large arguments. This should
provide uniform validity to 1E-7 fractional accuracy over full
range. Extended validity range is limited to real numbers.
Complex is implemented as log(erfc(z)) directly.
WARNING: With the addition of the file handling capabilities, there was a
major amount of change in the function evaluator. Let me know if
there are any unusual behaviors cropping up.
Addition: New silent-evaluation command
qev -> qevaluate Quiet Evaluation
Usage:
qev fclose(funit)
qev fputs(funit,"This is a line\n")
Allows expression evaluation where the side-effect is desired
without actually printing a value. Identical to EVALUATE but
will not print anything.
Change: Variable/Function defining routines now explicitly check to see that
the name specified is indeed valid. Used to be able to do things like
setvar 17 = pi
although the variable "17" could never actually be accessed. Now
this will print an error.
MAJOR Addition: Significant file handling added via the expression evaluator.
These will enable Pat to make much more complex macros to handle
massive data manipulation. The system provides the only limit on
the number of files which may be simultaneously open.
(1) New variable type: FILEPTR ==> a file handle. Listed in LISTVAR
and handled automatically by implicit setvar or SETVAR.
(2) File read/write operations. These are actually part of the math
expression evaluator, but with implicit operations can be done at
command level.
stream = fopen("pathname" [, "mode"]) {implicit setvar}
Opens the specified path. The mode specifier is optional
and defaults to "r" if not given. Other values are
"r" -> open for reading
"w" -> create/truncate for writing
"a" -> open for append write
"rb" -> read binary [probably not useful in GENPLOT]
"wb" -> write binary [probably not useful in GENPLOT]
"ab" -> append binary [probably not useful in GENPLOT]
"r+" -> open for read and write
"w+" -> create/truncate for read and write
"a+" -> create/append for read and write
"r+b" -> well you get the idea
"w+b" -> yep
"a+b" -> the same again
The returned handle must be passed to all other file control
functions.
fclose(stream) {implicit int eval}
Closes specified file handle, flushing all buffers.
a_char = fgetc(stream) {implicit setvar}
Returns next character from the stream. Returns -1 if past
the end of the file.
a_line = fgets(stream) {implicit define}
Returns next line from the stream. The terminating newline
character is removed from the string. An empty line is
returned if past the end of the file (use feof(stream) to
detect the end).
fputc(stream, char) {implicit int eval}
Writes a single character to the file (must be opened for
writing). Returns the character if successful, or -1 if
unsuccessful.
fputs(stream, string) {implicit int eval}
Writes the string to the file (must be opened for writing).
You must explicitly include the trailing "\n" if you want
a line terminator. Returns non-negative (usually 0) when
successful and supposedly -1 if unsuccessful.
fprintf(stream, format, arg1, arg2, ...) {implicit int eval}
Writes the formated string to the file (must be opened for
writing). You must explicitly include the trailing "\n" if
you want a line terminator. Returns the number of characters
actually written to the file, or negative on fatal file
errors. The routine is tolerant, but abusive.
a_line = sprintf(format, arg1, arg2, ...) {implicit define}
Returns the formated string as in fprintf. Generally used
with "define" command. This following commands are
effectively synonymous:
s1 = sprintf("var %s = %g", "x", x)
sprintf s1 "var %s = %g" "x" x
One uses the function evaluator, the other a GENPLOT
level command.
feof(stream) {implicit int eval}
Returns non-zero if end-of-file flag set on stream.
Warning: A closed file handle will also return 0.
ferror(stream) {implicit int eval}
Returns non-zero if error indicator is set on stream
fflush(stream) {implicit int eval}
Flushes all buffers associated with stream and returns zero
if everything is okay
ftell(stream) {implicit int eval}
Returns an encoded form of the file position. System
dependent value. May or may not be useful.
fseek(stream, offset, mode} {implicit int eval}
Sets file position indicator based on offset and mode. Mode
is one of the constants SEEK_END, SEEK_SET, or SEEK_CUR which
may vary between operating systems. For NT, the values are:
SEEK_SET = 0
SEEK_CUR = 1
SEEK_END = 2
Offset is based on the starting position above. Returns zero
if successful. This is potentially very non-portable.
Change: The implicit EVAL on expressions now has a brief format look - just
the result. This may become the default for eval as well if I
like it (and don't get too many complaints).
SCREWBALL: For UNC paths, apparently you cannot use // in place of \\
in fopen. Don't ask me why. But
x //lal/f/dieck/entr2.mac
fails while any of
x \\lal\f\dieck\entr2.mac
x \\lal/f/dieck/entr2.mac
x \/lal/f/dieck/entr2.mac
succeed. You figure it out. I say crazy Microshaft.
Change: The REPEAT command has now been shown to fail with the advances in
loop control offered by "loop" and "foreach". So, until I hear of
enormous complaints, the following command changes are implementd.
REPEAT -> LOOP now are synonymous
OLDREPEAT gets old version (if really needed)
FOR -> FOREACH now are synonymous
OLDFOR gets old version.
This was predicated when block control was created and has now
happened. The following gives very strange behavior.
oldrepeat 20 times if (%c<5) echo %c
Try it for curious results :-)
Add: Aliases UNSETVar and UNSETLocal for dealloc and endlocal.
Add: To accomodate the new RUMP spline fit feature, the function ispln(x1,x2)
has been created. This gives the integral of a spline fit (using
SPL$DATA) over the specified range.
ISPLN(xlow, xhigh)
Change: The unzip read option (using ::) now includes the -C option to match
file names case insensitively. Don't care if UNIX is case sensitive,
GENPLOT will choose to be case rententative, but case insensitive.
Change: FFT routines are designed to work within powers of 2. When the data
set is other than a power of 2, there are two options for handling
the problem. One is to truncate to the next lower power of 2 -- the
other is to somehow pad out to the next higher power of 2. Truncating
loses data -- padding artificially adds non-real values. Neither is
good.
So -- give the user the option. Three new FFT options.
-TRUNCATE - truncate data to nearest 2^m below npt
-PAD - expand data to nearest 2^m above npt, filling in
with the data set (copy from beginning)
-ZEROPAD - expand data to nearest 2^m above npt, filling in
new data points as zero
The default is -PAD which is a strange compromise. Versions prior
to 12/98 essentially mixed -TRUNCATE and -PAD depending on NPTMAX.
But now the curve will be expanded as necessary to allow either
-PAD or -ZEROPAD in all circumstances (up to 2^20 points/curve).
AUTOCORRELATE is always ZEROPAD'd. This makes sense.
FILTER is constant extension padding (last value just used).
This eliminates a discontinuity in the data, but leaves the
discontinuity in the derivative. Oh well ...
Fix: With expansion of loops, etc., problems have arisen in variables becoming
inaccessible in nested loops. The new code will allow up to 24 %x type
variables properly nested and used -- handling reuse as required.
Loop control statements (foreach, loop, while) always set the substitution
variables %i (index) and %c (count). This remains. The foreach() and
loop() may also set an additional variable of arbitrary letter. These
letter'd variables are now maintained as substitutions deep into loop
blocks (but not across macro calls). %%x as usual is converted into
%x.
Examples are the only way to properly demonstrate:
Simple nested loop. Notice innermost with replacement of %c.
loop %a=1,2 {
loop %b=3,4 {
loop %%c=5,6 {
echo %%a=%a %%b=%b %%c=%c %%i=%i
} } }
%a=001 %b=003 %c=005 %i=000
%a=001 %b=003 %c=006 %i=001
%a=001 %b=004 %c=005 %i=000
%a=001 %b=004 %c=006 %i=001
%a=002 %b=003 %c=005 %i=000
%a=002 %b=003 %c=006 %i=001
%a=002 %b=004 %c=005 %i=000
%a=002 %b=004 %c=006 %i=001
Over-riding outer loop entries
loop %a=1,2 {
loop %b=3,4 {
echo %%a=%a %%b=%b
loop %%a=5,6 {
echo %%a=%a %%b=%b %%c=%c %%i=%i
} } }
%a=001 %b=003
%a=005 %b=003 %c=001 %i=000
%a=006 %b=003 %c=002 %i=001
%a=001 %b=004
%a=005 %b=004 %c=001 %i=000
%a=006 %b=004 %c=002 %i=001
%a=002 %b=003
%a=005 %b=003 %c=001 %i=000
%a=006 %b=003 %c=002 %i=001
%a=002 %b=004
%a=005 %b=004 %c=001 %i=000
%a=006 %b=004 %c=002 %i=001
Combination of loops and foreach block, with a while. Again
note use of %%c so it isn't replaced by %c from the %k loop.
loop %k=1,2 {
while (%k+%%c<4) {
foreach %d in (mm, nn, zz) {
echo %%k=%k %%d=%d %%i=%i
} } }
%k=001 %d=mm %i=000
%k=001 %d=nn %i=001
%k=001 %d=zz %i=002
%k=001 %d=mm %i=000
%k=001 %d=nn %i=001
%k=001 %d=zz %i=002
%k=002 %d=mm %i=000
%k=002 %d=nn %i=001
%k=002 %d=zz %i=002
Add: SETPRIORITY command (in system). This command under NT modifies the
priority level of the main computation thread from -2 to +2. Default
is +2 at the moment. 0 indicates default thread priority from the
operating system. Other values are relative with +2 locking the
system for compute bound tasks, and -2 becoming essentially idle.
Requesting SETPRIORITY with an out-of-range value will print the
current priority level.
The default priority of the XGENPLOT/XRUMP process is set by the
value of PROGRAM_PRIORITY=2 in the genplot_.ini file (normally found
in "Program Files\cgs\genplot\nt". This ASCII file can be edited to
set the default priority to desired value. Or SETPRIORITY can be
added to the genplot.ini initialization file.
Add: Since NT allows the format "cd /d f:\cgs" changing disk and path, this
is also now allowed for GENPLOT (NT and OS/2 only)
Add: Another string function
fullpath( )
Example: eval fullpath("./test")
The actual file or path need not really exist -- it will be returned
as closely as possible.
Minor: Allow || and && as logical or and and respectively.
Minor: colormap define now allows to abort out of entries.
WARNING: There are two known instabilities at the moment. With no activity,
GENPLOT may simply hang. Selecting it in the task bar and
executing CLOSE from the menu will properly terminate it. There
is a more serious hang that occurs with extensive usage -- seems
to be related to font corrpution in the GENPLOT window. This is
being searched for now -- you may see occasional debug files show
up on your hard disk from this testing.
New feature: Under HELP menu items, there is now a "Modify Serial Number"
option that allows the serial number to be set from within GENPLOT.
This can be used to register a valid number without reloading the
program. Also, once a valid serial number is entered, the program
remembers the true serial number. On updates, you can enter anything
as the serial number -- the program will automatically correct it
when first run.
New functions: The value of atoi("junk") is 0 -- hard to identify an error.
Added new functions isatoi(str) and isatof(str) which return TRUE if
the ENTIRE string can be properly interpreted as a integer or floating
point value, and FALSE if any character is invalid. Also added function
to do arbitrary base conversion - strtol. This acts like the C function
except it does not save the location of the first invalid character.
isatof(string)
isatoi(string)
strtol(string, base)
Problems: Chebyshev polynomials do not work (in real mode) for OS/2 due to
a compiler bug. Since OS/2 is no longer long term viable, it is
not a big enough deal to try to fix.
Modify: Override of the search path - variable is now system dependent
GenplotSearchPath_OS2
GenplotSearchPath_NT
GenplotSearchPath_UNIX
This environment variable will override the search path for
system files.
Add: New function dpoly() to calculate derivatives and integrals of
polynomials.
dpoly(x,iorder,array)
iorder => 0 is evaluate function
1 is first derivative
2 is second derivative
-1 is first integral (all constants of integration = 0)
-2 is second integral
Derivatives of all order are allowed; integrals are only accepted
to tenth order (makes no sense anyway).
Fix/Add: Modified the CCIRCLE command in ANNOTE to accept the radius as
a cursor entry (any radius point). There is some subtlety to
use of user mode coordinates. In either USER or INCH mode, the
radius is still in terms of inches. It will be properly handled
and reported if entered by cursor.
Added: PCIRCLE command
PCIRCLE [x y radius | /]
Draws partial arc specified by the start and ending angles.
Angles are measured counterclockwise from the positive X axis.
Fix: The options to annote commands now default back to expecting a number
if there was any problem in interpreting as an option token. This
allows negative values in expressions.
Minor change: The command GENPLOT, ANNOTATE, RUMP now have an trailing
color (:) in their definitions. Thus you can paste the output of
a GENPLOT session directly back in without stripping the prompt.
For RUMP, RUMP: will not print the definition.
Size change: The MATRIX read code no longer places any limits on the length
of an ASCII line. Paul Carey and Pat Smith are free to write 50,000
character length lines as desired. If this works, will be moved to
be more generally implemented on all reads.
Document: Internal documentation of the PLOT and OVERLAY commands. Added
the PL -? and OV -? commands to give brief description of the myriad
of options. Should be done for many more commands.
Modify: Modified the edge (first/last point) handling of the histogram and
bar graph modes. Now tries to make last bins symmetric with respect
to the data points.
Enhance: Added options to many of the annote commands. The following will
work with circle/arc/ etc. commands.
-pen
-lw | -linewidth
-ltype | -linetype
Unlike many options, these immediately follow the command since the
number and types of arguments may vary for many of the commands (for
example the DRAW CONNECTED command)
Modify: The printf "%s" string operations will now permit full string
expressions rather than just string variables. Works with &encode
and printf sequences.
printf "%s" strcat("The time is now", ctime(-1))
Modification: Substition of control sequences. Advanced operation only.
The substition for control sequences like %i, %c and %f in foreach,
loop, while, etc. was previously done at "line read" time. It has now
been moved later to "token parse" time -- ie. just when the object is
needed. This may make a few complex macros malfunction, but makes it
much more consistent in behavior. Under the old sequence, the following
two constructs behaved differently. Under the new, they are equivalent.
loop 5 { loop 5 { echo %c } }
versus
loop 5 {
loop 5 {
echo %c
}
}
In the first case, it used to print out 1,1,1,1,1, ... 5,5,5,5,5,
while the second when properly 1,2,3,4,5,1,2,3,4,5,... Both now
give the correct sequence.
Because this change required low level modification of the parsing
algorithm, there is a high potential for unanticipated side-effects.
Please let me know of any unusual behavior that may be related to
this change (should only happen with %f, %i, %c and %var% type
substutions.
Added command processor:
pwd() - returns current working directory
getenv("var") - returns value of the environment variable
Note the "declare name = $USER" works, but only for uppercase
environment variable names. "declare name = getenv("user") will
work for any names.
Debug feature: The command "echo" is now expanded to include simplification
for debug modes. The command syntax is:
Usage: echo [-? | ON | OFF | DEBUG | NORMAL |
ON and OFF set global echoing of command file lines. DEBUG overrides
echo and turns it on for all subsequent macro levels, independent of
any other echo commands, until a ECHO NORMAL is executed. Echo can
also be used to print a single line of text.
Minor change: Removed the "sh", "os2" and "os/2" as commands for starting
an external shell. There still remain the equivalent commands
"!", "dos", "ok;", "csh", and "shell". sh was conflicting with
show inside RUMP.
Minor change: Back by popular demand -- the ability to reverse the on-screen
pm behavior from black lines on white to white lines on black. An
option in the SETUP dialog box of the PM screen allows you to choose
whether pens 0 and 1 are reversed on the display screen. Remember to
"SAVE OPTIONS" after changing any settings.
Note that running with reversed pen 0 and 1 violates the WYSIWYG mode
of screen printing. You cannot reverse the function of the pens for
hard copy except by using PALETTE MAP commands.
Minor change: The file/directory test functions have been added to the
standard string operations. This means that their actual use has
changed.
isfile(pathname) returns 1 if path is an existing file
isdir(pathname) returns 1 if path is an existing directory
filedate(pathname) both return seconds since epoch, or -1 if
filetime(pathname) the file does not exist.
filesize(pathname) size of file in bytes, or -1 if doesn't exist
The pathnames are now generalized string expressions or variables. If
a simple filename is given, it must be enclosed in quotes.
eval filesize("test.dat")
declare basename "test"
eval filesize(strcat(basename, ".dat"))
Minor Change: The handling of loop/list substitution has been changed with
regard to inner block structures. Conditional execution blocks now
will have variable substitution from the controlling foreach, loop,
or while block. The behavior of conditional blocks within for
and repeat control loop has not changed.
loop 20 {
if (%c < 5) {
printf "%d" %c
if (%c < 4) printf "Inner loop too: %d" 100*%c
} else {
printf "%d" 2*%c
}
}
Prior to this change, the inside printf would fail since %c was not
substituted with the loop count. Now, they behave as expected.
WARNING: FOR %f and REPEAT n commands are maintained currently for
backward compatibility and in case foreach, loop fail. They will
ultimately be eliminated and directed to the corresponding FOREACH
and LOOP commands (expanded versions of the same). DO NOT DEPEND ON
THE ABSENCE OF VARIABLE SUBSTITUTION IN THESE COMMANDS! IT WILL
CHANGE SOMEDAY.
Document: The area,page,axes fill are now implemented for the DVIPM and
Postscript drivers. Others will never see the light of day. In
encapsulated postscript mode, the page fill attempts to only go
just beyond the actual drawn area. This is a very kludgy and
difficult mode to support -- recommend not using AREAFILL in
encapsulated postscript unless you find that it really does work
as you need.
Change: To properly handle (ie make it look good by default) the new
area fill command, the margin on Y had to be increased. For this,
the new default SIZE is changed to 7.45x9.00 (from 7.30 by 9.00),
the margin on the left is increased from 0.85 to 1.00 and the offset
along X is decreased to 0.35 (from 0.50). The net effect is that
default graphs are exactly the same size in the same place.
Add: Added new commands
PAGEFILLCOLOR
AREAFILLCOLOR
AXESFILLCOLOR
These are decreasing area fills. Page covers entire page (a rectangle
sufficiently large to cover all of the page -- but boundaries of the
page are not included in the size for encapsulated postscript. Area
includes axes and the margins around axes. And axes is internal area
only. Page flood is done on each erase. Area and axes flood fills
are done on each axis.
Fix: Tried to modify code so "anno label 1 1 'text'" works without giving
extra single quote marks. In future, all strings should be enclosed
in double quotes only -- but cannot enforce and may not be good to
enforce. In "", is evaluated as a string expression. in '', simply
taken as given.
Add: ^L (Control L) will now do a force redraw of the graph screen (if
typed while the graph screen has focus). This is a full redraw --
also passes the ^L to the text window which will also do a full redraw.
Obsolete: The command COLORMAP has been superceded by the PALETTE MAP
command.
Clarification: The number of pens used for autochange mode depends on several
parameters. The palette command specifies that a number of the
entries are available as pen colors. But the DEVICES.DAT has a
similar parameter. The smaller of the two will be used. So if a
pen plotter has only 8 pens, then even if the palette is said to
have 20, only 8 will be used before recycling back.
New Command: PALETTE - in general graphics support.
See example file \Program Files\cgs\genplot\NT\default.pal
PALETTE DEFINE -- defines the palette
o num_entries is the number of entries in the palette.
o num_pens is the number of entries used as pens (not including
pen 0) for the autochange function. Normally, it is one
less than num_entries. However, additional palette entries
may be defined for use as structural colors (axesfill,
etc.)
PALETTE SHOW | LIST -- shows current palette information. Includes
the status of the axes and page fill colors.
PALETTE MAP [ ...] /
Identical to the old COLORMAP commmand. Sets the individual
entries in the current palette to the given values.
PALETTE COLORLIST -- prints a full list of all known colors
PALETTE SAVE -- writes commands to recreate the palette
to a .pal file. Always written as a local file unless path
given. Sets the AXES and PAGE fill colors, as well as the
palette.
PALETTE LOAD -- loads a palette file
PALETTE READ -- loads a palette file
These are synonymous commands. File is searched for in the
current directory and along the system search path. This
command causes the contents of the file to be executed (as if
typing "XEQ ") with echo off.
/* ===========================================================================
/* This file is a palette definition file.
/*
/* Blank lines or lines beginning with /* will be ignored.
/*
/* The following keywords are recognized:
/* PAPERCOLOR
/* AXESFILLCOLOR
/* PALETTE DEFINE
/*
/* PALETTE DEFINE: Followed by two integers specifying the number of
/* entries in the colormap and how many (not including 0) will
/* be used as normal pens for autocolor changes. The default
/* palette is 16 colors (pen 0 through 15), although any size
/* palette is supported (device drivers may have problems however).
/*
/* PAGEFILLCOLOR: RGB specification for the flood fill over entire paper.
/* Default value is "none". Can be name, expression, or an
/* integer refering to the palette. Page fill is only done
/* after an erase (autoerase or otherwise)
/*
/* AREAFILLCOLOR: RGB specification for the area fill color. The area is
/* defined as the region including the internal axes area
/* and the margins defined for labels. Will be drawn for
/* each axis generated. Default value is "none". Can be
/* name, or an integer refering to the palette.
/*
/* AXESFILLCOLOR: RGB specification for inside of axes. Default value is
/* "none". Can be name or integer refering to the palette.
/* ===========================================================================
PAGEFILLCOLOR none
AREAFILLCOLOR none
AXESFILLCOLOR none
PALETTE DEFINE 16 3
white
black
grey50
grey100
grey20
grey30
grey40
rgb(50, 50, 50)
grey60
grey70
gray80
gray90
darkcyan
darkyellow
tan
blue
Color Handling: Color inside GENPLOT/RUMP is now internally full RGB
capable (but some commands still accept only pen numbers). There
is a new database file providing mapping of color names to RGB
values called "colormap.dat" which resides in the usual place
(Program Files\CGS\Genplot\NT\colormap.dat). The file is self
documenting. The commands COLORMAP, PEN, AXESFILL, PAGECOLOR
are certainly known to work with it. As others are identified,
they will be updated as well.
The color database currently has 700+ colors. The names are
case insensitive but must be matched fully. GRAYxx where xx
is a two digit % are included (Grey7, Grey70, etc.)
Only the PMDRIV for NT and the Postscript driver can actually
make use of the full RGB capability. Other drivers use the
closest pen number to a specified color (pen numbers based on
the current color map palette). The number of colors is
unlimited in the code, but may be limited by the actual
rendering of the device. NT running in 24-bit color mode
handles all of the colors well.
axesfill CarnationPink axis
axesfill RGB(28,448,330) axis
New colors can be defined as a normal Genplot variable and
used as in any expression. Color matching first checks the
color database and then interprets values as an integer expression
becoming either a pen number or a color specification. However,
RGB colors should be saved as INTEGERS to utilize the full color
space. If not, the red component will be truncated to even values.
alloc MyYellow INT let MyYellow = RGB(220,190,60)
axesfill MyYellow axis
colormap 3 MyYellow /
axesfill 3 axis
Setting some colors cannot be done by name (such as internal
variable $axcolr[]). For these, a new function is implemented
which converts a string to the RGB equivalent from the database.
eval rgb_color("Yellow")
16842751 = rgb_color("Yellow")
printf "%8.8x" rgb_color("Yellow")
0100ffff
let $axcolr[1] = rgb_color("gray80")
(RGB specifications are 0x01000000 or'd with the 3 byte RGB)
If you really want to get a full listing of the available colors,
use the command "PALETTE COLORLIST"
The palette may also be queried by directly examining the RGB
entries in $PALETTE array.
COLORMAP: The colormap command changes the color mapping in the currently
loaded colormap. The version of the palette on disk is never
changed. For most devices, changing the colormap is not effective
until the device is re-initialized. But for the NT PM-driver,
the changes are immediate on screen (existing plot is changed
for all object drawn with pen specifications -- as opposed to
specific RGB specifications).
Change: RGB(x,y,z) returns a value which you are not to understand. But
can be passed to PEN to set specific colors. Documentation below
changed.
Added: Color commands can now be specified as full RGB values. A longer
list of colors will be added soon. Because of the change to a
display map of colors, the
Added: AxesFillColor (or AxisFillColor) - 8 character minimum
Sets color for fill of axes in graph. For subplots, might want to
use 0 to block out other components. Can also be various colors
to standout on graphs.
Added: functions
atof("string")
atoi("string")
atol("strong")
ascii to float, integer and long. The second two are identical.
The string is interpreted as a number as far as is consistent with
the type of variable. No error checking or return.
Added: Recognition of hexadecimal constants. 0x123 is properly interpreted
as the integer 256+32+3 = 291. Also the function RGB(r,g,b) which
just packs the three values into a single 32 bit integer. Fortunately
a float has 24 bits of precision so can be represented exactly.
NOTE: RGB is no longer specified. The specific value is lost, but
still represents a color. Bottom three bytes are rgb with R in
the lowest order position.
RGB(r,g,b) -- packs three integers r,g,b into a 24 bit
integer representing colors (RGB model). The values should be
between 0<=r<=255 -- actual operation truncates values to integer,
and then just uses the values modulo-256. So RGB(257,3,-1) is
equivalent to RGB(1,3,255) -- or essentially blue.
Added: With the string expression evaluation, it is time to start migrating
some of the commands to expect such expressions. First two are
TITLE and ANNOTE LABEL. These are generally the most complex used.
As I see fit, others will migrate as well.
anno label / strcat("sample ",ids)
Identification will probably move also, but need to think about
at what level -- ie. can the IDS be an expression which is expanded
just before being drawing?
Clarification: There are some real subleties added with string evaluation now.
Consider:
create y = sin(x) archive c1
decl m = c1
What should m be? "c1", or the value of the IDS on curve c1 which
should be "New Curve". This is a problem! I've solved it by
scanning a string expression first to determine if it is simple or
complex. A complex one is any involving characers ({[+/#. These
signify that some sort of operation may occur.
CASE: COMPLEX EXPRESSION
interpret as possible string variables. Variables will resolve
to their ID if 2D/3D curve or to their definition if a function.
If the string c1 is required, enter as true string constant "c1".
CASE: SIMPLE EXPRESSION
Even if name is a function or 2D/3D curve, treat is as simple
text and return only the text. To get the value of a simple
string, use either #c1 (forcing complex) or %c1% (expression
expansion in the parser.
Note that this DOES NOT apply to string variables which will always
resolve to their definitions. Use quoted strings to avoid this
behavior in a DECLARE operation.
declare m1 = "c1" /* Always safe
declare m2 = "m1" /* Always safe
declare m3 = m1 /* Will set to value of m1, not "m1"
Addition: Added ability to specify string arguments in defined functions, as
well as string returning functions. The prepend character '#' acts
as a prototype indicating that the variable (or function) name is
to be considered a string type variable (or return value). Different
symbols may later be added for other type arguments.
define f(#var,n) = strlen(copies(var,3))
define #g(#var,i,j) = subword(var,i,j)
Note that the # sign does not appear in the expansion, only in the
function name.
GENPLOT: define #g(#var,i,j) = subword(var,i,j)
GENPLOT: define f(#var,n) = strlen(copies(var,n))
GENPLOT: eval g("this is a long line", 1,3)
Value: "is a long" = g("this is a long line", 1,3)
GENPLOT: eval f(g("this is a long line", 1,3) , 3)
Value: 27 = f(g("this is a long line", 1,3) , 3)
GENPLOT:
Now to see how much broke in adding this feature.
If a string argument is encountered where a numeric value is expected,
the string is interpreted as a simple number (no math operations). In
complex mode, it can be of the form A+Bj.
define f(#a) = 2*a
eval f("34") = 68
eval f("34+8") = warning messages and 68 as the value
Addition: Enabled "Filled Rectangle" drawing in the postscript driver. The
ANNOTE FILLED_R command will now properly output to postscript
drivers.
Slight fix: There has been an annoyance that you had to re-enter the serial
number everytime an update was loaded from the WEB. The serial
number handling code has now been revised to keep track of valid
serial numbers that have been entered, and replace the "serial"
entry if necessary.
Functional: For updates, if you have once entered a fully valid
serial number (WGEN-97-xxx-xxx), you don't have to enter it
again. You can enter anything for the serial number during the
install process. The correct value will be inserted first time
the program is run.
Document: Use of the external macro facility in GENPLOT: - an Example
go.mac
---------------
/* ===========================================================================
/* This is a dummy demonstration of the macro calling ability of
/* the nlsfit function. The macro feature is included to allow fitting
/* functions which cannot be defined as a simple f(x) type expression,
/* for example those involving integral expressions. Any necessary
/* work can be done in the macro, including calling an external program
/* and reading in the result from a temporary data file.
/*
/* In this one, we are just fitting a gaussian peak with a very complicated
/* mechanism.
/* ===========================================================================
/* Create the test data with some noise
create y = 1.3*gauss(x,2.0,0.5)+0.2*ndtri(rnd(x)) -range -2 +5 -points 50
/* Set nominal coefficients (see test_fnc.mac for use of these)
setv a,x0,dx = 1.2 1.8 0.3 /* Modify so not exactly the same
/* Allocate an array for test_fnc.mac to save its estimates to
alloc results array npt /* Array holding results from test.mac
/* Enter NLSFIT and go - only addition is the genplot_macro feature
nlsfit
reset
equ results /* Will pick up the array created above
vary x0 /
vary dx /
vary a /
genplot_macro test_fnc.mac
fit
return
/* Plot the data and overlay the points estimated as the best fit
plot
let y = results ov -pen 2 -lt 1
test_fnc.mac
---------------
/* ===========================================================================
/* This macro must evaluate the fitting function at each of the points
/* in the data set. It should assign to results[%i] the estimate of the
/* function at the each of the coordiates x[%i]
/*
/* Requirements:
/* (1) results[] must be filled with the estimated Y at each X
/* (2) the original data passed must not be changed (use archive/retrieve
/* bracketing around the macro to ensure this)
/* (3) the final line should be a "return" to exit the sub-process
/*
/* This test version does very little - any real use would have a much
/* more extensive calculation for each of the elements.
/* ===========================================================================
archive hold_data
loop %k=0,npt-1 {
let results[%k] = a*gauss(x[%k],x0,dx)
}
retrieve hold_data
return
Modify: The is once again symmetry in the function evaluator between the
string and numeric expressions. 'a' and "a" are equivalent when
expecting a numeric argument. 'this' and "this" are equivalent when
expecting a string argument. Only "this" fails to parse when looking
for a numeric argument. This should make life easier on users of
the extensive string functions.
Modify/Fix: The strip() function now has two optional arguments rather than
one. The format is:
strip("string" [, "mode" [, char]] )
mode - "Leading" | "Trailing" | "Both". Default = BOTH
char - must a single character to strip. Defaults ' '.
ADD: More string functions - time related
time() - returns number of seconds since the Epoch
clock() - returns number of clock ticks program or OS start
ctime(time) - converts a time (in seconds since epoch) to an
ASCII string with the default format
Sun Dec 02 06:55:15 1979\0 (trailing \n stripped)
If time is specified as -1, then current time is
used - equivalent to ctime(time())
strftime(format, time) - encodes time into a string based on the
C equivalent function strftime. See any C
reference text for the parameters in the format.
If time is specified as -1, then current time is
used - equivalent to strftime(format,time())
In the conversion to C, these are implemented as:
ctime(time) -> ctime(time)
strftime(format, time) -> strftime(buf,256, format, localtime(time));
GENPLOT: eval strftime("%X %a %b %d", -1)
Value: "08:19:20 Fri Feb 20" = strftime("%X %a %b %d", -1)
GENPLOT: eval ctime(-1)
Value: "Fri Feb 20 08:19:28 1998" = ctime(-1)
GENPLOT: eval ctime(time()-8*24*3600)
Value: "Thu Feb 12 08:19:47 1998" = ctime(time()-8*24*3600)
GENPLOT:
MODIFY: Handling of comments in 3D Matrix read:
Within the header section (before the data), the following are
allowed:
C <== comment which, if first, becomes IDS
# <== comment which, if first, becomes IDS
/* <== comment which, if first, becomes IDS
@end <== end of header (jump to Zdata read immediately)
@skip n <== skip next N lines of file
@ <== stack commands on process stack in LIFO order
ZDATA <== end header and start read of Zdata immediately
COLS: | NCOL: <== set number of columns
ROWS: | NROW: <== set number of rows
COMMENT <== becomes IDS of the surface
XSCALE <== X = xorigin + i*xscale (if XDATA not specified)
YSCALE <== Y = yorigin + i*yscale (if YDATA not specified)
XORIGIN
YORIGIN
XDATA <== Load NCOL values of X (column) header values
YDATA <== Load NROW values of Y (rows) header values
Commands @end and @skip are case sensitive.
MODIFY: Minor modification to handling of calls to an externally linked
function from the expression evaluator when in complex mode. See
new documentation in "SimpleFnc" of the USER code directory.
MODIFY: DEFINE of a name already existing as a DECLARE will now print an
error message and change the class of the variable to FUNCTION
(from STRING).
ENHANCE: Really a fix, but some may view as an enhancement. Added translation
of %var% to expression in &encode usage. Following works as expected
(after you think about it a bit).
declare var = "ids"
echo &encode "The value of %s is: %s" var %var%
ENHANCE: String manipulations are now fairly strongly supported in the
expression evaluator. It has not permeated all elements of the
code, but such things as:
abbrev center char concat copies
d2x ichar index left length
LexEqual lowcase lowercase pos reverse
right strcat strcmp strcspn stricmp
strip strlen strncmp strnicmp strnlen
strspn substr subword translate upcase
uppercase verify word wordpos words
x2d
At least, now you get:
GENPLOT: eval reverse(subword("This is a long line", 1, 3))
Value: "gnol a si" = reverse(subword("This is a long line", 1, 3))
Eval tries to ascertain the nature of the expression before printing.
If the first reference is to a string variable, function returning
string, or a string constant (any expression in double "), then it
will evaluate it as a string. If the first item appears to be numeric,
then it will invoke the numerical interpreter mode.
Note that sloppy use of DEFINE and DECLARE will not cause problems.
DECLARE always creates a STRING variable and DEFINE always creates
a FUNCTION variable. STRING variables are interpreted as functions
if they are encountered in the middle of an expression. But they
are intrinsically strings and may switch modes on you when not
expected.
GENPLOT: declare value 7+8
GENPLOT: eval value
Value: "7+8" = value
GENPLOT: eval 0+value
Value: 15 = 0+value
GENPLOT:
GENPLOT: define total 7+8
GENPLOT: eval total
Value: 15 = total
GENPLOT:
GENPLOT: declare str = copies("hi", 4) eval str
Value: "hihihihi" = str
GENPLOT: declare str = "copies(""hi"", 4)" eval str
Value: "copies("hi", 4)" = str
GENPLOT:
ENHANCE: At behest of Mr. Smith, added some of the REXX string functions
as well, along with their UGLY optional argument formats. He has
promised to document them properly. Currently present functions
return only numeric values, but the string returns are coming.
abbrev(str1, str2, minlen)
string(length)
x2d(string)
words(string)
index(str, char [,start] )
pos(str, char [,start] )
wordpos(word, str [,start] )
verify(str, valid_list [,start [,reverse] ] )
ENHANCE: Added some string comparison functions to the expression evaluator.
Strings are still limited, but provides at least compare capability.
strcmp(str1, str2) /* String compare
stricmp(str1, str2) /* String compare (case insensitive)
strncmp(str1, str2, n) /* Compare only first n chars
strnicmp(str1, str2, n) /* Compare only first n chars
strlen(str) /* Length of the string
strnlen(str) /* Length ignoring trailing blanks
strcspn(str1, str2) /* first element in str1 that matches
any character in str2
strspn(str1, str2) /* first element in str1 that matches
none of the chacters in str2
These are identical to their C function calls. Note that is means
THEY RETURN 0 WHEN TRUE, and NON-ZERO when FALSE. Direct tests
will not work!
BOOL LexEqual(char *string, char match, int minlen)
Also defined lexical equality for more common use. This is the
same as the primary matching function in Genplot. String is the
input string, match is the expected pattern, and minlen is the
minimum acceptable abbreviation length. The strings must match
for all given characters, although either string may have additional
chars beyond the other. This function is extremely useful for
writing command case expressions.
The string arguments may be either string variables, or quoted
strings.
eval strnlen("Who said ""Where no man has gone before""? ")
eval strlen("Who said ""Where no man has gone before""? ")
echo off
while (1) {
declare cmd = &getarg -prompt "What's up boss? " -default quit
if LexEqual(cmd, "quit", 1) {
printf "You are not allowed to quit at this time"
} elseif LexEqual(cmd, "help", 1) {
printf "No help is available"
} elseif (strcmp(cmd, "really really quit") == 0) {
printf "Well if you really really insist ..."
break
} else {
printf "No commands are implemented"
}
}
ENHANCE: Added linkage to the normalized error correlation matrix in nlsfit
(using curfit method only). This is linked as a simple array that
must be interpreted manually as an NxN matrix.
Added command "NLSFIT ERROR_matrix" which will print the error
correlation matrix to the screen (formatted reasonably).
The error matrix is the inverse of the estimated curvature matrix
for the X^2 hypersurface, considered as a function of the N varying
parameters. The square root of the diagonal elements of this
matrix give the estimated sigma's for the fit parameters.
GENPLOT reports not the error matrix itself, but the normalized
error matrix; specifically each element (i,j) is normalized by
the product of sigma_i and sigma_j. The elements the represent
error correlation as relative in the reported sigmas. All
elements of the normalized error matrix must have absolute value
less than 1.0, and the diagonal terms will be exactly 1.0.
The values of the matrix may be accessed internally via the
linked array CORRELATE$ which is a linear N^2 array. Or the
command NLSFIT ERROR will print out the matrix as in the
example below:
NLSFIT: error_matrix
Error correlation matrix (CORRELATE$)
1.000 -0.001 -0.495 0.057 -0.100 0.106
-0.001 1.000 -0.036 0.026 -0.003 -0.008
-0.495 -0.036 1.000 0.165 -0.305 0.320
0.057 0.026 0.165 1.000 -0.883 0.789
-0.100 -0.003 -0.305 -0.883 1.000 -0.980
0.106 -0.008 0.320 0.789 -0.980 1.000
NLSFIT:
Precise interpretion of the error matrix can be difficult.
However, qualitative interpretation is fairly simple. If
an off-diagonal element is large, then errors in the two
parameters are strongly correlated; changes in one parameter
may be "compensated" for by changes in the second.
The above results are from the fit of a peak using a gaussion
with a quadratic background. The parameters were the amplitude,
center, FWHM of the peak and the offset, slope and quadratic
components of the background. From the values in the first
column, we see that the amplitude and the FWHM errors are
negatively correlated to a significant degree -- an increase
in the amplitude can be compensated by a decrease in FWHM.
Quantitatively, increasing the amplitude by sigma and
decreasing the FWHM by 0.495*sigma will result in a curve
only slightly modified from the best fit.
Looking at other terms, the center is essentially
uncorrelated with any of the other parameter. The offset
of the background, on the other hand, is correlated
significantly with both the slope and quadratic terms in
the parabolic fit.
In brief, the matrix allows one to construct the hypersurfaces
of constant increase in X^2 from the minimum fit value, and
thus the directions of the hyper-ellipsiods. For more detailed
interpretation of the inverse curvature matrix as an error
correlation estimator, consult a serious data analysis textbook.
ENHANCE: Added ability to set the angle in annotate via coordinates (for
macros or to follow a given line. If a "/" is given to the angle
command, the cursor or entry option is given.
annote angle / / -> brings up cursor for 2 points
annote angle / 1.0 1.0 2.5 3.7 -> sets angle for start to end
ENHANCE: CCIRCLE command in ANNOTE to draw a simple circle based on X,Y
center position and a radius (in inches).
annotate ccircle
MODIFY: CREATE now permits npt to be 1. The range is ignored and the single
point will be created at the minimum value of any specified range.
(Previously, "create -points 1" failed with an error message).
MODIFY: The postscript driver now supports filling the color of the internal
axes area, and page color filling. Set pen color 0 (via COLORMAP)
to the color desired inside the axes area (default is white). Use
PAGECOLOR to set the color of the page. With PageColor, the bounding
box is set to 0.2" beyond the drawing (a border of the page color).
When directly outputting the page, the page fill is set to 26 inches
wide and high to try to get the entire page.
This is a tentative implementation -- let me know if there are
problems with conversion in word processing documents, etc.
ADD: Color names now include page and background to represent these colors.
Background -> 0 -- color of the inside of axes region, used to
erase curves
Page -> 0 or value set by "pagecolor" command.
These values are not terribly useful except on PM and postscript
drivers which properly interpret the page and axes filling commands.
ADD: Function depth is now limited to 200. This should not affect
real expressions but will avoid crashes due to circular mistakes.
eval f(sin(x*2))
has a recursion depth of 3 (x*2, sin, f). Getting 200 deep ought to
be very difficult unless you make a mistake.
define f(x) = f(x)+1
eval f(x)
or
define ival = 1
let ival = ival+1
eval ival
In the latter case, because ival is DEFINED and becomes a string, the let
is also a string define. When eval comes along, it substitutes for ival
-- but the substitution has ival in it, so it continues to expand
indefinitely.
eval ival --> ival+1 --> (ival+1)+1 --> ((ival+1)+1)+1 ....
The function depth will avoid a stack overflow. If this number turns
out to be too low for anyone's work, easy to increase the threshold.
ADD: After multiple requests by RdR, now have ability to change the file
used to define devices (devices.dat). The syntax is:
DEVice -Filename
This replaces the internal "devices.dat" name with the given name or
path. The file will be searched for in the current directory and along
the normal Genplot system file search path (dynamic load path).
Usage: DEVice [ dev_name | -option ]
Options are identified by a leading hyphen and may or may not accept arguments
-? - quick help
-OPTION - token passed to driver as driver specific command
-TEXT - request driver to display text window
-GRAPH - request driver to display graph window
-NOGRAPH - request driver to turn off graph window
-NOTEXT - request driver to turn off text window
-CHECK - if a device has been initialized, do nothing.
Otherwise do a "device auto"
-FILENAME - change the internal name of devices.dat
-QUERY - prints out current device and device.dat filename
For the device name, the name "auto" causes the GTERM variable to be
scanned and used -- or uses a system default device.
The modification to the devices.dat filename is sticky -- ie. it will
not be undone by a GENPLOT RESET command.
MODIFY: The ASCII file read now automatically expands the line buffer as
needed to accomodate arbitrary long lines (and arbitrary numbers of
columns per line). This DOES NOT apply to reads within macros (using
the << structure), but only when reading a real file. It has been
tested to lines of 750,000 characters with 60,000 columns of data but
should have no intrinsic limits beyond memory constraints. Say thanks
to Pat for writing such incredibly long data files ...
A nessage us printed for each 1024 character expansion of the line
length just so you know it is happening.
Technical: Applies to ASCII XY, XYZ, or list directed reads scanning
directly opened file. All other modes remain limited to
1024.
MODIFY: The following keys are trapped by XGENPLOT and XRUMP to scroll the
text window:
- scroll by one window size
- scroll by one window size
- scroll to top of display buffer
- return to bottom of display buffer
V - scroll down one page (emacs)
- scroll by one line
- scroll by one line
These changes apply only to the WinNT version. For OS/2, only the
and are implemented. Also, while would
be nice, all characters are trapped by the window interface as
menu commands. V is there for those of us used to emacs.
ADD: Filename operations INTERNAL to GENPLOT (most) will now ignore either
single or double quoted filenames. In addition, the UNIX form of
"~/filename" will be translated to %HOMEDRIVE%%HOMEPATH%/filename"
automatically. Can't look up user information, so any form of
"~user/filename" is similarly translated (ie. all usernames resolve
to the current user). Someday this may change.
MODIFY: Changed the filename completion algorithm to better handle filenames
with embedded blanks (can Microsoft do anything more annoying now?
First we have the / versus \ fiasco, and now allowing spaces in
filenames -- talk about complicating a parsing algorithm!).
CHANGE QUICKLY: The " is now only added only for filenames containing
blanks. Otherwise, just normal processing.
SLIGHT: Both "foreach" and "loop" now support the -? or -help options to
get quick help.
MODIFY: The loop command now takes optional ranges ....
loop %z=start,end[,increment]
Usage: loop [do | times]
loop %x=,[,]
In the second form, the start, end and increment values must all be
together in a single extended token -- ie. no spaces are allowed.
Expresssions are allowed, but will be converted to nearest integer
values. %x will be substituted with a file extension format (ie.
normally 007) where x may be any character.
%c and %i are always substituted with the count and index starting
from 001 and 000 respectively.
Example: loop %a=91,113 { read basefile.%a plot hcopy dev pogo }
MODIFY: The IDENTIFY commands now have numerous additional options to
override almost everything. Because of the way that parsing is
handled, these options are only available to the IDS and IDENTIFY
commands and not as part of the -IDENTIFY option to PLOT and OVERLAY
(would conflict with the options to those commands anyway).
IDENTIFY [text] [options]
-PLACE { / | } - Starting legend position in inches (cursor)
-SKIP - Skip one space before the legend entry
-CLOSE - Close the legend box after this entry
-L&S - Do both lines and symbols on legend
-SYMbol - Override and use this symbol type
-LType - Override and use this linetype
-PEN - Override and use this color
-LWidth - Override and use this linewidth
-NOMARK -NOSYM -NOLINE - Draw text only, or turn off each
-RESET - Reset to top of legend on new plot (internal)
In addition, if doing -L&S, the line segment example is drawn from
the symbol out in the two directions so as to not go through the
symbol. It is likely that $IDLSIZ or $IDVSIZ should be changed if
doing extensive lines and symbol markers (increase $IDLSIZ or
decrease $IDVSIZ).
Note that -NOMARK disables both lines and symbols, while -NOSYM
and -NOLINE only disable that specific marker. If you draw with
symbols and indicate -NOLINE, it will have no effect.
Finally, multiple line LEGEND entries are now permitted with the
\n separater in the text.
MODIFY: The foreach (and the for) commands will now accept alternates to the
%f variable.
foreach [%x [in]] (list,...) [do]
The x in %x can be any character, defaulting to f if not specified.
foreach %a (a b c d e) { foreach %b (f g h) echo %a%b } (minimal)
foreach %a (a b c d e) do { foreach %b in (f g h) do echo %a%b }
foreach %a in (a b c d e) do { foreach %b in (f g h) do echo %a%b }
The "for" command continues to be non-rentrant, though I've seen no
problem with foreach and thus soon expect to have it translate to
foreach.
CHANGE: The "default" device when none has been selected in OS/2 and NT is
now "pm". I'm getting tired of typing that. GTERM will still
override if it is set as an environment variable.
COMMENT: OS/2 is slowly leaking out of the code in name. Made a check on
the trade rags to see how often it has been mentioned in the last
8 months and came up with only 5 valid comments on OS/2 WARP! When
will IBM ever learn?
NEW!!!: Added serial number verification -- had to at sometime since
some users actually get charged for the program :-(. This is how
it will work --
(1) Purchased licenses will get a serial number that permanently
enables any update revision of the code. This serial number
is printed in the "About ..." help button and the "VERSION"
command. Genplot only serial numbers will not run RUMP,
although RUMP serial numbers can also run Genplot.
(2) Beta test, or test and evaluation users, can download or
install the code, and with the right password, run until
some expiration date (60-90 days if I stay on top of it).
A quick message giving the expiration date flashes by during
bootup (2 second).
After the expiration date, you must return and get a new
copy and possibly evaluation serial number. The old version
will continue to work, but it will put up a message and
force you to endure a 60 second timeout.
(3) All users may regularly update their code by downloading the
latest installation program from the WEB. These updates will
normally include the entire package. (The documentation may be
split into a separate file if it gets too big.) Unfortunately,
licensed users will have to re-enter the serial number during
each upgrade install.
(4) This license verification currently only applies to Windows
NT/95 versions. UNIX users have the source code and can
bypass any software check anyway. OS/2 users will ultimately
be forced to NT and, until that time, will be granted a free
license.
This mechanism seems to ensure that everyone can continue to get
immediate updates and fixes, while providing some mechanism to
control the distribution of the program.
MODIFY: Added in NTDRIV (PM for NT only!!!) the ability to request metafile
or clipboard output from a macro using the IOCTL capability. Format
is
dev -option print
dev -option -print w/ Powerpoint kludge
dev -option clipboard"
dev -option -clipboard w/ Powerpoint kludge
dev -option "metafile "
dev -option "-metafile " w/ Powerpoint kludge
Notes:
(1) The form "metafile " must be enclosed in quotes
since it must be sent as a single string. The filename is
optional, but if not given, will bring up the dialog box.
The filename must be fully formed -- no extension will be
added to the specified string.
(2) The text for all of the forms CANNOT be abbreviated -- ie.
it must be all 8 characters of the word metafile.
(3) Errors are silently ignored -- the "dev -option" mechanism
is specifically device dependent and option strings on
one device may have no meaning on another.
(4) For metafile with no specified filename, focus is shifted to
the graph screen so the dialog box is visible.
(5) Print always go to the default printer.
Examples:
dev -option "metafile e:\thesis\figs\chap1.fig.1.emf"
GRPRINT command now behaves the same way -- essentially
"dev -option print" is synonymous with the "grprint" command.
Someday there may be a "EMF" device specifically as a subset of
the PM screen driver (bastardize the final PMDRIV code). However,
at the moment, things change too quickly to try to keep two copies
of very complex code maintained.
MODIFY: Added ability to write metafile from PMSCREEN with the embedded
Powerpoint bug workaround. Exists as another icon on the toolbar
and as a menu item.
ENHANCE: Modified the handling of the ok; (system) commands for OS/2 and
NT. If the command line is now terminated with an & character,
it is interpreted as a request for a detached session (independent
of the running GENPLOT session. This is equivalent to prefixing
the command with "start". So "ok; start eps" is identical to
"ok; eps &". Also, a blank request to ok to start a shell is
interpreted as starting a new window if running in GUI mode
(XGenplot or XRUMP). In window mode (Genplot or RUMP), this is
is still a inferior command process running in the current window.
Finally, the EDITOR command (using the environment variable EDITOR)
is started as a detached process in both windowed and GUI modes
under NT and OS/2. Editing within the GENPLOT text window is no
longer really productive.
For NT, the editor now also defaults to NOTEPAD which is usually
on the path. WORDPAD would be a better alternative, but Microsoft
chose not to put it in a location on the path so I cannot be
guarenteed to find it. To use WORDPAD, you must set the EDITOR
environment variable to the ENTIRE path to the executable.
ENHANCE: Added "SETLOCAL/ENDLOCAL" local variable control. The command
setlocal increments an internal variable and all new variables
added at this level are deallocated automatically when the
corresponding "ENDLOCAL" is executed. These may be nested. The
command "GLOBALize" takes a list of variables and converts them,
if necessary, from local to global. The "LISTV" command lists
the level of each variable just before the name; 0 is global.
This feature must be used with care. It is primarily meant for
very complex macros which are well debugged. Existing variables
level will not be modified. But archiving to an existing curve
name will delete the underlying curve and replace it with one
at the local level -- which will be released on ENDLOCAL.
Future features: (1) SETV will selectively create a new variable of
the same name if one already exists at a more
global level.
(2) GLOBALIZE at this point will
ENHANCE: Added ability to independently set the 4 margins around the page,
letting the top and bottom differ, as with left and right. The
values are set by modification of the "MARGINS" command to correspond
with the RANGE commands.
MARGINS { [BOTTOM LEFT TOP RIGHT } or
MARGINS
In the latter case, the X and Y values set the left and right equal
and the top and bottom equal. This retains compatibility with the
previous usage of the MARGIN command.
The PAGE LAYOUT dialog box in NT/95 has the additions. It is not
present in OS/2 -- the current dialog box value modifies the margins
in the compatability mode.
DOCUMENT: The TRANSFORM DY/DX is a 3 point curvature determining derivative.
If the data is not strictly sorted, there is a potential for
impossible calculations (3 local points with the same X value).
Not wanting to prejudice the results, the DY/DX routine simply
returns 0 for these invalid conditions. To avoid this with good
experimental data, SORT -STRICT or addition of random noise into
X is highly recommended.
FIX/MODIFY: Behavior of the SORT command is fixe and options documented:
SORT [options]
-normal Not reversed order
-reverse Reverse whatever else is said
-nosort Don't actually do any sorting
-random Randomize instead of sort
-strict Delete adjacent identical points - keep first
-delete Default behavior (synonymous with -strict alone)
-average Strict sort with neighboring points averaged
-avg Synonymous with -average
-xonly Modify the X array only (implicit sort on X)
-yonly Modify the Y array only (implicit sort on Y)
-zonly Modify the Z array only (implicit sort on Z)
-x Sort using the X array
-y Sort using the Y array
-z Sort using the Z array
These should behave closer to expected for multiple options.
There is some interaction between the options. In particular, the
array used for testing will be sorted (if SORT requested). Setting
-X implicitly sets request to modify the X array. A subsequent
-yonly will change to sort to based on Y only. On a 2D array,
sort -yonly -x
is synonymous with simple sort since -yonly forces the Y array to
be modifiable, and the -X forces the X array modifiable with sort
testing on X.
The one ambiguous mode is "sort -z -strict". In this case, the Z
and X arrays are taken as the "test" values, with Y the dependent
variable. Thus -average will average the Y values if both X and
Z are equal. The testing assumes the Z array is in order.
CHANGE: Modified the behavior of $csmin (minimum size of tick mark labels on
the axes). Behavior now dependent on the sign of $csmin:
If positive: True minimum size. If the "determined" size is less
than this value, it is automatically bumped up in size
regardless of the physical validity.
If negative: Minimum cutoff size. If determined size is less than
the absolute value, labeling is disabled.
Note that the old behavior is as if negative - and the new default
value is -0.07 inches.
SCREWED!! Due to critical bugs in the 5.0 compiler, all optimization has
been disabled in both GENPLOT and RUMP. I don't know which
routines are subject to error, but it is pervasive enought that
prudence dictates disabling the speed optimization. This may be
as much as a 50% speed penalty in worse case (ie. FFT -POWER).
If/when there is a patch released, I may try optimization again.
Reminded yet again why I preferred IBM to Microsoft. What a pain
in the proverbial posterior tissue.
---------------------------------------------------------------------------
Now using MSC version 5.0 (really 11.00 on itself). Minor changes required
to system.c for environment support. Little else. Should be okay.
---------------------------------------------------------------------------
Added: Added -SILENT option to the cursor command. Mostly for macros that
give their own prompts and handle results through the set variables.
Modify: Added ability to change the repeat (vecsize) for the ID via the
SGRAPH command on $IDVSIZ. Default is 0.003. But did increase the
default line-length to 0.65 (from 0.40) to get most of the repeat
cycle on screen.
Unmodify: The pattern size (repeat loop for - - - types) is not 0.001 instead
of 0.003 in the IDS. Makes it easier to see the line type.
Modify: New color on the PMSCREEN Color Map (OS/2) called NONE. This is
primarily for disabling the AXES background fill.
Modify: Potentially changes in the handling of options to plot. They are
now nominally coherent for all 2D operations (not 3D yet).
Plot and Overlay modes:
The overlay command is one of the most complex with various modes. It is
easiest to think about the options in two terms -- first options that
specify the plot type (types) and second options that modify the character
of the plot (modifiers). Not all modifiers apply to all types, but in
general most do.
===================
Types:
-AZIZ draws connected lines between adjacent points (in
honor of Mike Aziz at Harvard University. Ancient
way to get error bars. This mode ignores all lines
and error bars.
-PT_LABEL draws the ordinal number of each point -- useful
when you are trying to follow trends in sequences. This
mode ignores all lines and error bars. Obviously the
IDS will have a problem -- choose to show as lines.
-HISTOGRAM lines connect points as constant Y segments, beginning
halfway between adjacent X values. By default, the
histogram is line only (current linetype). Symbols and
error bars may be specified. There is no exclusion of
histogram line around points.
-BARGRAPH Histogram as above plus lines extending to the X axis.
By default, the bargraph is line only (current linetype).
Symbols and error bars may be specified. There is no
exclusion of histogram line around points.
-STICK Vertical line segments from X-axis to the points. By
default, this is a line only (current linetype). Symbols
and error bars may be specified. There is no exclusion of
histogram line around points.
Line or symbol plot
==================
Modifiers:
-SYMBOL Override the symbol type. Either an ordinal or
name (ie. FilledCircle) can be specified
-LTYPE Override the linetype number.
-LINETYPE
-PEN Override the pen color. Either an ordinal or
-COLOR name (Red) may be specified.
-SYMSIZE Override the symbol size.
-SYMBOLSIZE
-LW Override the linewidth
-LINEWIDTH
-L&S Where relevent, do both lines and symbols
-IDS Show IDS for this curve
-NOIDS Don't show IDS for this curve (even in AUTOIDS on)
-IDENTIFY Draw IDS for this curve with alternate text
-ERRX Error bar extent (symetric)
-ERRXMinus Error bar in X on minus side
-ERRXLow
-ERRXPlus Error bar in X on plus side
-ERRXHigh
-ERRY Error bar extent (symetric)
-ERRYMinus Error bar in Y on minus side
-ERRYLow
-ERRYPlus Error bar in Y on plus side
-ERRYHigh
-XSCALE Draw as if the X axis had been drawn with autoscale
-YSCALE Draw as if the X axis had been drawn with autoscale
-XYSCALE Draw as if the X/Y axes had been drawn with autoscale
-RESCALE Synonymous with -XYSCALE
-XRANGE Plot as if the X scales are as specified
-YRANGE Plot as if the Y scales are as specified
-ZRANGE Plot as if the Z scales are as specified
-XYRANGE ... Plot as if the X & Y scales are as specified
-XYZRANGE ... Plot as if the X, Y & Z scales are as specified
-PLX [Bottom|Top] Override so plotted against specified scale
-PLY [Left|Right] Override so plotted against specified scale
-BOTTOM equivalent to -PLX BOTTOM
-TOP equivalent to -PLX TOP
-LEFT equivalent to -PLX LEFT
-RIGHT equivalent to -PLX RIGHT
-SLOW Try to slow down the drawing speed
-SLOWER Give 30 ms between each drawing point
-SLOWN Give specified # of ms between drawing points
-EXCLUDE [-SELF | ]
Exclude line drawing over specified curve points
Notes: (1) Specifying both -SYM and -LT will cause plot to do both lines
and symbols (equivalent to -L&S). -SYM or -LT alone will
override to give the desired effect.
(2) Errorbars and symbols can be drawn with any plot type except
AZIZ and PT_LABEL.
(3) Exclude is primarily for normal lines or symbol plots. Usage
in other Plot Types has not been extensively tested.
(4) HISTOGRAM, STICK and BARGRAPH implicitely select lines only
(default = 1) unless -SYM is explicitely given.
Modify: The pattern size (repeat loop for - - - types) is not 0.001 instead
of 0.003 in the IDS. Makes it easier to see the line type.
Fix: XEQ -RETURN from within a memory block now returns out of the last
macro call rather than just the block level. Following used to fail:
if (1) xeq -return
Enhance: Added EXEcute as alias for XEQ
Fix: I've given up and taken the route of fully deleting and recreating
the device context on an erase in NT. This should eliminate the
ghosting characters remaining after erase on the screen.
Enhance: Added RANGE commands to NLSFIT so comparable to other fitting
routines. However, since NLSFIT is command driven, they are just
a tad different.
XRANGE | RANGE - limit on X range values
YRANGE - or/also on Y range values
ZRANGE - or/also on Z range values (obviously 3D only)
XYRANGE - obvious I hope
XYZRANGE - and given above, even more obvious
CURSOR_RANGE - show a box cursor and select valid region
Note that the range can also be specified giving an error bar
expression which has 0 entries for undesired points.
Fix: LSQFIT now uses same definition for option [-RANGE -XRANGE -YRANGE
-XYRANGE] as other FIT commands.
Enhance: Added -XYRANGE to all FIT commands. Now have
-XRANGE (or -RANGE synonymously)
-YRANGE NOT NEW
-XYRANGE (equivalent to -XRANGE -YRANGE) NEW
-CURSOR (puts up box cursor and selects allowed window) NOT NEW
-WEIGHT (may be ignored by some fit routines)
-SIGMA (may be ignored by some fit routines)
-SILENT (may be ignored by some fit routines)
fit [-XRANGE ] [-YRANGE <> <>]
[-CURSOR] [-WEIGHT] [-SIGMA] [-SILENT]
on some.
Add: New options to PLOT:
-NOIDS (Both RUMP and GENPLOT)
-XRANGE
-YRANGE
-ZRANGE
-XYRANGE
-XYZRANGE
The -RANGE force the appropriate range to be as specified on the
given axis without making any permanent or otherwise change.
Affects ONLY the plotting of the data but not the AXES etc.
Add: Added code for proper handling of DOUBLE and INT arrays from
within the expression evaluator. No way to create them from
inside GENPLOT, but they can be linked from external user routines.
BOOL GVLinkArray (char *name, int flags, REAL x[], INT maxsize, INT *size);
BOOL GVLinkIntArray (char *name, int flags, INT i[], INT maxsize, INT *size);
BOOL GVLinkDoubleArray (char *name, int flags, DOUBLE x[], INT maxsize, INT *size);
BOOL GVLinkComplexArray(char *name, int flags, COMPLEX z[], INT maxsize, INT *size);
In user usage, the simplest form is to set "flags=0" and "size=NULL".
Setting size to NULL causes the size to always be maxsize. Setting
it to a static variable address would allow you to have the dimension
of the array change dynamically.
Document: sprintf
Creates (if necessary) or sets a string variable to a formatted
string from internal variables. Similar to
declare &encode
Add: For binary writes, now can embed commands also via write. Format
write -binary -commands
@end
-command can be replaced with -text or -comments (plural only) to
embed only comments, not commands. The -COMMENT option gives
the identifier line on the string.
New: -IDS is synonymous with -COMMENT in a WRITE statement (preferable!)
Add: In binary data format (GENPLOT), comments in the header beginning
"@ " are considered to be command requests and will be queued for
executation in an RPN order following the read (ie. last read will
be executed first). This is now consistent with the ASCII read
which has the same construct.
Add: Because NT is so brain dead, had to modify the I/O channel to
support LPR output to TCP/IP connected hosts. New channel:
LPR*"printer"
LPR*"-Sserver -Pprinter"
This I/O channel creates a temporary file for the plot and then
spools it via the LPR command. Unfortunately, the NT version of lpr
cannot take the file from standard input (no piping) so this is the
only way. Under UNIX and OS/2, this is mapped to be equivalent to
PIPE*"lpr -...."
Modify: NT Genplot windows size can now be specified -- ie. a buffer space
for scroll back information. This information is in a new .INI
file Genplot\NT\genplot_.ini under the section [CONSOLE] with the
keys ROWS and COLUMNS. If you choose to modify these sections,
(1) copy genplot_.ini to the Local subdirectory and modify it
there, recognizing that new sections will be added in the
near future and you will have to manually add these sections
to your new copy
(2) modify the original genplot_.ini, recognizing that at each
new update, you will have to remake these changes.
Sorry for the pain - part of the curse of development testing.
Modify: To be consistent, FIT and TRANSFORM now default to ABORT instead of
LIST. Also, ? is synonymous for LIST, and FIT/TRANSFORM return to
GENPLOT prompt after printing the list (used to recycle asking for
the fit/transform type).
Modify: The internal MORE routine (used by TYPE) now accepts , ^Z, ^G
as synonyms for Q (quit).
Enhance: Because of the popularity of "implicit" let commands, the X command
now checks for an = sign. If present, it is an implicit set of
the X variable. Otherwise it is a call to XEQ as before.
CREATE Y = SIN(X) -range -pi pi
X = COS(X)
PLOT
Enhance: In GENPLOT, a filename of the form "zipfile::file" will be properly
read from the zipfile. The file must be fully specified (ie. with
any trailing .dat) and the zip file must exist. Few if any errors
are reported. Internally, it is expanded as:
read archive::file1.dat
read "| unzip -p archive file1.dat"
The IDS will be archive::file1.dat unless reset by the read. Like
other PIPE reads, the input is assumed to be ASCII unless the read
specifically specifies binary.
read archive::file1.dat -binary
The same file specification applies to XEQ macros and RUMP
files (I hope). The full macro name (including the .mac
extension) must be specified.
However, for RUMP, a .RBS extension will be appended if none exists
on the given name. This means files without an extension will be
difficult to read from an archive. Depending on the implementation
of unzip, "read archive::file." may work to get "file" without an
extension. But it doesn't under OS/2. Simple solution -- if you
want to use the archive, accept the default extensions! Direct read
specified by pipe does still work 'read "| unzip -p archive file".
Enhance: Show command has been expanded as per request by WLB
show [-xrange | -yrange | -zrange | -irange]
show -for
-xrange assumed if no option specified
Document: Identify has the following options:
-place --> sets location
-skip --> leaves a blank position in the legend
-l&s --> show both lines and symbols
-nomark --> don't draw a marker on the legend
-nosymbol --> same as -nomark
-noline --> same as -nomark
-close --> draw a box around the legend
-reset --> reset for drawing from the beginning of the legend
Enhancement: Added a -SINGLE option to cursor commands. This causes the
cursor to return immediately on the next key press (left or
right mouse, or any key -- including space). Useful when you
want to get a point in a macro from users who don't read
the screen prompts. (Press RIGHT MOUSE BUTTON??)
Enhancement: Added a "DOUBLE" type variable in addition to "REAL". It is
really double precision, but its use is slightly restricted. For example,
it cannot be used as a variable in "NLSFIT". But it can be used in
any normal expressions or functions. Primarily added to allow constants
and temporary expressions which lie outside the 1E37 range of normal
floats.
alloc double
setvar double
There may ultimately be a "PRECISION DOUBLE" capability for curves as
well as variables, but at the moment that is painfully difficult and
has not been done.
Range is 1E+/-308, about 15 decimal digits
Modification: FIX_GRID majorly rewritten:
Fix_Grid is used to impose a specified X grid on a given curve,
interpolating as necessary. Either linear or spline interpolation can
be used. The X-grid can be specified as an equally spaced grid of a
specified number of points between two limits, or can be specified as
the abscissa of another curve (or an array). Finally, outside the range
of the data, either CONSTANT or ZERO extension may be specified.
Usage: FIX_GRID <-options>
Options: -RANGE Specify the range of the new abscissa
-FROM grid. FROM and TO overwrite the values
-TO of RANGE. Initial are min/max of curve.
-POINTS Number of points in the grid. Initially
set to number in the curve.
-MATCH Causes the X-grid to match the specified
curve.x or array values. This option
takes precedence over -RANGE and -POINTS
-SPLINE Cubic spline interpolation used between
given points of the curve. Default is
linear interpolation.
-ZERO | -CONSTANT Either constant extend the function, or
set to zero outside valid range.
Notes: An implicit SORT -STRICT -AVERAGE is done prior to grid fix.
The original curve is replaced by the new gridded version.
Modification: Added ! as unary NOT operator. !1?7:2 returns 2
Modification: OS/2 XGenplot and XRump now interpret a Button 3 click as
as "Paste" command. Same as Button 2 double click.
Modification: CLIPSYMBOL NO
Previously, clipsymbol applied only to the symbol. It would not be
clipped even if it extended outside the plot box (but any symbol whose
value was outside the box would be eliminated). This did not apply to
the error bars on symbols. Now, it applies both to the symbol and
to the error bars. With CLIPSYMBOL NO, any point whose value is within
the plot ranges will be drawn fully, as will its error bars.
Enhance: Need to document PageSplit command.
PageSplit Set <# rows> <# cols>
Initializes multiplot page with given # down page and across
Orientation set by current LANDSCAPE or PORTRAIT orientation.
"Orient Portrait PageSplit Set 5 3" Nice 15 plot page
"Orient Landscape PageSplit Set 3 4" Other nice way
PageSplit Select
Make next plot start at specified position. Both are taken
mod the actual number of rows and columns
PageSplit Cancel
Returns to single plot per page format
Erase (implicit or explicit)
Advance to next plot position, going left to right and then
top to bottom (row major format). [Western Culture dictates].
NewPage
In multipage mode, starts a new page. In single page mode,
is equivalent to the old erase.
Enhance: If a command is not recognized, the default is to attempt the
operation as a "let", "setv", "define", "declare" or "eval"
depending on the nature of the command line before returning an
unrecognized command error.
Subsequent token exists and is an "=" sign (space separated):
Variable exists:
Set value of variable as per the expression following
Variable does not exist:
Variable contains an parenthesis, treat as "define"
Expression quoted (explicit or implicit), treat as "declare"
Otherwise "setv" as REAL or COMPLEX based on MATHMODE
Token contains a mathematical operator (+-*/ etc.)
Treat as "eval"
In all cases where the variable is implicitely allocated, a message
identifying the variable and the type that was assumed is printed.
All of the &getarg processor commands return implicitely quoted
strings and hence will "declare" a string variable. This can be
a problem if you need the value to be "REAL" for use in operations
like NLSFIT. The following demonstrates the problem.
f(x) = a*x
a = &getarg -prompt "Initial guess of slope" -default 1
nlsfit
equ f
vary a / <==== FAILSE since a is a string, not a variable
Math expressions are often okay either way since strings are
evaluated as if they were functions of no arguments. But it is
safer to set variable explicitely with "setvar" -- for the
following eventual reason:
declare a = 7+8 /* A string declaration
declare b = 8+9
eval a+b /* Resolved to be a string expression
result: 7+8+8+9
eval 0+a+b /* Resolved to be a numeric expressoin
result: 32
Enhance: New file tests (function evaluator):
isfile(pathname) returns 1 if path is an existing file
isdir(pathname) returns 1 if path is an existing directory
filedate(pathname) both return seconds since epoch, or -1 if
filetime(pathname) the file does not exist.
filesize(pathname) size of file in bytes, or -1 if doesn't exist
Document: GENPLOT Configure
? | help - obvious
status | parms | parameters - prints current settings
value - binary flag set (debug only)
confirmoverwrite | noconfirmoverwrite - check before writing file
binarywrite | nobinarywrite - default to binary files
asciiwrite | noasciiwrite - default to ascii files
datapath | dpath - set data file search path
dataexts - set data file extensions
Enhance: Added two new key commands
- backward word
- forward word
There are currently no equivalent UNIX key strokes, but they can be
defined via the termkey file -- see "termkey" in bin distribution.
The definition of a word is my choice -- any other logical one will
be happily considered (ie. does an _ define a word ending or just
a normal character).
Enhance: New loop control commands
break - breaks out of currently active loop, foreach or while
continue - skips to next element of active loop, foreach or while
These control signals will only operate on foreach/while/loop blocks.
GENPLOT: loop 200 setv i1=%c if (%c>=20) { continue } setv i2=%c
GENPLOT: printf "i1=%d i2=%d" i1,i2
i1=200 i2=19
GENPLOT:
GENPLOT: loop 200 setv i1=%c if (%c>=20) { break } setv i2=%c
GENPLOT: printf "i1=%d i2=%d" i1,i2
i1=20 i2=19
GENPLOT:
Change: The "block" statements within a "loop", "while", or "foreach" command
are now by default made non-echo. If you need echoing to debug, add
explicit "@echo on" to the block. This change also apply to all
"xeqs" inside the block. "if" blocks inherit the echo-characteristic
of the calling program. Change necessary because of the large amount
of screen output that may occur from even a simple loop command.
Enhance: Genplot will now automatically write .gz files if the extension is
detected. write "test.dat.gz" becomes "| gzip -9 > test.dat.gz"
Clarify: Label statements cannot be dynamic. :xxx must be a static name.
This is required since a GOTO within a block "loop" or "foreach"
will only scan the block once before rewinding to the beginning
of the file. GOTO's within a block will be properly handled,
but only when the name is static. :count%c is invalid
Segment below is an example of valid internal and external goto.
loop 10 {
setv icnt = 0
:start
echo %c
let icnt = icnt+1
if (icnt==1) goto start
if (%c > 8) goto end
}
bad_statement_1
bad_statement_2
:end
echo We are finished.
Also, on console input, multiple blank lines (about 5 or 6 of them)
will terminate a GOTO$ search (just so you don't get too frustrated)
Enhance: Added block execution blocks plus "loop", "while" and if/elseif/else
constructs. These are alpha test and hopefully haven't destroyed
any other components.
if (expr) {
list of commands
} elseif (expr) {
list of commands
} else {
list of commands
}
while (condition) {
expressions
}
loop (count) {
epxressions
}
Expressions not using { } delineation will assume the remainder
of the current command line. As usual, line boundaries are not
relevent and everything can be on a single line.
if (8<9) { if (4<3) { echo y^2 } else { echo y/n } } else echo no
If blocks may be nested to a maximum depth of 64 -- but this includes
all types of nesting including macros calling macros and for %f loops.
Still, it is big enough that I don't think it should be exceeded too
soon.
WARNING: Syntax is not checked -- and certain structures are allowed
syntactically though they make little sense.
if (x < 8) echo hi
let x = x-1
elseif (x<8) echo another hi
elseif do not have to immediately follow an if, and multiple else/
elseif's may follow a single if. Only one block will ever be
executed and the flag indicating that one has been done is not
cleared except on an if. I don't want to know what craziness
someone is going to do with this "feature" behavior.
WARNING: At the moment, behavior of block statements with the
"for %f" processing will not work. See below for improvement.
WARNING: while (condition) is tested BEFORE executation of the block.
If the condition is false to begin, then the block will never be
executed. If there is interest, I can make an until (condition)
command.
Enhance: for %f and repeat commands have been replaced. The old will remain
until I can ascertain that the new ones work, but then will be
obsoleted. New are flexible enough to work as old.
foreach (a b c ...) { expressions }
loop times { expressions}
Also works
foreach %f in (a b c) do { expressions }
Enhance: xeq and read can now fully utilize pipes. Both will now check if
there is a file with .gz extension and use "gzip -dc" to unpack
the file during execution.
Enhance: Added pipe cabability to LEX file execution (xeq "| rr") which reads
input from a pipe started with the given command. Also added pipe to
multi-line read in ANNOTE. multiline x,y "| test" as well as
multi-line x,y "< test.fil".
Enhance: 3D plots to the POSTSCRIPT driver now uses true fonts instead of
the hershey fonts. This only applies to the postscript driver --
even the PM driver does not have general transformation
capability as far as I can determine.
Enhance: ASCII data file reads have been sped up by a factor of 3-4 at the
cost of a slight slowdown (5%) for data files with expressions
rather than simple numbers. Most of the data reads are of pure
numbers which can be interpreted very fast.
Added: New functions
exists(var_name)
limit(value, low_limit, upper_limit)
and modified function
typeof(var_name).
exists() returns 1 if the variable exists and 0 otherwise. typeof
used to give an error if the variable did not exist -- it now returns
-1 to indicate no variable type.
limit(x,xmin,xmax) = max(xmin,min(x,xmax))
which I always end up coding wrong.
Modified: Increased size of almost all strings. There are now four general
lengths. 80 characters if nothing but simple text. 256 for most
general work. 1024 for anything that might need to be long (text
output, equations). There are some still 32 characters but only
where the input is expected to be a variable name.
Modified: let command now aborts on errors rather than trying to complete
a list expression. Necessary because now accepts the form
"let p() = 1,7,3,5" to fill an array. If () is specified, it
is recognized as a request to enter all of the elements.
Added: More explicit directions and include files for compiling extensions
with Visual C from IBM. Set genplot/os2/user directory for
information.
Modified: Causes L&S to give proper legend in GENPLOT.
Modified: Added -RESET to the IDENTIFY options. This resets the next
position for a IDS to the "starting" point for next object.
Useful for moving the starting point and then beginning a new
set of idents on the page.
Modified: On cursor -track, HOME and END now move to beginning and end of
the data set. Also modified so it will not go off screen.
Document: Make sure to add ncol and nrow as reserved names for GENPLOT.
Added: New command "MATRIX" similar to TRANSFORM with multiple subcommands
TRANSPOSE
Transposes the matrix (x<->y)
DUPLICATE
Duplicates a surface
ROW_EXTRACT
X_SCAN
COLUMN_EXTRACT
Y_SCAN
The specified row/cols are extracted and averaged. Either
a single column can be specified (ordinal 1-ncol), or
multiple columns in a parenthentical list (1,7) meaning
average the first 7 columns. NOTE: First row is row 1, and
averaging first seven rows is done by
matrix row_extract 1,7
Result is always left in the main curve (default)
TO_CURVE
The SURFACE is expanded into the default curve
TO_SURFACE
The current 3D curve is converted into a SURFACE assuming
that it is really on a mesh. X,Y points must make sense as
either a column or row major matrix orientation (ie. X same
for nrow Y values, or Y same for ncol X values). Will fail
if no underlying matrix is found.
All MATRIX commands requests will use as the , if expected,
a currently active surface requested after the MATRIX command. So,
the following commands are synonymous:
MATRIX S1 TRANSPOSE
MATRIX TRANSPOSE S1
MATRIX -SURFACE S1 TRANSPOSE
assuming S1 is a valid matrix.
Additional commands such as SQUISH, CULL, SMOOTH, etc. can be
implemented as necessary in this formalism, upon request.
Added: Can do a "status" on a matrix, getting something useful back.
Added: Also, now can do an "eval" on surface or curves, with expected
results. The printout can be aborted with ^C.
Modified: Options to READ can be given before or after (or both) the
filename. Getting used to doing
read -surface s1 test.mat
Added: WRITE -SURFACE [-BINARY | -ASCII] ...
Similar options to normal function write.
-SURFACE is synonymous with -CURVE and either may be used.
write
[-CURVE | -SURFACE ] - change from default curve
[-LIST ... /] - use a variable list instead
[-ASCII | -BINARY] - default depends on setting
[-NOTEXT]
[-TEXT | -COMMENTS] - prompted at write
[-COMMANDS]
[-COMment ] - in-line quick comment
[-APPEND]
[-SILENT]
[-FORCE] - don't check on overwrite
[-USER] - use user writeen routine
Added: Read ASCII 3D surfaces in matrix format.
WARNING: This is substantial new code and likely still has some
errors. Let me know of any problems.
FORMAT is difficult, but try to be flexible:
1. Blank lines, lines beginning with # of /* are ignored.
2. Header section consists of all lines beginning with the
following keywords (case insensitive):
keyword description default
-----------------------------------------------------------
COLS: # of columns (x values)
ROWS: # of rows (y values)
COMMENT: description of file filename
XSCALE: spacing on x points 1.0
XORIGIN: x value of first column 0.0
YSCALE: spacing on y points 1.0
YORIGIN: y value of first row 0.0
XDATA: collection of X points (COLS)
YDATA: collection of Y points (ROWS)
ZDATA: z data begins immediately
If ZDATA is not specified, it is assumed to begin with the first
line of data following the headers. Data will be read one value
at a time in row major format. Specificially,
X[0]Y[0], X[1]Y[0], X[2]Y[0] ... X[COLS]Y[0]
X[0]Y[1], X[1]Y[1], X[2]Y[1] ... X[COLS]Y[1]
....
X[0]Y[ROWS], ... ... X[COLS]Y[ROWS]
Lines must be less than 1024 characters. All punctuation is
converted to whitespace, and values are interpreted sequencially
independent of lines. All values may be on a single line, or data
may be organized one entry per line, as long as it is in the order
specified.
If the COLS header item is not specified, the first non-header
line will be scanned for the number of tokens, and this will
become COLS. If ROWS is not specified, then file will be read
until there is no more data and the number of completed rows will
become the value of ROWS. Specifying XDATA and YDATA is only
valid after the corresponding ROWS or COLS is specified.
If the file read options -COLS or -ROWS are specified, they are
handled only AFTER read and interpreting, so no time is save. All
of the surface will be read and then will be truncated as necessary.
This is required since the lines and rows do not necessarily align.
Added: DIGITIZE as an internal aliased command to "READ %DIGITIZE"
Added: "READ %CURSOR" as simple way to enter points off the screen.
Modify: Added -NORMALIZE option (to -weighted) in the TRANSFORM Y
histogram or cbin transformations. Avoids the need to normalize
to a sum of zero afterward. If the -normalize option is given,
the sum of all the intervals will be unity. The command
transf y hist 0.02 -normalize
is equivalent to
transf y hist 0.02
let y = y/@sum(y)
Also added -DENSITY to give a probability density value. Using
-DENSITY causes the value in each bin to be divided by the bin
width so an integral over the curve yields the total rather than
a sum.
Modify: Clarified "user coordinate" setting on entrance to annote from
RUMP. Will now be in units of channels (NOT ENERGY) and in the
y axis range.
Enhance: Enabled printing of full color graphs from the PM screen. There
are now separate palettes for printing and display (totally
distinct). The default page color may be specified, which will be
used if a negative (or default) page color is specified on
erase. (See PageColor command.)
Enhance: Enable setting of page color with the command "PageColor ".
For suitable devices, this will set the background page color as
desired. The default (or any negative value) is to disable the
page color (unless the driver establishes some other default).
Pagecolor
color may be specified by name or as a numerical pen value.
Enhance: Annote has a new function: FILLED_RECT .
However, only limited number of drivers support, currently only
the PM driver.
Enhance: SUB_PLOT has new options.
-erase
-fill
On devices supporting filled rectangle draw, will fill the region
of the new plot with the specified color. -erase fills with color
0 which should be the background color.
Enhance: Several of the annote functions now use the rectangle box cursor
instead of having to enter two points. Makes life somewhat easier.
Enhance: The create functions in create(), -fit, and -f options of plot now
use separate parameter spaces. Changes to -range, -npt, etc. in
one form will not affect the other ones. Also, the equation / will
retrieve the last equation used. These parameters are also now
reset on a GENPLOT RESET command. On a FIT command, the values of
the X range will be set to the actual range used in the fitting,
with the number of points set to 200. These should be good
defaults, though can be overridden with -points or -range options.
Enhance: REGION command modified to allow all 3D values to be set at one
time.
region [X | Y | Z | BOTTOM | LEFT | TOP | RIGHT | AUTO | 2DRANGE | 3DRANGE]
2DRange is equivalent to two calls with X and Y specifiers.
3DRange is equivalent to three calls with X,Y and Z specifiers.
AUTO sets all regions to autoscaling.
Enhance: Tired of having no flexibility in the RUMP plot command. Added the
following options:
-symbol
-ltype -linetype
-pen -color
-symsize -symbolsize
-linewidth -lw
-l&s
-identify
-ids
-npoint
-shift
-offset
These will temporarily override the current settings. -shift and
-offset refer to shifts of the spectrum on the graph page. Shift is
specified in channels, while offset refers to a translation of the
data in Y by the specified value, measured in units on the left axis.
Can be used to make waterfall type plots.
Modify: In RUMP, Read/Get commands will no longer complain about invalid
options. Options will fail when read as the next command instead.
Necessitated by new options to "plot " command.
Modify: In RUMP, the Y variable and NPT are now linked to the COUNTS
buffer of the current data set. Modifications using "let", however,
cannot be reflected in the dirty flag (no way to know they've been
changed). Solely present for the very advanced user who wants to
totally screw up their data.
Modify: The "title" of a plot is now maintained as a static variable. After
setting once, you can have the same title drawn by "TITLE /". The
value of title is static to the routine, not the program; hence,
GENPLOT called from RUMP will share the same title.
Modify: If the pen is currently an autochanging value (line -1), then the
"title" will be drawn with pen 1 rather than the current color. This
feature is getting painful. Same with "identify -close" and
"timestamp".
Add: New transform options.
CENTER - centers data set about 0.
Equivalent to "let y = y-((@min(y)+@max(y))/2)"
NORMALIZE - Gives set range of [0,1]
Equivalent to "let y = (y-@min(y))/(@max(y)-@min(y))"
CNORMALIZE - Gives set range of [-1,1]
Equivalent to "let y = 2*(y-@min(y))/(@max(y)-@min(y))-1"
Add: Added new option to PLOT, [-SLOW, -SLOWER, -SLOWN ]
which add a delay between points in the plotting (first time).
This can be useful to follow order that data occur. Slow is 30 ms,
slower is 100 ms; slown allows the time to be specified. This works
in OS/2, but use in UNIX environments depends on the existence of the
nanosleep() function which may not be implemented on all systems.
Modify: The size of the $AXCOLR and $AXWIDTH arrays are now 6 rather than
the previous 5. This is only a change in the array size published
to the function evaulator, but not in any actual functionality. The
indexes correspond to:
$AXWIDTH[0] -> axis line
$AXWIDTH[1] -> major tick marks
$AXWIDTH[2] -> minor tick marks
$AXWIDTH[3] -> tick mark labels
$AXWIDTH[4] -> title labels
$AXWIDTH[5] -> any tertiary tick marks (log scales)
Since these are published with the function evaluator, the "LET"
command can be used instead of going through SGRAPH.
Clarify: Nature of TRANSFORM SQUISH, COMPRESS and AVERAGE
These three commands may have changed slightly in definition since
the DOS Version. Under OS/2 and UNIX, the operations are:
AVERAGE: Averages points into 1
SQUISH: Deletes of every points, tossing unused
COMPRESS: Sums points into a single point
The use of AVERAGE maintains absolute values. COMPRESS is
appropriate for summing to reduce statistical noise such as in
nuclear counting methods. SQUISH is appropriate for random data
sets where the density of points is just to be reduced, such as a
random scatter plot from Monte Carlo simulations.
Enhance: 3D hidden line suppression is enabled. Use limited to the OS/2
PM driver and to output via the "PRINT" menu of the PM screen.
Use "Hidden On" to enable, but be prepared later to use "hidden
panel" to obtain the same type output. Use the plot or overlay
option -rainbow for limited color (to be greatly enhanced in the
future).
Modify: Added "axcontrol" as an alternative to axcntrl. Also axiscontrol.
Modify: The "DOS" command is no longer listed by the ? command. However,
it still works. OS2 and OS/2 have been added as aliases for the
shell command as well. "OK;" is still valid also (since I'm so
used to using that form from the days of PRIMOS). Prefered form
for launching a secondary shell though is !, as in UNIX, and is
now the listed command. Note also that csh ans sh are also
valid commands.
Enhance: Landscape and Portrait orientations have been extended to all 4
possibilities. Paper sizes defined in the device can be logically
rotated from Landscape to Portrait, as well as 180 degrees of both.
ORIENTation [LANDSCAPE | Portrait | INV_Portrait | INV_Landscape]
Because of physical device characteristics, the Portrait mode
is a 270 degree rotation with the X axis along the TOP of the page,
not the bottom. However, the Postscript driver does a 180 degree
rotation on both PORTRAIT and INV_PORTRAIT plot to avoid this quirk.
Modify: The triangle symbols (open and filled) have been moved slightly so
that the data center is in the center of the symbol (based on the
maximum extents - not the centroid). This is highly debatable but
I find it easier to discern the actual data values. Left & right
arrows on the same data points exactly overlap, for example.
Document: The use of ^n to switch fonts will soon be unsupported. At the
moment, it is backward compatible as far as is possible. If the
font specification "FONT HERSHEY" is invoked, then it will be very
backwards compatible. However, mixing new and old forms may fail
unless enclosed in {} constructs.
font times
label 1 1 '^3Time (^2l^3s)' <--- fails
label 1 1 '\bf Time (\mu s)' <--- new form
label 1 1 '^3Times ({^2l}s)' <--- will work
Use of old font tables 2,4,5 are especially problemsome since there
is no corresponding codepage/family in postscript fonts.
Document: Maximum parse size doubled to 4000*256 bytes (1 megabyte). This
allows an equation to have approximately 100,000 operations before
stack overflow. I hope it does not need to be increased again.
The downside to this increase is that circular functions will
take much longer to be detected. (define f(x) = f(x)+1 eval f(1)).
Document: The probability of random distribution generating a given
distribution as calculated by "fit correlate" is that determined
from the Robust Rank-Spearman correlation. This is statistically
more relevent (and robust) than the traditional correlation
coefficient.
Change: In NLSFIT, if the user does not specify error bars, they will get
the root mean variance reported instead of the previous (meaningless
chi-square. Variables chisqr$ and variance$ will be linked; chisqr$
has either reduced chi^2 or the mean variance. The variance$ has
either full chi^2 or the variance, depending on state of error
specification. Also now define variable dof$ with # of degrees of
freedom in the fit. List of defined variables in NLSFIT now:
sigma defined no error bars
-------------------------------------------------------------
cf$ fit coefficients fit coefficients
sigma$ error bar in cf$ sensitivity factor for cf$
dof$ degrees of freedom degrees of freedom
quality$ = q$ "quality of fit" 0.5
chisqr$ reduced chi^2 mean variance
variance$ chi^2 variance
-------------------------------------------------------------
Document: Printing problem imbedding encapsulated postscript in Word 6.0a.
Postscript files, including encapsulated postscript files, are by
the Adobe standard to contain the line %%EOF as the very last line
of the file. This is to permit processors to detect the end of the
real page description and avoid problems with file terminators.
To conform to the standard, GENPLOT will always write the comment
%%EOF to the end of all POSTSCRIPT files. This will permit true
conforming applications (such as Page Plus 3.0) to always succeed.
Page Plus specifically will not import encapsulated postscript files
without the %%EOF line.
However, this creates a problem for interaction between some word
processors and UNIX spooling software (specifically Microsoft Word
6.0a and Transarc spooling filters). The problem is actually
Microsoft's but their arrogance will undoubtedly cause them to deny
it. When WORD imports an encapsulated postscript file, it copies most
of the file, including especially the document structuring comments
such as %%EOF, into its output file. By the standard, Microsoft
should have stripped the %%EOF during copying of the EPSF file into
the page description. On the UNIX side, Transarc filters are set to
detect the conforming documents, and on conforming documents to
send a logical END-OF-FILE to the printer after the line containing
the %%EOF. This has the unfortunate effect of causing the rest of
the file to be ignored.
In order to use Microsoft Word 6.0a, UNIX administrators must
disable automatic EOF generation with %%EOF. This can usually be
done with an environment variable such as ADOBE_CONFORMING=FALSE.
However, this may also disable the positive components of the
document structuring comments. The ultimate answer is to bombard
Microsoft technical support in the hope of getting them to make
Word 6.0b truely conforming.
The other alternative is to manually edit the .EPS files and strip
the last line containing the %%EOF. It will always be the last line.
They may then be incorporated into Word without breaking DSC.
Enhance: At renewed interest of RdR, have gone ahead and implemented a
non-destructive array evaluation method. In an expression
evaluation handled by the array evaluator, the modified array
will be created in allocated memory, and then copied to the final
destination. With this change, the following will work as expected:
let y = y-y(0)
However, the penalty is that additional memory must be allocated to
hold the temporary array. For large array applications, or low
memory situations, the in place array modification may be selected
with the command "MathMode InPlace". It is unselected with
"Mathmode NotInPlace".
WARNING: With this revision, some macros depending on this unusual
feature will break. One example is the following which
will sum an array with "MathMode InPlace" set.
let y = (i==0)?y(0):(y(i-1)+y(i))
WARNING: This revision only works for arrays handled and modified
as vectors in the code. There *MAY* be segments of the
code which handle array assignment locally with single
calls to the function evaluation -- these will not use
the modified method. I don't know of any such at the
moment, but the code is now sufficiently large that I
cannot guarentee their absence. Let me know if any are
found in use.
Enhance: Added TIFF driver to the generic set. Will output a TIFF
B/W file at various resolutions. Sub-drivers:
01 - 300 DPI
02 - 150 DPI
03 - 100 DPI
04 - 75 DPI
05 - 72 DPI
Secondary options is bitwise additive.
01 - draw dots as single dots, not tiny cross
02 - suppress formfeed on output (ignored)
04 - suppress reset prior to output (ignored)
08 - suppress linewidth emulation
16 - suppress compression algorithms
32 - suppress blank bands at top of output
64 - output page immediately on drawing end (always)
128 - rotate output page by 180 degrees
256 - rotate output page by 90 degrees
In general, 256 should be used when in landscape mode to get
output presented as long edge horizontal. Default is like
page output with long axis down. 128 should be used if sending
flipxy output to get output appearing normally.
Typical entry should be
tiff150 tiff 02 256 01 file*query 150 DPI TIFF Output
Enhance: Added new option to secondary parameter of all LaserJet family
drivers to rotate output by 90 degrees. This option must be used
with some care since the output will assume the printer can take
the full "width" which is now, by default, 11 inches. Full set of
options to LaserJet family are:
Secondary options is bitwise additive.
01 - draw dots as single dots, not tiny cross
02 - suppress formfeed on output (ignored)
04 - suppress reset prior to output (ignored)
08 - suppress linewidth emulation
16 - suppress compression algorithms
32 - suppress blank bands at top of output
64 - output page immediately on drawing end (always)
128 - rotate output page by 180 degrees
256 - rotate output page by 90 degrees
Enhance: MAINTAINABILITY ONLY: Major changes to include files and some
organization of the GENPLOT source code directory. Will affect
only UNIX users needing to recompile. makefiles have been updated
with new dependencies.
Enhance: New statistical functions in evaluator:
@var(array) | @variance(array)
p_chi(chi2,v) = P(x^2|v) = probability of chi-square, v degrees
q_chi(chi2,v) = Q(x^2|v) = 1-P(x^2|v)
t_test(t,v) = A(t|v) = Student t-distribution
f_test(F,v1,v2) = Q(F|v1,v2) = F-test distribution for v1,v2 degrees
@t_test(a1,a2) = A(t|v) where t,v taken from a1,a2 arrays using
equal variance assumption with Student t-test
Small values ==> not likely same mean
@u_test(a1,a2) = A(t|v) where t,v taken from a1,a2 arrays using
unequal variance formulation of Student t-test
Small values ==> not likely same mean
@f_test(a1,a2) = Q(F|v1,v2) = a1 corresponds to v1 and a2 to v2.
1-value ==> probability that means are different.
Small values ==> not likely same variance
If you don't understand these functions, it is safe to say that you
will probably never think you need them. (You're welcome VBS).
These functions precision are specified as 8 decimal digits, not the
normal 15 digits for all other mathematical functions. Send e-mail
if you really need better precision - along with several test
results from primary literature.
Enhance: Added new \deg option to annote symbols. \degree also exists.
\degree is a character set symbol, while \deg is a manually
tweaked superscripted o made to look reasonable good by my eye.
Enhance: Added new functions to function evaluator:
beta(z,w) = Beta function B(z,w)
lnbeta(z,w) = Log(B(z,w))
betai(a,b,x) = Incomplete beta function I_x(a,b)
These functions are primarily for use with statistical tests.
Precision for betai is only internally 8 decimal digits, though
beta itself is full 15 digit precision of other functions.
Better precision can be generated if necessary - send e-mail
along with several test values from primary literature.
Enhance: Added partial integration on a curve. New function returns the
trapezoidal integration values between specified limits. This is
evaluated at eval time as opposed to parse time, so creates based
on the function are valid.
@pintegral(cv,low,high)
cv is a curve -- specify $plot for the current curve.
low and high are upper and lower limits of integration. Note that
there is also a signed sense to the direction of x in the curve.
Example:
create y = cos(x) -range 0 2*pi -points 200
archive c1
create y = @pintegral(c1,0,x) -points 500
plot -lt 1
Enhance: Added -avg as option for averaging on sort command.
Enhance: The characters \approx and \Approx are defined. The uppercase
version is bold, the lower case is normal weight.
Change: The < and > signs in all fonts have been replaced with glyphs much
more nearly matching the mathematical versions of these characters.
Previous versions of the characters are currently available in
font 0 as characters XY. (Old glyphs were 2227/2228 for both.
Replaced with 1241/1242 for normal and 2241/2242 for bold.)
Enhance: \bra and \ket are symbols for the old < and > symbol which are
useful for creating either cyrstallographic notations or QM
bra-ket constructs.
Enhance: Added symbols from Roger de Reus, in symbol set 0.
Q - filled down triangle
R - open plus
S - open cross
T - filled diamond
U - open left triangle
V - open right triangle
W - open down trianble
These will ultimately be accessible as normal symbols and
mappable into plot symbols. As of yet, they are unnamed.
Enhance: The _{xxxx} and ^{yyy} constructs are now environment preserving.
Font and pen changes will disappear at the closing brace.
Enhance: A font is the combination of a family (Times-Roman, Helvetica, or one
of the Hershey at the moment) and one or more charcteristics.
GENPLOT selects an appropriate font, defaulting to the Hershey
vector fonts when necessary. Most of code page 850 is supported.
The following commands select a CODE PAGE (mapping of character
codes to actual glyphs) without changing any other font attribute.
font ROMAN | font ASCII
font GREEK/math | font MATH/greek
font SYMbols
The following select a FONT FAMILY, resetting the code page to ROMAN
and clearing all attributes. This will initialize the simplest font
in the family.
font TIMESroman font TIMES-roman font TMSrmn
font HELVetica
font HERshey
font SCRipt
font GOTHic
The following select attributes for the font. Normal clears all
attributes returning to the simplest font in the family. Multiple
attributes may be selected.
FONT NORMAL - clear all attributes (simple font in family)
FONT BOLD
FONT ITALIC
Mapping of selected font attributes to an actual font is based on
the above priorities. The code page is considered first (so you
at least get the characters you ask for!). Next either the selected
font family, or one with the necessary code page, is selected.
Finally a specific font in the family with the requested attributes
is enabled.
SYMBOLS are the markers used in plotting. GREEK contains the rest
of the MATH/GREEK symbols. There is only one GREEK font for either
TimesRoman or Helvetica, and a different one for HERSHEY, GOTHIC
or SCRIPT.
Under OS/2, printing via the PM window should allow you to output
with ATM fonts to any device, but I've not extensively tried it.
Only the Postscript driver and the PM window within GENPLOT are
enabled to draw using the ATM outline fonts.
Enhance: Even more on fonts. The postscript re-encoding now tries to fully
match code page 850. If you see it on the screen, it will probably
print to a postscript printer. However, you must be able to enter
the extended (upper 128) codes into the text. Only some of the
symbols are available as aliased \escape sequences. Also, not all
of these exist in the Hershey font set. Be careful using the new
symbols.
eth Eth thorn Thorn
micro section paragraph plusminus
divide multiply degree
currency yen sterling cent florin
Some interesting, but not currently named, upper code page characters
onehalf onequarter threequarters
Enhance: status will now give status of a surface as well as curves.
Enhance: plot -RAINbow on a 3D curve will give the Rainbow coloring
effect. This is not very clean at the moment, but at least
a start.
Enhance: New fonts. The system now support ATM fonts under OS/2 and
in Postscript printers. This is the new default (Times-Romam)
until/unless complaints are large. On devices without ATM
capability, the fonts are stretched in the X dimension to mimic
the spacing of the corresponding fonts. The FONT (CHRSET)
command is now changed to reflect this change also:
See changes to Font command documented further above
Enhance: The commands
ov -f f(x,y)
ov -fit
now properly overlay the surface corresponding to the functions
specified on the grid. Options are identical to the "create -surf"
command. Default for range on "create -surf" are now @min/@max(x)
and @min/@max(y). Specifying a mesh of 0 or negative causes the
current plot mesh value to be used. Better choice might be the
resolution.
Enhance: create -surface s1 -range
is new option.
Enhance: fit surface [-fit options]
Determines the best second order surface fitting the current
3D data. a_0*x^2 + a_1*y^2 + a_2*x*y + a_3*x + a_4*y + a_5
fit plane [-fit options]
Determines the best first order surface fitting the current
3D data. a_0*x + a_1*y + a_2
Enhance: The function "3d_grid" is now implemented. This command takes the
current (or -curve ) curve and tries to create a reasonable
surface over the data. This is the equivalent of the "grid" command
from DOS 3D drawing. The format requires the name of the surface
to be created; other parameters are given as optoins. Options are
not sticky and are reset to defaults on each call.
3d_grid [-options]
ncol => # of constant X lines
nrow => # of constant Y lines
Options:
-Mesh
If not specified, current plotting mesh will be used
-Range
If not specified, range taken from data set
-MINpoints
-RADius
-Power
-SMooth
-NOFit
The algorithm is a modified version of typical gridding functions.
The Z value is a determined by points in the neighborhood of the
grid intersection. The points included are determined by all points
within a given -RADius (default 0.1), with a minimum of -MINpoints
always include (default is 10). In addition, more points will be
added to ensure that there is a least one point in each of the
four quadrants around the intersetion. There is no upper limit to
the number of points included in each determination.
The points included above are weighted by their distance from the
test point. This weighting is set by:
weight = [distance^2+smooth^2]^-(power/2)
where -Power defaults to 2 and -Smooth to 0.01. All distances are
measured on a normalized grid of unity length in X and Y.
If there are at least 7 points in the collection, and -NOFit has
not been set, then the data points are fit to a quadratic surface
and the value at the test point is determined. The weightings are
applied to each point in the fit. For fewer than 7 points, or if
-NOFit is specified, then the estimated Z is just the weighted
average Z of the points in the collection.
Smoothing causes points within approximately -Smooth to be weighted
equally, avoiding huge peaks from single points near a grid
intersection. A power of 0 weights all points within the radius
equally. 1 weights by geometric distance while, 2 weights close
points more strongly.
2d create y = 0 -points 500 let x,y = 30*rnd()-15 30*rnd()-15
3d let z = sin(sqrt(x*x+y*y))/sqrt(x*x+y*y+1E-8)
mesh 51 51
3d_grid s1 -rad 0.12 -smooth 0.015 -min 10 -range -14 14 -14 14
plot s1 ov -sym 3 -pen 2
Don't expect to get fabulous surfaces from limited data. To
represent the surface fairly, you need considerable data. Or, you
should fit the existing data to a mathematical model of the surface
using the 3-dimensional NLSFIT. However, this model is significantly
better than any I've seen detailed or used. Find a fast machine and
be prepared to twiddle the parameters to get the best surface.
Generally, an increasing radius will smooth the surface but will
require more time.
This code segment is not terribly optimized for speed since gridding
of data should not be a common exercise. But it is much more robust
than the version in DOS GENPLOT which, while clever, barely worked.
Enhance: The strings describing the columns of a binary data file are now
available for user inspection as the internal variables
$X_descriptor, $Y_descriptor and $Z_descriptor. These same strings
will be written as the column descriptors on a binary write. Since
they have no internal purpose, it is the user's responsibility to
ensure or ignore their meaning and usage. Maximum string length is
80 characters. Strings are not local to each curve and are lost on
the next read.
Enhance: Dealing with binary data file formatting is greatly relaxed. The
code now will handle most reasonable attempts to write the record
oriented format, independent of byte ordering. Specifically, byte
order nad record length format are determined on the fly. Order
can be BIG_ENDIAN or LITTLE_ENDIAN. Record length can be either
the byte count of the data only (normal UNIX form) or byte count
of data + the record markers (count+8). Record marker must be 4
bytes in length and must both preceed and follow the actual data.
Also, large records no longer need to be be broken up into maximum
of 4096 byte chunks. Data blocks can be written as single records
of arbitrary size. Code itself continues to write the more strict
format compatible with old DOS GENPLOT. See also fix on reading
binary files via pipe mode. Now fully operational.
Enhance: History commands. Behaves more like the UNIX shell history command.
"history" lists the previous 24 command lines. Can access (but not
edit) previous lines similar to UNIX.
HISTory - lists the previous 24 saved command lines (TTY input)
!21 - re-executes command line 21
!cr - re-executes last command starting with "cr"
The comparison of strings is case insensitive but must match exactly
the beginning of the line (excluding whitespace). Numerical counts
must consist solely of digits base 10.
Enhance: (MAYBE MORE) Added support for code page 850 (the international
characters). Nominally, the entire code page could be supported,
but currently only a portion is. WARNING: hdata.chr is no longer
compatible with the DOS version! It has an extra 160 symbols in
each set to handle foreign symbols. These are defined by the 850
code page and will be created as there is help available. If you
want to volunteer to generate a portion of the 850 code page for one
of the character sets, contact mot1@cornell.edu for info.
TeX sequences to obtain without typing characters directly:
\"a \"e \"i \"o \"u \"y \"A \"E \"I \"O \"U
\'a \'e \'i \'o \'u \'y \'A \'E \'I \'O \'U \'Y
\^a \^e \^i \^o \^u \^A \^E \^I \^O \^U
\`a \`e \`i \`o \`u \`A \`E \`I \`O \`U
\~a \~o \~A \~O \~n \~N
\ss \ae \AE \aa \AA \o \O ?` !`
Enhance: Minor modification to xdisplay.c for both XGENPLOT and XRUMP to
allow use of to enter special characters. This
allows even English keyboards to access the upper 128 characters
of the 850 code page. <129> (typing 129 on keypad) will get
you the u umlaut now.
Enhance: Added one more character set to hdata.chr. This is the triplex
symbols in normal English only, and is symbol set 10. Makes
very bold symbols. The string \bbf will switch to the bold bold
font.
Enhance: (MAYBE) Modified the clipboard, metafile and print rendering from
the PM screen to use only LOMETRIC resolution (.1 mm pixels) instead
of high metric (0.01mm pixels). This is 254 DPI versus 2540 DPI.
This gives the plot a more reasonable size when pasted into documents
and makes it possible to actually find it on the clipboard viewer.
Let me know if there are problems with this lower resolution.
Enhance: Linked variables giving size of plot, margins and offset. These
are read only since interact too much with other components of
system. But at least query may be useful.
$SIZE - array of 2 elements (x,y)
$MARGIN - array of 2 elements (x,y)
$OFFSET - array of 2 elements (x,y)
$SCALING - inverse of the shrink factor
Enhance: Format of the %c and %i counters in a FOR or REPEAT loop may be
set manually. The internal variable is $FORFORMAT and is initially
set to "%.3i". RESET will return it to this format. Format MUST
be in C format however. Strongly recommend that it remain a %d or
%i format just so one of the two can be used as indices in arrays.
Enhance: Add -BOX as option to CURSOR command in GENPLOT. Final values are
linked to the variables xbox$[0],xbox$[1] and ybox$[]. Attempts to
handle coherently even with non-linear axes. Also, use of box
cursor in most other analytical functions will set the XBOX and
YBOX values (fit, cull but not zoom for example).
Enhance: SAMPLE now has several new commands which permit draw squiggle
samples in arbitrary angles. Try ANNOTATE SAMPLE DRAW and
ANNOTATE SAMPLE 3DRAW to get the format. ROTSAMPLE has been
removed since superceeded by new features. New LABEL command
also to put text in layers of the sample.
DRAW [ | / ]
Draws sample with center of face at specified position with
size as previously specified.
3DRAW [ | / ]
Draws sample with face across first two points and length to
reach to third point.
LABEL "text"
Draws text centered at the fraction of distance on squigg.
ROTSAMPLE
Prints error message suggesting use with 90 degree angle
Other commands continue in compatibility mode
Enhance: New commands &xcursor, &ycursor, &xycursor, &boxcursor can be
used on command lines. Note that these are fragile commands and
values returned depend on the last coordinates set to the graphics
window. GENPLOT and ANNOTE now have new commands "SETRANGE" which
ensure the process is in a know state.
setv xc,yc = &xycursor
echo &boxcursor
will pull up a cursor and return x,y coordinates which are just
strings which may be manipulated. See other &getarg commands for
similar behavior.
Enhance: Pentium bug in floating point math is now detected and an error
message is printed. To eliminate the message, add the line
set IGNORE_PENTIUM_FPU_BUG=YES
in CONFIG.SYS or .cshrc (or .login).
Enhance: Both RUMP and GENPLOT now accept drag and drop of files onto the
program. If argument is
.dat or .data file in GENPLOT --> read and plot
.rbs or .fres file in RUMP --> read and plot
.hcp in either --> start and hc plot
otherwise --> execute as a macro
Initial directory will also be attached to the point of the
specified file.
Enhance: Allow mapping of symbol number to symbol to change
SYMBOLMAP [...] -1
is number used for selection
is either original # of a symbol name (valid list)
FilledSquare, OpenSquare, etc.
is a real scaling factor applied to each symbol -
can be used to increase size of solid symbols so comparable
to the open symbols.
Settings for symbol map are universal and are only reset if you
do a "reset -full". Add the SYMBOLMAP to your GENPLOT.INI to get
better ordering of symbols which having chance to remain compatible
with old formats.
Recommendation in genplot.ini:
SYMBOLMAP 1 FilledTriangle 1.25 2 FilledSquare 1.25 \
3 FilledStar 1.25 4 FilledCircle 1.25 \
5 OpenTriangle 1.00 6 OpenSquare 1.00 \
7 OpenDiamond 1.00 8 OpenStar 1.00 \
9 OpenCircle 1.00 10 Asterix 1.00 \
11 Cross 1.00 12 X 1.00 \
13 FilledLeftTriangle 1.00 14 FilledRightTriangle 1.00
-1
Enhance: SYMBOL can now be a name for a specific symbol. Autochanging symbols
must still use the integer format. Valid names are:
OpenSquare OpenCircle OpenTriangle OpenDiamond OpenStar
Cross X Asterix StarOfDavid
FilledSquare FilledCircle FilledTriangle FilledStar
FilledLeftTriangle FilledRightTriangle
Circle Square Triangle Star (alias for filled version)
Diamond (currently alias for open version)
Modify: Added COLORMAP command.
COLORMap [ [ ] ... ] /
The pen # are redefined to the desired colors. Allowed names are
white, black, red, green, blue, magenta, cyan, yellow, darkred,
darkgreen, darkblue, darkmagenta, darkcyan, darkyellow, darkgray,
and palegray (along with some synonyms). The colormap will remain
through "RESET" commands unless you use "RESET -FULL".
WARNING: Multiple pens can be assigned to the same color and hence
some colors may not be available with the PEN command.
Interaction of color map and devices. For devices where the colors
can be controlled by the driver, such as the PaintJet or Postscript,
the mapping will properly change colors. In contrast, for plotters
where the colors are set by the physical pens, the mapping is
disabled - pen 1 will always refer to the first physical pen
independent of the color assigned by the color map command. This
allows the colormap command to cause screen colors to match the
colors that will be obtained on a physical plotter as configured.
Enhance: New ANNOTE draw command as per RDR request
POint [ | /]
will draw a symbol at the specified point. Size is as set for
labels. Cannot do individual pixels though - 0 is real symbol.
Clarify: To do
declare PenLt "-pen 2 -lt 4"
ov c1 %PenLt%
use instead
cmdlin "ov c1 %PenLt%"
This will work quite generally. [Request via WLB]
Enhance: Changed -cursor to a box cursor for LSQFIT
Enhance: Added "pseudo commands" @end and @skip to ASCII read in GENPLOT.
Encountering the string @end is equivalent to the end of file.
@skip causes the next token to be interpreted as a simple integer
(no expressions allowed) and then skips that many lines in the file
before continuing the read. Both @end and @skip are case
insensitive and may still be interpreted if you add characters to
end.
Enhance: Added "-NOWarning" message to ASCII read to suppress all failed line
warnings from the READ. Error messages may still be issued by the
interpreter trying to perform and invalid function.
Enhance: Added -YRANGE to all FIT commands. Now have
-XRANGE (or -RANGE synonymously)
-YRANGE NEW
-CURSOR (puts up box cursor and selects allowed window) NEW
-WEIGHT (may be ignored by some fit routines)
-SIGMA (may be ignored by some fit routines)
-SILENT (may be ignored by some fit routines)
fit [-XRANGE ] [-YRANGE <> <>]
[-CURSOR] [-WEIGHT] [-SIGMA] [-SILENT]
on some.
Enhance: Added new command "symbolsize" as alias to "symsize"
Enhance: Added new command "symsize" or "symbolsize" to RUMP. Sets the size
of the symbols on plots as did sgraph previously. Symbol size has
moved to RUMP from general graphics and hence may operate slightly
different. Also, removing from common block will break old HCOPY
files (sorry -- but officially this is still beta).
Enhance suggestion: Rather than saving images as .hcp files for long term,
use the PM metafile format from the graph. IBM is more
likely to retain long term compatability for a simple
graphics image format than the more complex .hcp. Only
advantage for .hcp is size -- but .met files can be
inserted into other graphics programs (word processors).
Enhance: Allow alternate forms as per RDR request
el [-height ]
el