all functions - m

 
mac_primitives

    mac_primitives, file  


sets FILE primitive data types to be native to MacIntosh, 8 byte double.  
Interpreted function, defined at i0/std.i   line 2913  

 

macl_primitives

    macl_primitives, file  


sets FILE primitive data types to be native to MacIntosh, long double.  
Interpreted function, defined at i0/std.i   line 2921  

 

make

    make  
 or make, path  
 or make, path, template=1  
 or make, path, template="Makefile_name"  


 creates or updates the Makefile for a compiled package (plugin).  
 If PATH is given, it is the directory containing the source code  
 for the package; by default, PATH is ".", the current working  
 directory.  
  
 With the template= keyword, a template Makefile is written, which  
 you can use as a starting point, filling in all the necessary  
 information by hand.  In this case, make makes no further checks  
 on the contents of the directory.  In the first form, the name of  
 the Makefile template is "Makefile", but if the template= keyword  
 is a string, that name is used instead.  The template Makefile  
 will not function at all until you edit it.  
  
 Alternatively, without the template= keyword, make looks at the  
 contents of the directory, and fills in as much of the Makefile  
 as it can using what it sees.  There are two cases:  
 1. A Makefile (or makefile) already exists.  Provided the file  
    contains a Y_MAKEDIR= line, make merely updates Y_MAKEDIR,  
    Y_EXE, and Y_EXE_PKGS to reflect this running yorick, and  
    attempts no other modifiactions of the existing Makefile.  
 2. No such Makefile exists.  Then make writes a template Makefile,  
    and reads all the .i interpreted source files, .c and .h C source  
    files, and .f or .F or .m Fortran source files in the directory,  
    filling in as much of the Makefile as possible.  In simple cases,  
    the resulting Makefile will be perfectly adequate.  (If there  
    is any Fortran source, however, it will never be adequate.)  
  
 In case 2, the following steps are taken:  
 A. Any .i files containing lines of the form  
     plug_in, "pkname"  
   or  
     if (!is_void(plug_in)) plug_in, "pkgname"  
   are identified as the "package include file(s)" which define  
   the interpreted API for the package.  The make function takes  
   the name of the package from the "pkgname" in these lines.  
   At least one .i file must contain at least one plug_in line;  
   at most one "pkgname" must occur in all the plug_in lines in  
   all the .i files in the directory.  This information is used  
   to fill in the PKG_NAME macro and the PKG_I macro in the  
   Makefile (the latter becomes a list of every .i file containing  
   a plug_in statement).  
 B. All .c, .f, .F, or .m files are assumed to be required compiled  
   source, and the OBJS macro in the Makefile is set to a list of  
   all corresponding .o object files.  
 C. If there are any .h C header files in the directory, every .c  
   C source file is scanned for an include directive which reads  
   the header.  An approriate dependency line for each .o file which  
   is discovered to depend on local .h files in this manner.  
 These steps will be sufficient to produce a finished Makefile in  
 many simple cases; an example is given in the extend/ directory of  
 the yorick distribution (a compiled complementary error function).  
  
 However, it is impossible for yorick to automatically discover  
 complicated Makefile rules your package may require.  The most  
 common example is dependency on a third party library, which  
 requires a -l loader option, and very possibly a -L option as  
 well.  You need to add these flags to PKG_DEPLIBS in the Makefile  
 by hand.  If you want such a package to be buildable by non-experts,  
 you will need to provide a configure script in order to fill in  
 the required information across a wide variety of platforms.  This  
 can be exceptionally challenging, which is why yorick itself has  
 no dependencies beyond what is guaranteed to be present on every  
 system where it can run (libc, libm, and, on Unix systems, libX11).  
  
 Once the Makefile has been built it becomes part of the source code  
 of your package, and should not be removed.  (You may want it to  
 have an include directive to get the results of any configure script  
 which must be run, however.)  Thereafter, use  
   yorick -batch make.i  
   (or simply make in a running yorick)  
 to set Y_MAKEDIR, Y_EXE, and Y_EXE_PKGS appropriately for the  
 particular platform where you are building (case 1 above).  
  
 Read Y_HOME/Makepkg for a description of the various make targets  
 available.  In a nutshell:  
   make debug          builds a debugging version (never a plugin)  
   make                builds a release version (a plugin if possible)  
   make install        installs the release version (may require root)  
   make clean          removes all results, leaving only original source  
  
   Interpreted function, defined at i/make.i   line 6  

SEE ALSO: plug_in,   autoload,   cd  
 
 
 

make_despace

    make_despace  


  
     Interpreted function, defined at i/make.i   line 339  

 

make_sphere

    make_sphere(radius, [imax,jmax,kmax],  
    [phi1, phi2], [theta1, theta2])  


return a mesh (see hex_mesh) representing the given section  
of the sphere of given RADIUS.  IMAX, JMAX, and KMAX are the  
number of nodes (cells+1) in the radial, longitude (phi), and  
colatitude (theta) directions, respectively.  Note that for  
a right handed coordinate system, phi1theta2.  
Interpreted function, defined at i0/hex.i   line 539  

