GNU-Darwin Web
section r of routines in global.i

Home

Manual

Packages

Global Index

Keywords

Quick Reference

# all functions - r

 random random(dimension_list) random_seed, seed returns an array of random double values with the given DIMENSION_LIST (nil for a scalar result), uniformly distributed on the interval from 0.0 to 1.0. The algorithm is from Press and Teukolsky, Computers in Physics, vol. 6, no. 5, Sep/Oct 1992 (ran2). They offer a reward of \$1000 to anyone who can exhibit a statistical test that this random number generator fails in a "non-trivial" way. The random_seed call reinitializes the random number sequence; SEED should be between 0.0 and 1.0 non-inclusive; if SEED is omitted, nil, or out of range, the sequence is reinitialized as when Yorick starts. The numbers are actually at the centers of 2147483562 equal width bins on the interval [0,1]. Although only these 2 billion numbers are possible, the period of the generator is roughly 2.3e18. builtin function, documented at i0/std.i line 667 SEE ALSO: randomize

 random_ipq random_ipq(ipq_model, dimlist) returns an array of double values with the given DIMLIST (see array function, nil for a scalar result). The numbers are distributed according to a piecewise linear function (possibly with power law or exponential tails) specified by the IPQ_MODEL. The "IPQ" stands for "inverse piecewise quadratic", which the type of function required to transform a uniform random deviate into the piecewise linear distribution. Use the ipq_setup function to compute IPQ_MODEL. interpreted function, defined at i/random.i line 178 SEE ALSO: random,   random_x,   random_u,   random_n,   random_rej,   ipq_setup

 random_n random_n(dimlist) returns an array of normally distributed random double values with the given DIMLIST (see array function, nil for a scalar result). The mean is 0.0 and the standard deviation is 1.0. The algorithm follows the Box-Muller method (see Numerical Recipes by Press et al.). interpreted function, defined at i/random.i line 129 SEE ALSO: random,   random_x,   random_u,   random_ipq,   random_rej

 random_rej random_rej(target_dist, ipq_model, dimlist) or random_rej(target_dist, bounding_dist, bounding_rand, dimlist) returns an array of double values with the given DIMLIST (see array function, nil for a scalar result). The numbers are distributed according to the TARGET_DIST function: func target_dist(x) returning u(x)>=0 of same number and dimensionality as x, normalized so that the integral of target_dist(x) from -infinity to +infinity is 1.0. The BOUNDING_DIST function must have the same calling sequence as TARGET_DIST: func bounding_dist(x) returning b(x)>=u(x) everywhere. Since u(x) is normalized, the integral of b(x) must be >=1.0. Finally, BOUNDING_RAND is a function which converts an array of uniformly distributed random numbers on (0,1) -- as returned by random -- into an array distributed according to BOUNDING_DIST: func bounding_rand(uniform_x_01) Mathematically, BOUNDING_RAND is the inverse of the integral of BOUNDING_DIST from -infinity to x, with its input scaled to (0,1). If BOUNDING_DIST is not a function, then it must be an IPQ_MODEL returned by the ipq_setup function. In this case BOUNDING_RAND is omitted -- ipq_compute will be used automatically. interpreted function, defined at i/random.i line 198 SEE ALSO: random,   random_x,   random_u,   random_n,   random_ipq,   ipq_setup

 random_seed random_seed builtin function, documented at i0/std.i line 667 SEE random

 random_u random_u(a, b, dimlist) return uniformly distributed random numbers between A and B. (Will never exactly equal A or B.) The DIMLIST is as for the array function. Same as (b-a)*random(dimlist)+a. If A==0, you are better off just writing B*random(dimlist). interpreted function, defined at i/random.i line 112 SEE ALSO: random,   random_x,   random_n,   random_ipq,   random_rej

 random_x random_x(dimlist) same as random(DIMLIST), except that random_x calls random twice at each point, to avoid the defect that random only can produce about 2.e9 numbers on the interval (0.,1.) (see random for an explanation of these bins). You may set random=random_x to get these "better" random numbers in every call to random. Unlike random, there is a chance in 1.e15 or so that random_x may return exactly 1.0 or 0.0 (the latter may not be possible with IEEE standard arithmetic, while the former apparently is). Since cosmic rays are far more likely, you may as well not worry about this. Also, because of rounding errors, some bit patterns may still be more likely than others, but the 0.5e-9 wide bins of random will be absent. interpreted function, defined at i/random.i line 73 SEE ALSO: random

 randomize randomize randomize() set the seed for random "randomly" (based on the timer clock and the current state of random). As a function, returns the value of the seed passed to random_seed. interpreted function, defined at i0/std.i line 689 SEE ALSO: random,   random_seed

 range range, ymin, ymax sets the y-axis plot limits in the current coordinate system to YMIN, YMAX, which may be nil or omitted to leave the corresponding limit unchanged, a number to fix the corresponding limit to a specified value, or the string "e" to make the corresponding limit take on the extreme value of the currently displayed data. Use limits, xmin, xmin to accomplish the same function for the x-axis plot limits. interpreted function, defined at i0/graph.i line 716 SEE ALSO: plsys,   limits,   logxy,   plg

 range3 range3, zmin,zmax Set the 3D axis z limits for use with the cage. Use keyword aspect=[ax,ay,az] to set the aspect ratios of the cage to ax:ay:az -- that is, the ratios of the lengths of the cage axes will become ax:ay:az. interpreted function, defined at i/pl3d.i line 221 SEE ALSO: cage3,   limit3,   plwf,   plwf,   orient3

 raw_not_cdf raw_not_cdf interpreted function, defined at i/netcdf.i line 57

 raw_style raw_style: get_style, set_style, read_style, write_style #include "style.i" alternatives to the style= keyword of the window command which allow the interpreter to set or get all the details of the window style. Include "style.i" and read the help for get_style. builtin function, documented at i0/graph.i line 1377

 rdline rdline(f) or rdline(f, n, prompt= pstring) returns next line from stream F (stdin if F nil). If N is non-nil, returns a string array containing the next N lines of F. If end-of-file occurs, rdline returns nil strings. If F is nil, uses the PSTRING to prompt for input (default "read> "). builtin function, documented at i0/std.i line 1348 SEE ALSO: read,   open,   close,   bookmark,   backup,   read_n

 read_clog file= read_clog(file, clog_name) raw routine to set the binary data structure of FILE according to the text description in the Contents Log file CLOG_NAME. builtin function, documented at i0/std.i line 1747

 read_n read_n, f, n0, n1, n2, ... grabs the next numbers N0, N1, N2, ... from file F, skipping over any whitespace, comma, semicolon, or colon delimited tokens which are not numbers. (Actually, only the first and last characters of the token have to look like a number -- 4xxx3 would be read as 4.) ***WARNING*** at most ten Ns are allowed The Ns can be arrays, provided all have the same dimensions. interpreted function, defined at i0/std.i line 1358 SEE ALSO: read,   rdline

 read_style read_style, file, landscape, systems, legends, clegends read a Gist style sheet (.gs file), and return the data structures as described in the get_style function. The FILE can be a filename or a text file stream. interpreted function, defined at i/style.i line 312 SEE ALSO: get_style,   set_style,   write_style

 recover_file recover_file, filename or recover_file, filename, clogfile writes the descriptive information at the end of a corrupted binary file FILENAME from its Contents Log file CLOGFILE, which is FILENAME+"L" by default. interpreted function, defined at i0/std.i line 1753

 redraw redraw redraws the X window associated with the current graphics window. builtin function, documented at i0/graph.i line 221 SEE ALSO: window,   fma,   hcp,   plg

 reform reform(x, dimlist) returns array X reshaped according to dimension list DIMLIST. In most cases, prefer this to reshape. interpreted function, defined at i/string.i line 197 SEE ALSO: array,   dimsof

 reg_track c= reg_track(x, y, z, rays, s) track RAYS through regular mesh defined by the 1D coordinate arrays X, Y, and Z. Return values S and C are as for hex5_track, where the mesh is numberof(X) by numberof(Y) by numberof(Z). builtin function, documented at i0/hex.i line 83 SEE ALSO: hex5_track,   track_reduce

 remove remove builtin function, documented at i0/std.i line 1234 SEE rename

 rename rename, old_filename, new_filename remove filename rename or remove a file. builtin function, documented at i0/std.i line 1234 SEE ALSO: open,   close,   openb

 require require builtin function, documented at i0/std.i line 1483 SEE include

 reset reset interpreted function, defined at i/demo1.i line 37

 reset_options reset_options resets all options for the streak, snap, and streak_save functions to their default values. interpreted function, defined at i0/drat.i line 856

 reshape reshape, reference, address, type, dimension_list or reshape, reference, type, dimension_list or reshape, reference The REFERENCE must be an unadorned variable, not an expression; reshape sets this variable to an LValue at the specified ADDRESS with the specified TYPE and DIMENSION_LIST. (See the array function documentation for acceptable DIMENSION_LIST formats.) If ADDRESS is an integer (e.g.- a long), the programmer is responsible for assuring that the data at ADDRESS is valid. If ADDRESS is a (Yorick) pointer, Yorick will assure that the data pointed to will not be discarded, and the reshape will fail if TYPE and DIMENSION_LIST extend beyond the pointee bounds. In the second form, ADDRESS is taken to be &REFERENCE; that is, the TYPE and DIMENSION_LIST of the variable are changed without doing any type conversion. In the third form, REFERENCE is set to nil ([]). (Simple redefinition will not work on a variable defined using reshape.) WARNING: There are almost no situations for which reshape is the correct operation. See reform in Y_SITE/i/string.i. builtin function, documented at i0/std.i line 264 SEE ALSO: array,   dimsof,   numberof,   is_array,   eq_nocopy

 restore restore builtin function, documented at i0/std.i line 2178 SEE save

 restore3 restore3, view Restore a previously saved 3D viewing transformation and lighting. If VIEW is nil, rotate object to viewer's coordinate system. interpreted function, defined at i/pl3d.i line 242 SEE ALSO: restore3,   rot3,   mov3,   aim3,   light3

 rez_adjust_mesh rez_adjust_mesh is an optional hook function which is called after any change to the mesh (e.g.- by dragging points) has been made. If it is defined, it may modify the external variables rez_rt and rez_zt. This hook can be used, for example, to force points along some k or l line to lie along a symmetry line. builtin function, documented at i/rezone.i line 130 SEE ALSO: rezone,   rez_all,   rez_mesh

 rez_chk_palette rez_chk_palette interpreted function, defined at i/rezone.i line 98

 rez_color rez_color builtin function, documented at i/rezone.i line 39 SEE rez_kstyle

 rez_ding rez_ding interpreted function, defined at i/rezone.i line 1517

 rez_drag rez_drag Allow points in the rezone mesh to be dragged around with the mouse. Press mouse button near a vertex, move mouse to desired position of that vertex, and release button. If the point where you click is less than twice the distance to the second closest point than to the nearest point, the point will not be moved (you will hear a beep when you release the button). Click on the [Undo] button to undo the previous move; you can undo up to 100 previous moves by successive [Undo] clicks. When you are finished moving points around, click on [OK]. Click on [Zoom or Pan] to change the plot limits (see rez_zoom). Click on [Set Styles] to change the line styles or colors (see rez_style). interpreted function, defined at i/rezone.i line 532 SEE ALSO: rez_ladj,   rez_radj,   rez_mesh,   rez_zoom,   rez_style

 rez_find rez_find interpreted function, defined at i/rezone.i line 1493

 rez_getrz rez_getrz interpreted function, defined at i/rezone.i line 1451

 rez_getvar rez_getvar interpreted function, defined at i/rezone.i line 1506

 rez_kstyle rez_kstyle, rez_lstyle, rez_color is a vector of three longs: [type,width,color] type MUST be 1, 2, 3, 4, or 5, width MUST be 1, 2, 3, 4, 5, 6, 7, or 8, and color MUST be -1, -2, -3, -4, -5, -6, -7, -8, -9, or -10 Either or both parameters may be set before or after including rez.i; by default: rez_kstyle= [4, 1, -2] (dashdot, thin, foreground color) rez_lstyle= [1, 1, -2] (solid, thin, foreground color) To distinguish K and L by color instead of type, try: rez_kstyle= [1, 1, -7] (dashdot, thin, blue) rez_lstyle= [1, 1, -5] (solid, thin, red) If the variable rez_color is true (non-nil and non-zero) when this file is included, then these will be the default. builtin function, documented at i/rezone.i line 39 SEE ALSO: rez_load_hook

 rez_load_hook rez_load_hook If non-nil, filename to be included immediately after rez.i. This file can be used to set personalized default values for the many parameters. Some parameters may be set before loading rez.i, as well builtin function, documented at i/rezone.i line 30 SEE ALSO: rez_kstyle,   rez_lstyle

 rez_lstyle rez_lstyle builtin function, documented at i/rezone.i line 39 SEE rez_kstyle

 rez_mark rez_mark Causes rezone functions to mark bowtied or chevroned (boomeranged) zones when the mesh is plotted. MUST have one of the following values: 0 to not mark bowtied or chevroned zones 1 to put a B at the center of the positive triangle of bowtied zones 2 to put a C at the center of the larger wing of chevroned zones 3 to mark both bowtied and chevroned zones By default, rez_mark is 3; you may set it to a different value either before or after including rez.i. builtin function, documented at i/rezone.i line 66 SEE ALSO: rez_mesh,   rez_next,   rez_prev,   rez_drag

 rez_mesh rez_mesh, rt, zt, ireg -or- rez_mesh, rt, zt -or- rez_mesh, zfile set mesh for rez_... commands. If ZFILE is specified, it must be a binary file containing variables RT, ZT, and (optionally) IREG. interpreted function, defined at i/rezone.i line 1373 SEE ALSO: rez_all,   rez_adjust_mesh

 rez_next rez_next zoom in on next bowtied (or chevroned) zone (after rez_mesh). With numeric argument, zooms to that bowtie (or chevron). With numeric argument 0, zooms to current bowtie (or chevron). interpreted function, defined at i/rezone.i line 1410 SEE ALSO: rez_prev,   rez_mark,   rez_drag

 rez_palette rez_palette 3-by-ncolors array used as a palette when rez_regs region coloring is set. The index in rez_regs is the second index into rez_palette. The length 3 first index is [r,g,b]. The default is 15 pastels. builtin function, documented at i/rezone.i line 84 SEE ALSO: rez_regs

 rez_plm rez_plm interpreted function, defined at i/rezone.i line 140

 rez_prev rez_prev zoom in on previous bowtied (or chevroned) zone (after rez_mesh). interpreted function, defined at i/rezone.i line 1442 SEE ALSO: rez_next,   rez_mark,   rez_drag

 rez_ptexist rez_ptexist interpreted function, defined at i/rezone.i line 1474

 rez_qrt rez_qrt, rez_qzt, rez_qireg are the names of the mesh variables for rez_mesh, "rt", "zt", and "ireg" by default. Note that ireg is optional. builtin function, documented at i/rezone.i line 1364

 rez_range rez_range interpreted function, defined at i/rezone.i line 1515

 rez_regs rez_regs is a vector of region numbers which are to be drawn in the colors specified in rez_palette. Thus: rez_regs= [3,5] causes regions 3 and 5 to be drawn in colors. All other regions have white backgrounds. Hilighting too many regions in this way may slow down the redraws unacceptably. To highlight all regions, use: rez_regs= indgen(max(rez_ireg)) This won't work on monochrome monitors, of course. The default is rez_regs=[]. builtin function, documented at i/rezone.i line 116 SEE ALSO: rez_palette

 rez_solve rez_solve interpreted function, defined at i/rezone.i line 1522

 rez_style rez_style interpreted function, defined at i/rezone.i line 1258

 rez_test rez_test interpreted function, defined at i/rezone.i line 1565

 rez_toggle rez_toggle interpreted function, defined at i/rezone.i line 261

 rez_zoom rez_zoom Change limits after setting rez_mesh. There are two modes of operation: (1) P-mode: Click on a point to magnify or demagnify about that point. Drag the point to move it to a different position in the viewport. The left button zooms in (magnifies by 1.5), the right button zooms out (demagnifies by 1.5), and the middle button pans (no magnification change). If you click just below or just above the tick marks, only the x coordinate is changed; clicking just to the left or just to the right of the viewport changes only the y coordinate. (2) R-mode: Left drag out a rectangle to set the limits to that rectangle. Right drag out a rectangle to cram the entire current viewport into that rectangle (an analog to zooming out). Middle drag to pan as in P-mode (the rubber band rectangle is meaningless in this case). Click the [R-mode] (or [P-mode]) button to change modes. Click the [OK] button when you are satisfied with the limits. Click the [Undo] button to remove the effect of the previous zoom-click. Up to 100 successive undo operations are allowed. Click the [Polar] button to toggle polar coordinates. The vertical axis will be theta, and the horizontal axis radius. The polar coordinate origin will be at (zt,rt) = (0,0). Click the [Next], [Prev], or [First] buttons to focus in on zones which are bowtied or chevroned. These zones are marked by a B or a C, respectively (if rez_mark is set). interpreted function, defined at i/rezone.i line 1113 SEE ALSO: rez_mesh

 rgb_read rgb = rgb_read() or rgb = rgb_read(n) Read contents of current graphics window, or of graphics window N. RGB is a 3xNXxNY array of char where NXxNY is the current shape of the window in pixels. RGB(1,,) is the red component, RGB(2,,) is the green component, and RGB(3,,) is the blue component, with 0 black and 255 full intensity. RGB(,,1) is the top row of the window, RGB(,,2) the second row, and so on to RGB(,,0), which is the bottom row. (So RGB(,,::-1) to pli redraws a copy.) builtin function, documented at i0/graph.i line 1314

 rk4 y_at_x_plus_dx= rk4(y,dydx, x,dx, derivative) takes a single 4th order Runge-Kutta step from X to X+DX. DERIVATIVE(y,x) is a function returning dydx; the input DYDX is DERIVATIVE(y,x) at the input (X,Y). This fourth evaluation of DERIVATIVE must be performed by the caller of rk4. interpreted function, defined at i/rkutta.i line 233

 rk_integrate y= rk_integrate(derivative, y1, x, epsilon, dx1) integrates dydx= DERIVATIVE(y,x) beginning at (X(1),Y1) and going to X(0) with fractional error EPSILON. The result is the value of y at each value in the list X. If non-nil, DX1 will be used as initial guess for the first step size. Otherwise, X(2)-X(1) will be the first step size guess. The list of X values must be monotone -- strictly increasing or strictly decreasing; the Runge-Kutta step sizes are selected adaptively until the next X value would be passed, when the step size is adjusted to complete the step exactly. The external variable rk_maxits (default 10000) is the maximum number of steps rk_integrate will take. If a function rk_yscale(y,dydx,x,dx) exists, it is used to compute an appropriate yscale to give the EPSILON error criterion meaning. Otherwise, yscale is taken to be: abs(y)+abs(dydx*dx)+1.e-30 Based on odeint from Numerical Recipes (Press, et.al.). If the function you are trying to integrate is very smooth, and your X values are fairly far apart, bs_integrate may work better than rk_integrate. interpreted function, defined at i/rkutta.i line 14 SEE ALSO: rkutta,   bs_integrate,   rk_maxits,   rk_minstep,   rk_maxstep,   rk_ngood,   rk_nbad,   rkdumb,   rk4

 rk_store rk_store interpreted function, defined at i/rkutta.i line 163

 rkdumb y_of_x= rkdumb(derivative, y0,x0, x1,nsteps) integrates dydx= DERIVATIVE(y,x) beginning at (X0,Y0) and going to X1 in NSTEPS 4th order Runge-Kutta steps. The result is dimsof(Y0)-by-(NSTEPS+1) values of y at the points span(X0, X1, NSTEPS+1). If the nosave= keyword is non-zero, the returned value will simply be the final y value. interpreted function, defined at i/rkutta.i line 184

 rkqc rkqc interpreted function, defined at i/rkutta.i line 205

 rkutta y1= rkutta(derivative, y0,x0, x1,epsilon, dx0) integrates dydx= DERIVATIVE(y,x) beginning at (X0,Y0) and going to X1 with fractional error EPSILON. The result is the value of y at X1. DX0 will be used as the initial guess for a step size. If the external variable rk_nstore is >0, rk_y and rk_x will contain up to rk_nstore intermediate values after the call to rkutta. Consider using rk_integrate if you need this feature; using rk_nstore gives you the results at intermediate values which will tend to be closer where the Runge-Kutta step size was smaller, while rk_integrate forces you to specify precisely which x values you want. The external variable rk_maxits (default 10000) is the maximum number of steps rkutta will take. The variable rk_minstep (default 0.0) is the minimum step size. The variable rk_maxstep (default 1.e35) is the maximum step size, which you may need if you are storing intermediate values (particularly with bstoer). If a function rk_yscale(y,dydx,x,dx) exists, it is used to compute an appropriate yscale to give the EPSILON error criterion meaning. Otherwise, yscale is taken to be: abs(y)+abs(dydx*dx)+1.e-30 Based on odeint from Numerical Recipes (Press, et.al.). If the function you are trying to integrate is very smooth, bstoer will probably work better than rkutta. interpreted function, defined at i/rkutta.i line 52 SEE ALSO: rk_integrate,   bstoer,   rk_nstore,   rk_maxits,   rk_minstep,   rk_maxstep,   rk_ngood,   rk_nbad,   rkdumb,   rk4

 rm_hist rm_hist interpreted function, defined at i/testb.i line 68

 rmdir rmdir builtin function, documented at i0/std.i line 1571 SEE mkdir

 roll roll(x, ljoff, rjoff) or roll, x, ljoff, rjoff or roll(x) or roll, x "rolls" selected dimensions of the array X. The roll offsets LJOFF and RJOFF (both optional) work in the same fashion as the LJDIR and RJDIR arguments to the fft function: A scalar LJDIR (and nil RJDIR) rolls all dimensions of X by the specified offset. Otherwise, the elements of the LJDIR vector [ljoff1, ljoff2, ...] are used as the roll offsets for the first, second, etc. dimensions of X. Similarly, the elements of the RJDIR vector [..., rjoff1, rjoff0] are matched to the final dimensions of X, so the next to last dimension is rolled by rjoff1 and the last dimension by rjoff0. As a special case (mostly for use with the fft function), if both LJDIR and RJDIR are nil, every dimension is rolled by half of its length. Thus, roll(x) it equivalent to roll(x, dimsof(x)(2:0)/2) The result of the roll function is complex if X is complex, otherwise double (i.e.- any other array type is promoted to type double). If roll is invoked as a subroutine, the operation is performed in place. interpreted function, defined at i0/fft.i line 254 SEE ALSO: fft

 romberg integral= romberg(function, a, b) or integral= romberg(function, a, b, epsilon) returns the integral of FUNCTION(x) from A to B. If EPSILON is given, Simpson's rule is refined until that fractional accuracy is obtained. EPSILON defaults to 1.e-6. If the notvector= keyword is supplied and non-zero, then FUNCTION may not be called with a list of x values to return a list of results. By default, FUNCTION is assumed to be a vector function. If the function is not very smooth, simpson may work better. interpreted function, defined at i/romberg.i line 10 SEE ALSO: simpson,   max_doublings

 rot3 rot3, xa,ya,za rotate the current 3D plot by XA about viewer's x-axis, YA about viewer's y-axis, and ZA about viewer's z-axis. interpreted function, defined at i/pl3d.i line 57 SEE ALSO: orient3,   mov3,   aim3,   setz3,   undo3,   save3,   restore3,   light3

 rotext plt, rotext(text,path), x, y return TEXT string as is (PATH=0), reversed (PATH=1), reversed and with a '\n' between each character, or with '\n' between characters (PATH=3). When plotted, these strings correspond to the original meaning of the text path= keyword. That is, successive characters will appear to the right, left, up, or down according to whether PATH is 0, 1, 2, or 3 interpreted function, defined at i/txpath.i line 12 SEE ALSO: plt

 rzextr rzextr interpreted function, defined at i/rkutta.i line 338