functions in std.i - a

 
abs

    abs(x)  
 or abs(x, y, z, ...)  


returns the absolute value of its argument.  
In the multi-argument form, returns sqrt(x^2+y^2+z^2+...).  
Builtin function, documented at i0/std.i   line 721  

SEE ALSO: sign,   sqrt  
 
 
 

acos

    acos(x)  


returns the inverse cosine of its argument, range [0, pi].  
Builtin function, documented at i0/std.i   line 582  

SEE ALSO: sin,   cos,   tan,   asin,   acos,   atan  
 
 
 

acosh

    acosh  


Interpreted function, defined at i0/std.i   line 627  

SEE asinh  
 
 
 

add_member

    add_member, file, struct_name, offset, name, type, dimlist  


adds a member to a data type in the file FILE.  The data type name  
(struct name) is STRUCT_NAME, which will be created if it does  
not already exist.  The new member will be at OFFSET (in bytes)  
from the beginning of an instance of this structure, and will  
have the specified NAME, TYPE, and DIMLIST.  Use OFFSET -1 to  
have add_member compute the next available offset in the structure.  
The TYPE can be either a structure definition, or a string naming  
a previously defined data type in FILE.  The optional DIMLIST is  
as for the "array" function.  
The STRUCT_NAME built from a series of add_member calls cannot be  
used until it is installed with install_struct.  
This function should be used very sparingly, mostly in code which  
is building the structure of a foreign-format binary file.  
Builtin function, documented at i0/std.i   line 3358  

SEE ALSO: add_variable,   install_struct,   struct_align  
 
 
 

add_next_file

    failure= add_next_file(file, filename, create_flag)  


adds the next file to the FILE, which must contain history records.  
If FILENAME is non-nil, the new file will be called that, otherwise  
the next sequential filename is used.  If CREATE_FLAG is present  
and non-zero, the new file will be created if it does not already  
exist.  If omitted or nil, CREATE_FLAG defaults to 1 if the file has  
write permission and 0 if it does not.  
Returns 0 on success.  
Builtin function, documented at i0/std.i   line 3425  

SEE ALSO: openb,   updateb,   createb,   add_record  
 
 
 

add_record

    add_record, file, time, ncyc  
 or add_record, file, time, ncyc, address  
 or add_record, file  


adds a new record to FILE corresponding to the specified TIME and  
NCYC (respectively a double and a long).  Either or both TIME  
and NCYC may be nil or omitted, but the existence of TIME and  
NCYC must be the same for every record added to one FILE.  
If present, ADDRESS specifies the disk address of the new record,  
which is assumed to be in the current file.  Without ADDRESS, or  
if ADDRESS<0, the next available address is used; this may create  
a new file in the family (see the set_filesize function).  
The add_record function leaves the new record current  
for subsequent save commands to actually write the data.  
The TIME, NCYC, and ADDRESS arguments may be equal length vectors  
to add several records at once; in this case, the first of the  
newly added records is the current one.  If all three of TIME,  
NCYC, and ADDRESS are nil or omitted, no new records are added,  
but the file becomes a record file if it was not already, and in  
any case, no record will be the current record after such an  
add_record call.  
After the first add_record call (even if no records were added),  
subsequent add_variable commands will create record variables.  
After the first record has been added, subsequent save commands  
will create any new variables as record variables.  
After a second record has been added using add_record, neither  
save commands nor add_variable commands may be used to introduce  
any new record variables.  
Builtin function, documented at i0/std.i   line 3181  

SEE ALSO: save,   createb,   updateb,   openb,   set_filesize,   set_blocksize,  
add_variable  

 
 
 

add_variable

    add_variable, file, address, name, type, dimlist  


adds a variable NAME to FILE at the specified ADDRESS, with the  
specified TYPE and dimensions given by DIMLIST.  The DIMLIST may  
be zero or more arguments, as for the "array" function.  If the  
ADDRESS is <0, the next available address is used. Note that,  
unlike the save command, add_variable does not actually write any  
data -- it merely changes Yorick's description of the contents of  
FILE.  
After the first add_record call, add_variable adds a variable to  
the record instead of a non-record variable.  See add_record.  
Builtin function, documented at i0/std.i   line 3215  

SEE ALSO: save,   openb,   createb,   updateb,   add_record,   add_member,  
install_struct,   data_align  

 
 
 

allof

    allof(x)  
    anyof(x)  
    nallof(x)  
    noneof(x)  


Respectively:  
 returns 1 if every element of the array x is non-zero, else 0.  
 returns 1 if at least one element of the array x is non-zero, else 0.  
 returns 1 if at least one element of the array x is zero, else 0.  
 returns 1 if every element of the array x is zero, else 0.  
Builtin function, documented at i0/std.i   line 834  

SEE ALSO: allof,   anyof,   noneof,   nallof,   where,   where2  
 
 
 

alpha_primitives

    alpha_primitives, file  


sets FILE primitive data types to be native to DEC alpha workstations.  
Interpreted function, defined at i0/std.i   line 2889  

 

am_subroutine

    am_subroutine()  


returns 1 if the current Yorick function was invoked as a subroutine,  
else 0.  If am_subroutine() returns true, the result of the current  
function will not be used, and need not be computed (the function  
has been called for its side effects only).  
Builtin function, documented at i0/std.i   line 555  

 

anyof

    anyof  


Builtin function, documented at i0/std.i   line 834  

SEE allof  
 
 
 

area

    area(y, x)  


returns the zonal areas of the 2-D mesh (X, Y).  If Y and X are  
imax-by-jmax, the result is (imax-1)-by-(jmax-1).  The area is  
positive when, say, X increases with i and Y increases with j.  
For example, area([[0,0],[1,1]],[[0,1],[0,1]]) is +1.  
Interpreted function, defined at i0/std.i   line 3618  