SEE ALSO: hex_mesh  
 
 
 

make_subst

    make_subst  


  
     Interpreted function, defined at i/make.i   line 289  

 

matchbc

    matchbc  


  
     Interpreted function, defined at i/demo1.i   line 110  

 

max

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


returns the scalar maximum value of its array argument, or, if  
more than one argument is supplied, returns an array of the  
maximum value for each array element among the several arguments.  
In the multi-argument case, the arguments must be conformable.  
Builtin function, documented at i0/std.i   line 811  

SEE ALSO: min,   sum,   avg  
 
 
 

md5

    state = md5(data)  
    state = md5(data, state)  
    digest = md5(state)  
    digest = md5(state, hex=1)  


  compute MD5 digest of data, an array of 16 char  
  with the hex=1 keyword, returned digest is a string (in hex)  
  
   Interpreted function, defined at i/md5.i   line 36  

SEE ALSO: md5sum  
 
 
 

md5sum

    digest = md5sum(filename)  
    digest = md5sum(filename, hex=1)  


  compute MD5 digest of a file, an array of 16 char  
  with the hex=1 keyword, returned digest is a string (in hex)  
  
   Interpreted function, defined at i/md5.i   line 10  

SEE ALSO: md5  
 
 
 

median

    median(x)  
 or median(x, which)  


returns the median of the array X.  The search for the median takes  
place along the dimension of X specified by WHICH.  WHICH defaults  
to 1, meaning the first index of X.  The median function returns an  
array with one fewer dimension than its argument X (the WHICH  
dimension of X is missing in the result), in exact analogy with  
rank reducing index range functions.  If dimsof(X)(WHICH) is  
odd, the result will have the same data type as X; if even, the  
result will be a float or a double, since the median is defined  
as the arithmetic mean between the two central values in that  
case.  
Interpreted function, defined at i0/std.i   line 1231  

SEE ALSO: sort  
 
 
 

merge

    merge(true_expr, false_expr, condition)  


returns the values TRUE_EXPR or FALSE_EXPR where CONDITION is  
non-zero or zero, respectively.  The result has the data type of  
TRUE_EXPR or FALSE_EXPR, promoted to the higher arithmetic type  
if necessary.  The result has the dimensions of CONDITION.  
The number of elements in TRUE_EXPR must match the number of  
non-zero elements of CONDITION, and the number of elements in  
FALSE_EXPR must match the number of zero elements of CONDITION.  
(TRUE_EXPR or FALSE_EXPR should be nil if there are no such  
elements of CONDITION.  Normally, TRUE_EXPR and FALSE_EXPR should  
be 1-D arrays if they are not nil.)  
This function is intended for vectorizing a function whose  
domain is divided into two or more parts, as in:  
   func f(x) {  
     big= (x>=threshhold);  
     wb= where(big);  
     ws= where(!big);  
     if (is_array(wb)) {  
       xx= x(wb);  
       fb=   
     }  
     if (is_array(ws)) {  
       xx= x(ws);  
       fs=   
     }  
     return merge(fb, fs, big);  
   }  
Builtin function, documented at i0/std.i   line 894  

SEE ALSO: mergef,   merge2,   where  
 
 
 

merge2

    merge2(true_expr, false_expr, condition)  


returns the values TRUE_EXPR or FALSE_EXPR where CONDITION is  
non-zero or zero, respectively.  The result has the data type of  
TRUE_EXPR or FALSE_EXPR, promoted to the higher arithmetic type  
if necessary.  Unlike the merge function, TRUE_EXPR and FALSE_EXPR  
must be conformable with each other, and with the CONDITION.  
Interpreted function, defined at i0/std.i   line 925  

SEE ALSO: merge,   where,   mergef  
 
 
 

merge_n

    merge_n(val1,mask1, val2,mask2, ...)  


return array with shape of MASKi (which must all have same shape)  
and values VALi where MASKi is true.  Unspecified values will be  
zero; the data type of the result is the data type of the first  
non-nil VALi.  Each VALi must be a 1D array of length sum(MASKi!=0).  
 Interpreted function, defined at i/dawson.i   line 161  

SEE ALSO: any_in,   merge  
 
 
 

mergef

    y = mergef(x, f1, cond1, f2, cond2, ... felse)  


  Evaluate F1(X(where(COND1))), F2(X(where(COND2))),  
  and so on, until FELSE(X(where(!(COND1 | COND2 | ...))))  
  and merge all the results back into an array Y with the  
  same dimensions as X.  Each of the CONDi must have the  
  same dimensions as X, and they must be mutally exclusive.  
  
  During the evaluation of Fi, note that all of the local  
  variables of the caller of mergef are available.  The  
  Fi are invoked as Fi(X(mergel)) and  the variable mergel  
  = where(CONDi) is available to the Fi, in case they need  
  to extract any additional parameters.  If noneof(CONDi)  
  then Fi will not be called at all, otherwise, the Fi are  
  invoked in order.  The return value of Fi must have the same  
  shape as its argument (which will be a 1D array or scalar).  
  
  Use mergeg to construct secondary results the same shape  
  as X and Y.  
  
   Interpreted function, defined at i0/std.i   line 947  

