home *** CD-ROM | disk | FTP | other *** search
- \#£¤75
-
- £BThe functions in the Array Library extend ArmBob to allow some vector
- £Band matrix operations to be performed.
-
- It is supposed that the elements of numerical input arrays are either
- all of type £AINTEGER£7 or all of type £AREAL£7. If the input arrays are both
- of type £AINTEGER£7, the output will be of type £AINTEGER£7, except for
- £8inverse()£7; otherwise the output will be of type £AREAL£7. A few of the
- functions can deal with arrays of mixed types, but this should not be
- relied on as it can lead to errors that are not detected. Arrays of
- mixed types can always be converted to £AREAL£7 arrays by using the
- function £8multiple()£7 with the £AREAL£7 factor 1.0.
-
- Variables of type £AVECTOR£7 are treated as row vectors, but it may be
- expedient to treat row vectors as 1 x n matrices and column vectors as
- n x 1 matrices for consistency, so functions £8form_row()£7 and
- £8form_column()£7 are provided for conversions: both are special cases of
- £8form_matrix()£7.
-
- Arrays with elements of type £ASTRING£7 can be formed with £8form_matrix()£7
- or £8form_column()£7 or £8form_row()£7, concatenated with £8concat()£7 and printed
- with £8printarray()£7. No other array functions can be used with string
- arrays.
-
- Nearly all the array functions use the auxiliary function £8newmatrix()£7,
- and £8printarray()£7 uses the function £8format()£7, so these functions are
- provided with the Array Library.
-
- £BInput£7
-
- £8form_matrix(m,n,v)
- Returns an m x n matrix from a £AVECTOR£7 v of size m*n, whose rows are
- successive sets of n elements of the vector. The elements of v should
- be all £AINTEGER£7, all £AREAL£7 or all £ASTRING£7. An error is given if the
- vector v is not of size m*n.
-
- £8form_column(v)
- Returns a column vector from a £AVECTOR£7 v. The elements of v should be all
- £AINTEGER£7 or all £AREAL£7. It is a special case of £8form_matrix()£7.
-
- £8form_row(v)
- Returns a row vector from a £AVECTOR£7 v. The elements of v should be all
- £AINTEGER£7 or all £AREAL£7. It is a special case of £8form_matrix()£7; also a
- £AVECTOR£7 is treated as a row vector, so this function is only included
- for convenience.
-
- £BOutput
-
- £8printarray(A,l,p)
- Prints the elements of an array (matrix or vector) A in successive
- rows, each with field width l, and with p digits after the decimal
- point for £AREAL£7 elements by using £8format()£7.
-
- £8format(n,l,p)
- Formats variables of types £AINTEGER£7, £AREAL£7 and £ASTRING£7 for output. It
- converts £AREAL£7 or £AINTEGER£7 numbers n to signed decimal strings, with p
- digits after the decimal point for reals (p is irrelevant for integers
- and strings), and returns them, or strings n, either padded with
- leading spaces to make their lengths up to l or, if l is too small (in
- particular if l = 0), at full length without any leading spaces.
-
- £BManipulation
-
- £8add(c,A)
- Returns the result of adding the constant c to every element of the
- array (matrix or vector) A.
-
- £8sum(A,B)
- Returns the array sum A + B of matrices or vectors A and B. An error
- is given when the arrays are incompatible for addition.
-
- £8multiple(c,A)
- Returns the result of multiplying every element of the array (matrix
- or vector) A by the constant c.
-
- £8product(A,B)
- Returns the matrix product A.B of the array A (matrix or row vector)
- and the matrix B. An error is given when the arrays are incompatible
- for multiplication.
-
- £8trace(A)
- Returns the trace of the square matrix A. An error is given when A is
- not square.
-
- £8transpose(A)
- Returns the transpose of the matrix A.
-
- £8inverse(A)
- Returns the inverse of a non-singular square matrix A, formed by using
- elementary row operations. The elements of d can be £AINTEGER£7 or £AREAL£7,
- but the elements of the inverse will be £AREAL£7. Errors are given if A is
- not square or is singular. Elements with absolute values less than
- norm(A)/1000000 are set to zero. It uses the function £8abs()£7.
-
- £8concat(A,B)
- Returns the array concatenation A + B of the £ASTRING£7 arrays A and B
- (matrices or vectors). An error is given when the arrays are not
- compatible.
-
- £BAuxiliary functions
-
- £8newmatrix(m,n)
- Returns a new m x n matrix with elements of type £ANIL£7.
-
- £8abs(n)
- Returns the absolute value of a £AREAL£7 variable n. Used by £8inverse()£7.
-
- £8int_10(n)
- Returns an £AINTEGER£7 n as a decimal string. Used by £8format()£7.
-