SEE ALSO: volume  
 
 
 

array

    array(value, dimension_list)  
 or array(type, dimension_list)  


returns an object of the same type as VALUE, consisting of copies  
of VALUE, with the given DIMENSION_LIST appended to the dimensions  
of VALUE.  Hence, array(1.5, 3, 1) is the same as [[1.5, 1.5, 1.5]].  
In the second form, the VALUE is taken as scalar zero of the TYPE.  
Hence, array(short, 2, 3) is the same as [[0s,0s],[0s,0s],[0s,0s]].  
A DIMENSION_LIST is a list of arguments, each of which may be  
any of the following:  
   (1) A positive scalar integer expression,  
   (2) An index range with no step field (e.g.-  1:10), or  
   (3) A vector of integers [number of dims, length1, length2, ...]  
       (that is, the format returned by the dimsof function).  
Builtin function, documented at i0/std.i   line 348  

SEE ALSO: reshape,   is_array,   dimsof,   numberof,   grow,   span,   use_origins,   _lst  
 
 
 

asin

    asin(x)  


returns the inverse sine of its argument, range [-pi/2, pi/2].  
Builtin function, documented at i0/std.i   line 576  

SEE ALSO: sin,   cos,   tan,   asin,   acos,   atan  
 
 
 

asinh

    asinh(x)  
    acosh(x)  
    atanh(x)  


returns the inverse hyperbolic sine, cosine, or tangent of  
its argument.  The range of real acosh is >=0.0.  
Interpreted function, defined at i0/std.i   line 627  

SEE ALSO: sinh,   cosh,   tanh,   sech,   csch  
 
 
 

at_pdb_close

    at_pdb_close  


Keyword,  defined at i0/std.i   line 2738  

SEE at_pdb_open  
 
 
 

at_pdb_open

    at_pdb_open  
    at_pdb_close  


bits for optional behavior when a PDB file is opened or closed:  
at_pdb_open:  
000  Major-Order:  value specified in file is correct  
001  Major-Order:102 always   
002  Major-Order:  opposite from what file says  
003  Major-Order:101 always  
004  Strip Basis @... suffices from variable names (when possible)  
     Danger!  If you do this and open a file for update, the variable  
     names will be stripped when you close the file!  
010  Use Basis @history convention on input  
The 001 and 002 bits may be overridden by the open102 keyword.  
The default value of at_pdb_open is 010.  
at_pdb_close (the value at the time the file is opened or created  
              is remembered):  
001  Write Major-Order 102 PDB file  
002  Write PDB style history data  
   The following are no-ops unless bit 002 is set:  
004  Use Basis @history convention on output  
010  Do NOT pack all history record variables into  
     a single structure instance.  
The 001 bit may be overridden by the close102 keyword or if  
close102_default is non-zero.  
The default value of at_pdb_close is 007.  
Keyword,  defined at i0/std.i   line 2738  

SEE ALSO: close102_default  
 
 
 

atan

    atan(x)  
 or atan(y, x)  


returns the inverse tangent of its argument, range [-pi/2, pi/2].  
In the two argument form, returns the angle from (1, 0) to (x, y),  
in the range (-pi, pi], with atan(1, 0)==pi/2.  (If x>=0, this is  
the same as atan(y/x).)  
Builtin function, documented at i0/std.i   line 588  

SEE ALSO: sin,   cos,   tan,   asin,   acos,   atan  
 
 
 

atanh

    atanh  


Interpreted function, defined at i0/std.i   line 627  

SEE asinh  
 
 
 

autoload

    autoload, ifile, var1, var2, ...  
 or autoload, ifile  


causes IFILE to be included when any of the variables VAR1, VAR2, ...  
is referenced as a function or subroutine.  Multiple autoload  
calls may refer to a single IFILE; the effect is cumulative.  Note  
that any reference to a single one of the VARi causes all of them  
to be replaced (when IFILE is included).  
The semantics of this process are complicated, but should work  
as expected in most cases: After the call to autoload, the VARi  
may not be redefined (e.g.- VARi=something or func VARi) without  
generating a warning message, and causing all the VARi for the  
same IFILE to become undefined.  The semantic subtlety arises  
from the yorick variable scoping rules; if any of the VARi has local  
scope for any function in the calling chain when the inclusion of  
IFILE is actually triggered, only those local values will be  
replaced.  (The autoload function is no different than the require  
or include functions in this regard.)  
The second form, with no VARi, cancels the autoload, without giving  
any warning; all the VARi become undefined.  
Before IFILE is included, the VARi behave like [] (nil) variables  
as far as their response to the is_void function, and the ! and ?  
operators.  (You can use is_func to discover whether a variable is  
an autoload.)  Only their actual use in a function or subroutine call  
will trigger the autoload.  While the IFILE may define the VARi  
as any type of object, the autoload feature only works as intended  
if the VARi are defined as interpreted or built-in functions.  The  
only way it makes sense for a VARi to be a built-in function, is  
if the IFILE executes a plug_in command to dynamically load an  
associated compiled library.  
If IFILE (or a file with the same name) has already been included,  
autoload is a silent no-op.  This is exactly analogous to the  
behavior of the require function; it does not harm to call either  
require or autoload if the IFILE has already been included.  Note  
that you may want to place a require at the beginning of a file  
you expect to be autoloaded, in preference to providing separate  
autoloads for the second file.  
Builtin function, documented at i0/std.i   line 2399  

SEE ALSO: include,   require,   plug_in,   is_func  
 
 
 

avg

    avg(x)  


returns the scalar average of all elements of its array argument.  
Builtin function, documented at i0/std.i   line 828  

SEE ALSO: sum,   min,   max