SEE ALSO: mergeg,   merge  
 
 
 

mergeg

    z = mergeg(z, value)  
 or z = mergeg(z)  


  If secondary results are to be returned from a mergef, besides  
  its return value, the Fi may construct them using the second  
  form of mergef:  
    z = mergeg(z, value)  
  where z is a variable in the original caller of mergef,  
  and value is its value where(CONDi).  Note that the variable  
  name of the first parameter must be the same as the variable  
  name it is assigned to in this construction -- that variable  
  is being used to hold the state of z as it is built.  After  
  the outer mergef returns, the caller needs to invoke  
    z = mergeg(z)  
  one final time to complete each secondary return value.  
  
  z = [];  
  y = mergef(x, f1, cond, f2);  
  z = mergeg(z);  
  ...  
  func f1(x) {   
    z = mergeg(z, exprz(x));  
    return expry(x);  
  }  
  func f2(x) {   
    z = mergeg(z, exprz(x));  
    return expry(x);  
  }  
  
   Interpreted function, defined at i0/std.i   line 993  

SEE ALSO: mergef,   merge  
 
 
 

mesh3

    mesh3(x,y,z)  
 or mesh3(x,y,z, f1,f2,...)  
 or mesh3(xyz, f1,f2,...)  
 or mesh3(nxnynz, dxdydz, x0y0z0, f1,f2,...)  


make mesh3 argument for slice3, xyz3, getv3, etc., functions.  
X, Y, and Z are each 3D coordinate arrays.  The optional F1, F2,  
etc. are 3D arrays of function values (e.g. density, temperature)  
which have one less value along each dimension than the coordinate  
arrays.  The "index" of each zone in the returned mesh3 is  
the index in these cell-centered Fi arrays, so every index from  
one through the total number of cells indicates one real cell.  
The Fi arrays can also have the same dimensions as X, Y, or Z  
in order to represent point-centered quantities.  
If X has four dimensions and the length of the first is 3, then  
it is interpreted as XYZ (which is the quantity actually stored  
in the returned cell list).  
If X is a vector of 3 integers, it is interpreted as [nx,ny,nz]  
of a uniform 3D mesh, and the second and third arguments are  
[dx,dy,dz] and [x0,y0,z0] respectively.  (DXDYDZ represent the  
size of the entire mesh, not the size of one cell, and NXNYNZ are  
the number of cells, not the number of points.)  
Interpreted function, defined at i/slice3.i   line 66  

SEE ALSO: slice3,   xyz3,   getv3,   getc3  
 
 
 

mesh_loc

    mesh_loc(y0, x0)  
 or mesh_loc(y0, x0, y, x)  
 or mesh_loc(y0, x0, y, x, ireg)  


returns the zone index (=i+imax*(j-1)) of the zone of the mesh  
(X,Y) (with optional region number array IREG) containing the  
point (X0,Y0).  If (X0,Y0) lies outside the mesh, returns 0.  
Thus, eg- ireg(mesh_loc(x0, y0, y, x, ireg)) is the region number of  
the region containing (x0,y0).  If no mesh specified, uses default.  
X0 and Y0 may be arrays as long as they are conformable.  
For mesh_loc wrappers to duplicate the functionality of the  
digitize and interp functions in 2D, see the library file digit2.i.  
After #include "digit2.i", type:  help,digit2  
Builtin function, documented at i0/graph.i   line 1352  

SEE ALSO: plmesh,   moush,   mouse  
 
 
 

min

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


returns the scalar minimum value of its array argument, or, if  
more than one argument is supplied, returns an array of the  
minimum value for each array element among the several arguments.  
In the multi-argument case, the arguments must be conformable.  
Builtin function, documented at i0/std.i   line 801  

SEE ALSO: max,   sum,   avg  
 
 
 

mkdir

    mkdir, directory_name  
    rmdir, directory_name  


Create DIRECTORY_NAME with mkdir, or remove it with rmdir.  
The rmdir function only works if the directory is empty.  
Builtin function, documented at i0/std.i   line 2478  

SEE ALSO: cd,   lsdir,   get_cwd,   get_home  
 
 
 

mkdoc

    mkdoc, filename  
 or mkdoc, filename, outname, lpp  


alphabetizes and indexes the DOCUMENT comments in FILENAME, and  
formats into "dictionary-like" pages for printing.  If OUTNAME  
is not given or nil, the output file will be FILENAME with ".doc"  
replacing the ".i".  If LPP is not given, it defaults to 58 --  
the maximum number of available lines per page of output.  
(Use 55 to be able to print with "lpr -p" style page headings.)  
FILENAME can be an array of strings to combine several include  
files into a single document.  
Interpreted function, defined at i/mkdoc.i   line 10  

