home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / armbob / armbob_1 / ARMBOB / doc / arrayDoc next >
Encoding:
Text File  |  1996-06-18  |  4.4 KB  |  111 lines

  1. \#£¤75
  2.  
  3.   £BThe functions in the Array Library extend ArmBob to allow some vector
  4.   £Band matrix operations to be performed.
  5.  
  6.   It is supposed that the elements of numerical input arrays are either
  7.   all of type £AINTEGER£7 or all of type £AREAL£7. If the input arrays are both
  8.   of type £AINTEGER£7, the output will be of type £AINTEGER£7, except for
  9.   £8inverse()£7; otherwise the output will be of type £AREAL£7. A few of the
  10.   functions can deal with arrays of mixed types, but this should not be
  11.   relied on as it can lead to errors that are not detected. Arrays of
  12.   mixed types can always be converted to £AREAL£7 arrays by using the
  13.   function £8multiple()£7 with the £AREAL£7 factor 1.0.  
  14.  
  15.   Variables of type £AVECTOR£7 are treated as row vectors, but it may be
  16.   expedient to treat row vectors as 1 x n matrices and column vectors as
  17.   n x 1 matrices for consistency, so functions £8form_row()£7 and
  18.   £8form_column()£7 are provided for conversions: both are special cases of
  19.   £8form_matrix()£7.  
  20.  
  21.   Arrays with elements of type £ASTRING£7 can be formed with £8form_matrix()£7
  22.   or £8form_column()£7 or £8form_row()£7, concatenated with £8concat()£7 and printed
  23.   with £8printarray()£7. No other array functions can be used with string
  24.   arrays.
  25.  
  26.   Nearly all the array functions use the auxiliary function £8newmatrix()£7,
  27.   and £8printarray()£7 uses the function £8format()£7, so these functions are
  28.   provided with the Array Library.
  29.  
  30.   £BInput£7
  31.  
  32.   £8form_matrix(m,n,v)
  33.     Returns an m x n matrix from a £AVECTOR£7 v of size m*n, whose rows are
  34.     successive sets of n elements of the vector. The elements of v should
  35.     be all £AINTEGER£7, all £AREAL£7 or all £ASTRING£7. An error is given if the
  36.     vector v is not of size m*n.
  37.   
  38.   £8form_column(v)
  39.     Returns a column vector from a £AVECTOR£7 v. The elements of v should be all
  40.     £AINTEGER£7 or all £AREAL£7. It is a special case of £8form_matrix()£7.
  41.  
  42.   £8form_row(v)
  43.     Returns a row vector from a £AVECTOR£7 v. The elements of v should be all
  44.     £AINTEGER£7 or all £AREAL£7. It is a special case of £8form_matrix()£7; also a
  45.     £AVECTOR£7 is treated as a row vector, so this function is only included
  46.     for convenience. 
  47.  
  48.   £BOutput
  49.  
  50.   £8printarray(A,l,p)
  51.     Prints the elements of an array (matrix or vector) A in successive
  52.     rows, each with field width l, and with p digits after the decimal
  53.     point for £AREAL£7 elements by using £8format()£7.
  54.  
  55.   £8format(n,l,p)
  56.     Formats variables of types £AINTEGER£7, £AREAL£7 and £ASTRING£7 for output. It
  57.     converts £AREAL£7 or £AINTEGER£7 numbers n to signed decimal strings, with p
  58.     digits after the decimal point for reals (p is irrelevant for integers
  59.     and strings), and returns them, or strings n, either padded with
  60.     leading spaces to make their lengths up to l or, if l is too small (in
  61.     particular if l = 0), at full length without any leading spaces.
  62.  
  63.   £BManipulation
  64.  
  65.   £8add(c,A)
  66.     Returns the result of adding the constant c to every element of the
  67.     array (matrix or vector) A.
  68.  
  69.   £8sum(A,B)
  70.     Returns the array sum A + B of matrices or vectors A and B. An error
  71.     is given when the arrays are incompatible for addition.
  72.  
  73.   £8multiple(c,A)
  74.     Returns the result of multiplying every element of the array (matrix
  75.     or vector) A by the constant c.
  76.  
  77.   £8product(A,B)
  78.     Returns the matrix product A.B of the array A (matrix or row vector)
  79.     and the matrix B. An error is given when the arrays are incompatible
  80.     for multiplication.
  81.  
  82.   £8trace(A)
  83.     Returns the trace of the square matrix A. An error is given when A is
  84.     not square.
  85.  
  86.   £8transpose(A)
  87.     Returns the transpose of the matrix A.
  88.  
  89.   £8inverse(A)
  90.     Returns the inverse of a non-singular square matrix A, formed by using
  91.     elementary row operations. The elements of d can be £AINTEGER£7 or £AREAL£7,
  92.     but the elements of the inverse will be £AREAL£7. Errors are given if A is
  93.     not square or is singular. Elements with absolute values less than
  94.     norm(A)/1000000 are set to zero. It uses the function £8abs()£7.
  95.  
  96.   £8concat(A,B)
  97.    Returns the array concatenation A + B of the £ASTRING£7 arrays A and B
  98.    (matrices or vectors). An error is given when the arrays are not
  99.    compatible.
  100.  
  101.   £BAuxiliary functions
  102.  
  103.   £8newmatrix(m,n)
  104.     Returns a new m x n matrix with elements of type £ANIL£7.
  105.  
  106.   £8abs(n)
  107.     Returns the absolute value of a £AREAL£7 variable n. Used by £8inverse()£7.
  108.  
  109.   £8int_10(n)
  110.     Returns an £AINTEGER£7 n as a decimal string. Used by £8format()£7.
  111.