CERN home page CERN home page Consult pages Consult pages Writeups at CERN Writeups at CERN Garfield pages Garfield pages Help Help algebra algebra This page This page Table of contents Keyword index

algebra: functions


NUMBER

Converts a variable of type Matrix or String to a variable of type Number.

If the argument is a String, it should contain a simple number, not an expression.

If the argument is a Matrix, then its first element will be returned.


ROW

Returns a 1-dimensional Matrix filled with the number 1 to n, where n is the argument.

The argument is mandatory.


RND_EXPONENTIAL

Generates exponentially distributed random numbers.

The optional argument specifies the mean (and the standard deviation) of the distribution to be generated. If the argument is omitted, a mean of 1 is assumed.

The mean is usually specified as a Number but may also be of type Histogram and Matrix. In the latter two cases, variables of the same type will be returned, taking for each output element as mean the corresponding element of the argument.


RND_FUNCTION

Generates random number according to the function that has, on beforehand, been specified with a call to PREPARE_RND_FUNCTION.

A random number sequences according to only one function can be generated at the time.

This generator has no arguments.


RND_GAUSS

Returns a random number according to a normal distribution, i.e. a Gaussian distribution with mean 0 and sigma 1.

This function has no arguments.


RND_LANDAU

Returns a random number according to a Landau distribution.

This function has no arguments.


RND_HISTOGRAM

Generates random number according to the Histogram given as argument.

Separate random number sequences according to different histograms can be generated concurrently.

The argument is mandatory.


RND_POISSON

Generates Poisson distributed random numbers.

The optional argument specifies the mean of the distribution to be generated. If the argument is omitted, a mean of 1 is assumed.

The mean is usually specified as a Number but may also be of type Histogram and Matrix. In the latter two cases, variables of the same type will be returned, taking for each output element as mean the corresponding element of the argument.


RND_POLYA

Generates Polya distributed random numbers. A Polya distribution with parameter theta is in fact a gamma distribution with parameter theta+1. For theta equal to 0, the Polya distribution reduces to the exponential distribution.

The argument specifies the theta parameter of the distribution to be generated. If the argument is omitted, a theta of 1 is assumed.

The theta parameter is usually specified as a Number but may also be of type Histogram and Matrix. In the latter two cases, variables of the same type will be returned, taking for each output element as theta the corresponding element of the argument.


RND_UNIFORM

Returns a uniformly distributed random number in the range [0, 1].

This function has no argument.


STRING

Converts a variable of any type to a variable of type String as follows:

The STRING function is for instance used to create file names that depend on parameters of the chamber being studied:

Global argon 70
Global co2 30
Global gas_file `Argon_`/string(argon)/`_CO2_`/string(co2)/`.gas`
Call inquire_file(gas_file,exist)
If exist Then
   get {gas_file}
Else
   write {gas_file}
   magboltz argon {argon} co2 {co2}
Endif

TYPE

Takes an expression as argument and returns, in the form of a String, one of the following values: `String`, `Number`, `Logical`, `Histogram`, `Matrix` or `Undefined`.

This function provides a functionality which is similar to the INQUIRE_TYPE procedure.


Go to the top level, to algebra, to functions, to the topic index or to the table of contents.

Formatted on 0100-08-27 at 04:53.