SEE ALSO: help  
 
 
 

mkdoc_cross

    mkdoc_cross  


  
     Interpreted function, defined at i/mkdoc.i   line 206  

 

mkdoc_page

    mkdoc_page  


  
     Interpreted function, defined at i/mkdoc.i   line 258  

 

mkdoc_scan

    mkdoc_scan  


  
     Interpreted function, defined at i/mkdoc.i   line 144  

 

mkdoc_title

    mkdoc_title  


  
     Interpreted function, defined at i/mkdoc.i   line 218  

 

mnbrent

    fmin= mnbrent(f, x0, x1, x2)  
 or fmin= mnbrent(f, x0, x1, x2, xmin)  
 or fmin= mnbrent(f, x0, x1, x2, xmin, xerr)  


returns the minimum of the function F (of a single argument x),  
given three points X0, X1, and X2 such that F(X1) is less than  
either F(X0) or F(X2), and X1 is between X0 and X2.  If the  
XMIN argument is provided, it is set to the x value which  
produced FMIN.  If XERR is supplied, the search stops when  
a fractional error of XERR in x is reached; note that XERR  
smaller than the square root of the machine precision (or  
omitted) will cause convergence to machine precision in FMIN.  
The algorithm is Brent's method - a combination of inverse  
parabolic interpolation and golden section search - as adapted  
from Numerical Recipes Ch. 10 (Press, et. al.).  
Interpreted function, defined at i/roots.i   line 235  

SEE ALSO: mxbrent,   nraphson,   f_inverse  
 
 
 

mod_midpt

    mod_midpt  


  
     Interpreted function, defined at i/rkutta.i   line 320  

 

moon

    xyz = moon(time)  


return position XYZ of the moon relative to center of earth  
at TIME; the XYZ has leading dimension 3; x is along the vernal  
equinox, z is ecliptic north.  The corrections to the lunar orbit  
are from Schlyter (see sch_moon).  Claimed accurate to 2 arc minutes  
over some reasonable time.  TIME is in days since 0/Jan/00 (that is,  
0000 UT 31/Dec/99).  This is 1.5 days earlier than the J2000 epoch.  
Interpreted function, defined at i/kepler.i   line 261  

SEE ALSO: solar_system,   sch_moon,   kepler  
 
 
 

mouse

    result= mouse(system, style, prompt)  


displays a PROMPT, then waits for a mouse button to be pressed,  
then released.  Returns array of eleven doubles:  
  result= [x_pressed, y_pressed, x_released, y_released,  
           xndc_pressed, yndc_pressed, xndc_released, yndc_released,  
           system, button, modifiers]  
If SYSTEM>=0, the first four coordinate values will be relative to  
that coordinate system.  
For SYSTEM<0, the first four coordinate values will be relative to  
the coordinate system under the mouse when the button was pressed.  
The second four coordinates are always normalized device coordinates,  
which start at (0,0) in the lower left corner of the 8.5x11 sheet of  
paper the picture will be printed on, with 0.0013 NDC unit being  
1/72.27 inch (1.0 point).  Look in the style sheet for the location  
of the viewport in NDC coordinates (see the style keyword).  
If STYLE is 0, there will be no visual cues that the mouse  
command has been called; this is intended for a simple click.  
If STYLE is 1, a rubber band box will be drawn; if STYLE is 2,  
a rubber band line will be drawn.  These disappear when the  
button is released.  
Clicking a second button before releasing the first cancels the  
mouse function, which will then return nil.  
Ordinary text input also cancels the mouse function, which again  
returns nil.  
The left button reverses forground for background (by XOR) in  
order to draw the rubber band (if any).  The middle and right  
buttons use other masks, in case the rubber band is not visible  
with the left button.  
long(result(9)) is the coordinate system in which the first four  
coordinates are to be interpreted.  
long(result(10)) is the button which was pressed, 1 for left, 2  
for middle, and 3 for right (4 and 5 are also possible).  
long(result(11)) is a mask representing the modifier keys which  
were pressed during the operation: 1 for shift, 2 for shift lock,  
4 for control, 8 for mod1 (alt or meta), 16 for mod2, 32 for mod3,  
64 for mod4, and 128 for mod5.  
Holding the shift key and pressing the left mouse button is  
equivalent to pressing the middle mouse button.  Similarly,  
pressing meta-left is equivalent to the right button.  This  
permits access to the middle and right button functions on  
machines (e.g.- most laptops) with two button or one button  
mice.  The long(result(10)) value returned by mouse() reflects  
this convention, returning 2 or 3 for those cases, even though  
it is button 1 that is actually being pressed.  Therefore, there  
is no way to distinguish shift-left from shift-middle, because the  
long(result(11)) mask indicates tht the shift button is pressed  
in either case.  (And on a machine without a middle button,  
there would be no way to emulate shift-middle anyway.)  
Builtin function, documented at i0/graph.i   line 1370  

