VMCalculator has a number of math functions available for working with arrays and two dimensional matrices. Many were inspired, either directly or indirectly, by the algorithms in Numerical Recipes. All begin with the characters RM:
| RMAbs( a ) | Returns an array or matrix with all elements set to the absolute values of the a elements. |
|---|---|
| RMACos( a ) | Returns an array or matrix with all elements set to the arccosine (in radians) of the a elements. |
| RMAdd( a, b ) | An array or matrix is returned whose elements are the sum of the corresponding elements in a and b. The second parameter, b, can be a scalar, in which case that value is added to each a element. |
| RMASin( a ) | Returns an array or matrix with all elements set to the arcsine (in radians) of the a elements. |
| RMATan( a ) | Returns an array or matrix with all elements set to the arctangent (in radians) of the a elements. |
| RMClip( a, minValue, maxValue ) | Replaces and value in a (scalar, array or matrix) which is smaller than minValue with minValue and any value larger than maxValue, with maxValue.a. |
| RMCopy( a ) | Returns a copy of the array or matrix passed as a. |
| RMCos( a ) | Returns an array or matrix with all elements set to the cosine of the a elements (in radians). |
| RMDivide( a, b ) | An array or matrix is returned whose elements are the division of the corresponding elements in a and b. The second parameter, b, can be a scalar, in which case that value is divided into each a element. The first element (numerator) can also be a scalar, with the second element being an array or matrix. |
| RMDot( a, b ) | Returns a scalar that is the dot product of the a and b arrays. |
| RMExp( a ) | Returns an array or matrix with all elements set to "e" to the power of the a elements. |
| RMFill( a, v ) | The array or matrix a has all its elements set to the scalar value v. |
| RMGetColumn( a, i ) | Returns an array whose elements correspond to the i column of matrix a. |
| RMGetrow( a, i ) | Returns an array whose elements correspond to the i row of matrix a. |
| RMInvert( a ) | Returns the inverse of the square matrix a. This is calculated using LU decomposition and back substitution and the a matrix is destroyed in the calculation. |
| RMLog( a ) | Returns an array or matrix with all elements set to the natural logarithm of the a elements. |
| RMLuBackSub( a, p, b ) | Performs an LU back substitution on matrix a and pivot array p as returned by the RMLuDecomp routine. Argument b is the right hand side vector in the equation A*x = b that is being solved and where A is the original matrix before decomposition. The elements of b are replaced with the solution for x, but a and p are not modified and can be reused with a different b. |
| RMLuDecomp( a, p, d ) | Performs an LU decomposition on matrix a, replacing its values with the row wise permutation of itself. The pivot array p is dimensioned and returned with the record of the row wise permutation resulting from partial pivoting. The scalar parameter d is returned as plus or minus one, depending on whether the number of row interchanges was even or odd. The a and p variables are used with the RMLuBackSub routine to solve equations of the form A*x = b, where A is the original matrix before decomposition. |
| RMMatrixMultiply( a, b ) | Performs an ordinary matrix multiply of matrices a(m,n) and b(n,p), returning an m by p matrix. For convenience b can be supplied as array of n elements, in which case it is assumed to be a column vector (n,1). |
| RMMax( a ) | Returns a scalar value which is the largest element of a, which can be an array or matrix. |
| RMMin( a ) | Returns a scalar value which is the smallest element of a, which can be an array or matrix. |
| RMMultiply( a, b ) | An array or matrix is returned whose elements are the product of the corresponding elements in a and b. The second parameter, b, can be a scalar, in which case that each a element is multiplied by that value. |
| RMPutColumn( a, i, c ) | Replaces the i column of matrix a with the elements of array c. |
| RMPutRow( a, i, r ) | Replaces the i row of matrix a with the elements of array r. |
| RMShow( a ) | Returns a string which is a rough representation of the array or matrix a suitable for printing for debugging purposes. |
| RMSin( a ) | Returns an array or matrix with all elements set to the sine of the a elements (in radians). |
| RMSubtract( a, b ) | An array or matrix is returned whose elements are the subtraction of the corresponding elements in a and b. The second parameter, b, can be a scalar, in which case that value is subtracted from each a element. |
| RMSum( a ) | Returns a scalar which is the sum of all of the elements of the array or matrix a. |
| RMTan( a ) | Returns an array or matrix with all elements set to the tangent of the a elements (in radians). |