SEE ALSO: moush  
 
 
 

moush

    moush()  
 or moush(y, x, ireg)  


returns the 1-origin zone index for the point clicked in  
for the default mesh, or for the mesh (X,Y) (region array IREG).  
Interpreted function, defined at i0/graph.i   line 1429  

 

mov3

    mov3, xa,ya,za  


move the current 3D plot by XA along viewer's x-axis,  
YA along viewer's y-axis, and ZA along viewer's z-axis.  
Interpreted function, defined at i/pl3d.i   line 85  

SEE ALSO: rot3,   orient3,   setz3,   undo3,   save3,   restore3,   light3  
 
 
 

movie

    movie, draw_frame  
 or movie, draw_frame, time_limit  
 or movie, draw_frame, time_limit, min_interframe  


  runs a movie based on the given DRAW_FRAME function.  The movie  
  stops after a total elapsed time of TIME_LIMIT seconds, which  
  defaults to 60 (one minute), or when the DRAW_FRAME function  
  returns zero.  
  func draw_frame(i)  
  {  
    // Input argument i is the frame number.  
    // draw_frame should return non-zero if there are more  
    // frames in this movie.  A zero return will stop the  
    // movie.  
    // draw_frame must NOT include any fma command if the  
    // making_movie variable is set (movie sets this variable  
    // before calling draw_frame)  
  }  
  If MIN_INTERFRAME is specified, a pauses will be added as  
  necessary to slow down the movie.  MIN_INTERFRAME is a time  
  in seconds (default 0).  
  The keyword bracket_time= (again a time in seconds) can be  
  used to adjust the duration of the pauses after the first  
  and last frames.  It may also be a two element array [beg, end].  
  If the pause at the end is greater than five seconds, you will  
  be prompted to explain that hitting  will abort the final  
  pause.  
  If every frame of your movie has the same limits, use the  
  limits command to fix the limits before you call movie.  
BUG:  If you hit  to start a movie early, it will not  
      pause at the end of the movie at all.  You probably should  
      not use long initial pauses.  
  Interpreted function, defined at i/movie.i   line 10  

SEE ALSO: movie_stats  
 
 
 

movie_stats

    movie_stats  
 or movie_stats, timing  


prints statistics from the last movie command, or from the  
command which produced TIMING.  TIMING is the contents of the  
movie_timing external variable after the movie command completes.  
Interpreted function, defined at i/movie.i   line 116  

SEE ALSO: movie  
 
 
 

mpeg_close

    mpeg_close, mpeg  


  
Close the mpeg file corresponding to the MPEG encoder.  Actually,  
this merely destroys the reference to the encoder; the file will  
remain open until the final reference is destroyed.  
  
   Interpreted function, defined at i0/mpeg.i   line 45  

SEE ALSO: mpeg_create,   mpeg_write,   mpeg_movie  
 
 
 

mpeg_create

    mpeg = mpeg_create(filename)  
 or mpeg = mpeg_create(filename, params)  


  
Create an mpeg-1 movie file FILENAME.  Write frames with mpeg_write,  
close with mpeg_close.  The return value is an mpeg encoder object.  
  
If given, PARAMS is [bit_rate, frame_rate, gop_size, max_b_frames]  
   which default to [ 400000,      25,       10,         1       ]  
The rates are per second, the gop_size is the number of frames  
before an I-frame is emitted, and max_b_frames is the largest  
number of consecutive B-frames.  (The third kind of frame is the  
P-frame; generally, the encoder emits B-frames until it is forced  
to emit a P-frame by max_b_frames, or an I-frame by gop_size.  The  
smaller these numbers, the higher quality the movie, but the lower  
the compression.)  Any of the four PARAMS values may be zero to  
get the default value, except for max_b_frames, which should be <0  
to get the default value.  
  
   Builtin function, documented at i0/mpeg.i   line 9  

SEE ALSO: mpeg_write,   mpeg_close,   mpeg_movie  
 
 
 

mpeg_movie

    mpeg_movie, filename, draw_frame  
 or mpeg_movie, filename, draw_frame, time_limit  
 or mpeg_movie, filename, draw_frame, time_limit, min_interframe  


  
An extension of the movie function (#include "movie.i") that generates  
an mpeg file FILENAME.  The other arguments are the same as the movie  
function (which see).  The draw_frame function is:  
  
  func draw_frame(i)  
  {  
    // Input argument i is the frame number.  
    // draw_frame should return non-zero if there are more  
    // frames in this movie.  A zero return will stop the  
    // movie.  
    // draw_frame must NOT include any fma command if the  
    // making_movie variable is set (movie sets this variable  
    // before calling draw_frame)  
  }  
  
   Interpreted function, defined at i0/mpeg.i   line 58  

SEE ALSO: movie,   mpeg_create,   mpeg_write,   mpeg_close  
 
 
 

mpeg_write

    mpeg_write, mpeg, rgb  


  
Write a frame RGB into the mpeg file corresponding to the MPEG  
encoder returned by mpeg_create. RGB is a 3-by-width-by-height  
array of char.  Every frame must have the same width and height.  
To finish the movie and close the file, call mpeg_close.  
  
Note that you may have trouble rendering the resulting mpeg  
file if the image width and height are note multiples of 8.  
  
   Builtin function, documented at i0/mpeg.i   line 31  

SEE ALSO: mpeg_create,   mpeg_close,   mpeg_movie  
 
 
 

msort

    msort(x1, x2, x3, ...)  


returns an index list which sorts the array X1 into increasing  
order.  Where X1 values are equal, the list will sort X2 into  
increasing order.  Where both X1 and X2 are equal, X3 will be  
in increasing order, and so on.  Finally, where all of the keys  
are equal, the returned list will leave the order unchanged  
from the input keys.  
The Xi may be numbers or strings (e.g.- X1 could be an integer  
while X2 was a string, and X3 was a real).  The Xi must all be  
conformable, and each dimension of X1 must be as large as the  
corresponding dimension of any otehr Xi.  
Hence, msort(x) will return the same list as sort(x), except  
where the values of x are equal, in which case msort leaves  
the order unchanged, while sort non-deterministically permutes  
equal elements.  This feature may cost a factor of two in speed,  
so don't use it unless you really need it.  In general, msort  
will call sort up to twice per input argument.  
Interpreted function, defined at i/msort.i   line 10  

SEE ALSO: sort,   msort_rank  
 
 
 

msort_rank

    msort_rank(x)  
    msort_rank(x, list)  


returns a list of longs the same size and shape as X, whose  
values are the "rank" of the corresponding element of X among  
all the elements of X -- the smallest element has rank 0 and  
the largest has the largest rank, which is equal to one less  
than the number of distinct values in the array X.  
If LIST is present, it is set to the order list returned by  
sort(x(*)).  
Interpreted function, defined at i/msort.i   line 55  

SEE ALSO: msort,   sort  
 
 
 

multi_bav

    multi_bav(gav)  


returns bin boundaries for the bin centers gav.  
The bin boundaries are taken at the geometric means between  
consecutive gav(i), with the endpoints extended slightly beyond  
the endpoints of gav.  
Interpreted function, defined at i/multi.i   line 1141  

 

multi_bins

    multi_bins(mf)  


The MF parameter is an array of MultiFiles, each created by multif.  
Automatically generates the bin structure which will be used by  
multi_streak (if the GB keyword is not specified).  
Interpreted function, defined at i/multi.i   line 432  

 

multi_line

    gb= multi_line(nbins, hnu0, dhnu, dhnu_min)  


returns 2*NBINS+1 bin boundary energies for 2*NBINS bins  
cenetered around a spectral line at HNU0 of width DHNU.  The  
result begins at HNU0-DHNU and ends at HNU0+DHNU.  The finest  
two bins (nearest HNU0) has width DHNU_MIN, and the remaining  
bins have equal ratio widths as you move away from HNU0.  
Interpreted function, defined at i/multi.i   line 1229  

 

multi_no_dups

    xnd= multi_no_dups(x)  


returns its input vector X with any duplicate values removed.  
X must be non-decreasing and of length at least two.  
Interpreted function, defined at i/multi.i   line 1253  

 

multi_streak

    result= multi_streak(mf, rays, slimits, gb=common_bins)  


like the streak function, but allows opacity to be built up from  
"slave files", in addition to the "master file" MF(1).  The MF  
parameter is an array of MultiFiles, each created by multif.  
The master file MF(1) contains the mesh, and the master list of dump  
times.  Only dump times which are present in this master list, and  
in every slave file, will be processed.  
The master file MF(1) need not contain any opacity or emissivity data  
at all; each of the slave files MF(2:0) must contain data for at  
least one zone.  
The emissivities and opacities from each file are interpolated onto  
a common group structure.  This common group structure can be  
provided via the GB keyword to multi_streak.  If it is not provided,  
GB is computed by examining the group boundary (or center) arrays  
from the master and every slave file, and building a group structure  
which is at least as fine as every component group structure, at every  
point in the spectrum.  
Example:  
  File family "prob_p00" contains the mesh and opacities and  
  emissivities for all zones.  Family "pp_h00" contains post  
  processed opacities and emissivities on a much finer spectral  
  mesh, but only for zones in regions 1 and 2 of the original  
  problem.  You want to transport the emission from the  
  inner regions 1 and 2 through the overlying material:  
    restore, openb("prob_p00"), ireg;  
    master= multif("prob_p00", zoneuse=where(ireg>2));  
    slave= multif("pp_h00", zonelist=where(ireg==1|ireg==2));  
    rays= ...  
    slimits= ...  
    drat_start= ...  
    drat_stop= ...  
    result= multi_streak([master,slave], rays, slimits);  
    multic, master;  
    multic, slave;  
Interpreted function, defined at i/multi.i   line 251  

SEE ALSO: multio,   multic,   multif,   MultiFile,   multi_opac,   multi_emiss,  
multi_srcf,   multi_gb,   multi_gav,   multi_zonelist,   multi_times,  
multi_bins  

 
 
 

multi_streak_save

    multi_streak_save, outname, mf, rays, slimits, gb=common_bins  
 or multi_streak_save, outfile, mf, rays, slimits, gb=common_bins  


like the streak function, but allows opacity to be built up from  
"slave files", in addition to the "master file" MF(1) and   
saves the streak in a PDB history file.  The MF parameter  
is an array of MultiFiles, each created by multif.  
The master file MF(1) contains the mesh, and the master list of dump  
times.  Only dump times which are present in this master list, and  
in every slave file, will be processed.  
The master file MF(1) need not contain any opacity or emissivity data  
at all; each of the slave files MF(2:0) must contain data for at  
least one zone.  
If the first argument is OUTFILE, a file variable instead of a  
file name, then that file is used for output.  You can create  
OUTFILE and add static variables to it with save (but do NOT call  
add_record) which streak_save otherwise wouldn't know about.  
The output file has history records at the same times as the  
input file.  Each record contains "time" (a double scalar),  
and the two arrays "transp", the transparency (between 0 and 1),  
and "selfem", the self emission (which has the same units as  
ekap in the file F).  The dimensions of transp and selfem  
are ngroup-by-2-by-nrays (where nrays represents zero or more  
dimensions, copied from the RAYS input array).  The RAYS and  
SLIMITS inputs are placed into the output file as non-record  
variables, and any variables in the drat_static option are  
copied form F to the output file.  The gb and gav variables  
are copied from F into the output file as well.  If the drat_glist  
option is present, that is stored in the output file also.  
The emissivities and opacities from each file are interpolated onto  
a common group structure.  This common group structure can be  
provided via the GB keyword to multi_streak.  If it is not provided,  
GB is computed by examining the group boundary (or center) arrays  
from the master and every slave file, and building a group structure  
which is at least as fine as every component group structure, at every  
point in the spectrum.  
Example:  
  File family "prob_p00" contains the mesh and opacities and  
  emissivities for all zones.  Family "pp_h00" contains post  
  processed opacities and emissivities on a much finer spectral  
  mesh, but only for zones in regions 1 and 2 of the original  
  problem.  File "prob_strk" contains the streak history.   
  You want to transport the emission from the  
  inner regions 1 and 2 through the overlying material:  
    restore, openb("prob_p00"), ireg;  
    master= multif("prob_p00", zoneuse=where(ireg>2));  
    slave= multif("pp_h00", zonelist=where(ireg==1|ireg==2));  
    fout= openb("prob_strk");  
    save, fout, kmax, lmax;  
    rays= ...  
    slimits= ...  
    drat_start= ...  
    drat_stop= ...  
    result= multi_streak_save(fout, [master,slave], rays, slimits);  
    multic, master;  
    multic, slave;  
Interpreted function, defined at i/multi.i   line 312  

SEE ALSO: multio,   multic,   multif,   MultiFile,   multi_streak,   multi_opac,  
multi_emiss,   multi_srcf,   multi_gb,   multi_gav,   multi_zonelist,  
multi_times,   multi_bins  

 
 
 

multi_times

    times= multi_times(mf)  


returns the list of times which will be used by multi_streak.  This  
is the subset of streak_times(mf(1)) which occur in all of the slave  
files.  The drat_start and drat_stop times work as usual.  
Interpreted function, defined at i/multi.i   line 471  

 

multic

    multic, mf  
 or multic, [mf1, mf2, mf3, ...]  


closes a MultiFile created with multif.  
Presented with an array of multifiles, closes them all.  
Interpreted function, defined at i/multi.i   line 217  

SEE ALSO: multio,   multif  
 
 
 

multif

    multif(mf)  


returns an ordinary file pointer for the MultiFile MF.  
Do not use close to close this pointer; just set it to [] when  
you are done.  Use multic to properly close the MF.  
Interpreted function, defined at i/multi.i   line 240  

SEE ALSO: multio,   multic  
 
 
 

multio

    mf= multio(filename)  
 or mf= multio(file)  


opens file FILENAME for use with the multi_streak function.  
The file MUST be subsequently closed using multic, since  
this function produces a hidden reference to the file.  The function  
multif can be used to return an ordinary file pointer, given the  
returned MF structure.  If the argument is already a stream FILE,  
that file will be used.  The call still produces a hidden copy of  
FILE, so you may set your copy of the FILE variable to [], but do  
not close the file.  
The following keywords can be used to allow for variations in the  
variable names or units, and to specify the correspondence between  
the zones in this file, and the zones in the master file:  
zonelist=index_list  
-or- zonelist=zonelist_name  
  is an index list into the (rt,zt) mesh arrays of the master file.  
  If ireg is the region number array (having the same dimensions as  
  rt or zt, and with its first row and column all 0), and if FILENAME  
  contains opacity data only for zones with region numbers 1 and 2,  
  you could open the file using:  
     mf= multio(filename, zonelist=where(ireg==1 | ireg==2))  
  The zonelist should be nil only if the spatial dimensions of the  
  opacity and emissivity in this file exactly match those of rt or  
  zt in the master file.  
  If zonelist is a string, it replaces the default name for the  
  zonelist variable stored in the file (see multi_zonelist).  
zoneuse=index_list  
  The zonelist specifies how the zones in this file correspond  
  with those in the master file.  The zoneuse list allows you  
  to specify that only some of the zones actually present in the  
  opacity and emissivity arrays of this file are to contribute  
  to the total.  This might be necessary to avoid double counting  
  in a region covered by more than one file.  Hence zoneuse is  
  a list of indices into the spatial dimension(s) of the opacity  
  and emissivity arrays in this file.  If nil, all zones in this  
  file will contribute.  If present, and if zonelist is supplied  
  as an array (rather than out of the file), zonelist should  
  have the same length as zoneuse.  
  As a special case, if zoneuse is a scalar 0, no opacity or  
  emissivity will come from this file; this makes sense only if  
  this is the master file.  
opac=oname, emiss=ename, srcf=sname  
  specify non-default names for the opacity, emissivity, and  
  osource function arrays.  The defaults are given by the global  
  variables mutli_opac, multi_emiss, and multi_srcf (see help).  
  If the emissivity array is present in the file, it is preferred  
  to the source function array, which will then be ignored.  
oscale=opacity_unit, escale=emissivity_unit  
  are optional conversion factors to bring the units of the  
  opac and emiss (or srcf) arrays into agreement among the various  
  files which are to be used in a single run.  The default value  
  is 1.0 (i.e.- all files are expected to have the same units).  
gb=gbname, gav=gavname, gexist=gexistname  
-or- gexist=group_existence_map  
  specify non-default names for the group boundary, group energy,  
  and group existence arrays.  The defaults are given by the global  
  variables mutli_gb, multi_gav, and multi_gexist (see help).  
  If the group boundary array is present in the file, it is preferred  
  to the group energy array, which will then be ignored.  The file  
  should specify group boundaries if its opacity and emissivity are  
  averaged over finite width bins; group energies if its opacity  
  and emissivity are computed at points.  The group existence map,  
  if present, allows several disjoint spectral regions to exist in  
  a single file.  If the data type of gexist is not "string", it  
  should be an array of length one less than gb, if gb is present,  
  or gav, otherwise.  By this means you can ignore spectral regions  
  which are present in the file.  
gscale=photon_energy_unit  
  is an optional conversion factor to bring the units of the  
  gb (or gav) arrays into agreement among the various files  
  which are to be used in a single run.  The default value  
  is 1.0 (i.e.- all files are expected to have the same units).  
tscale=time_unit  
  is an optional conversion factor to bring the units of the  
  time into agreement among the various files which are to be used  
  in a single run.  The default value is 1.0 (i.e.- all files are  
  expected to have the same units).  
noextrap=1  
  if present and non-zero prevents the opacity and emissivity  
  data from this file from being extrapolated as 1/hnu^3 in  
  master bins at energies above the highest energy bin in this  
  file.  
freqfirst=0  
  if present and non-zero means the frequency index is first  
  for the opacity and emissivity arrays, instead of the  
  default of frequency index last.  
Interpreted function, defined at i/multi.i   line 62  

SEE ALSO: multic,   multif,   multi_streak,   MultiFile,   multi_opac,   multi_emiss,  
multi_srcf,   multi_gb,   multi_gav,   multi_zonelist  

 
 
 

mxbrent

    fmax= mxbrent(f, x0, x1, x2)  
 or fmax= mxbrent(f, x0, x1, x2, xmax)  
 or fmax= mxbrent(f, x0, x1, x2, xmax, xerr)  


returns the maximum of the function F (of a single argument x),  
given three points X0, X1, and X2 such that F(X1) is greater than  
either F(X0) or F(X2), and X1 is between X0 and X2.  If the  
XMAX argument is provided, it is set to the x value which  
produced FMAX.  If XERR is supplied, the search stops when  
a fractional error of XERR in x is reached; note that XERR  
smaller than the square root of the machine precision (or  
omitted) will cause convergence to machine precision in FMAX.  
The algorithm is Brent's method - a combination of inverse  
parabolic interpolation and golden section search - as adapted  
from Numerical Recipes Ch. 10 (Press, et. al.).  
Interpreted function, defined at i/roots.i   line 210  

SEE ALSO: mxbrent,   nraphson,   f_inverse