Algebra with Matrices, Vectors, and Arrays
Expressions involving sums, products, and powers with rtable objects are evaluated directly. An rtable object is either an Array, Matrix, or Vector.
The result that is returned for a particular expression is described below. In each of the following sections:
- A is an Array
- M is a Matrix
- V is a Vector
- c is a numeric constant
- s is a non-numeric scalar
The result that is returned when an expression of type '+' includes at least one rtable depends on the operands.
The component-wise sum of A1 and A2,
if the dimensions match;
otherwise, returns an error
Adds c to every element of A
The component-wise sum of M1 and M2,
Adds c to the main diagonal of M
The component-wise sum of V1 and V2,
if dimensions and orientations match;
All other combinations raise errors
Direct evaluation of these expressions is implemented by calls to the rtable/Sum library routine.
The result that is returned when an expression of type '*' includes at least one rtable depends on the operands. If the operands are either Matrices, Vectors or a combination of each (with appropriate dimensions), the '.' operator must be used. For more information, see dot.
The component-wise product of A1 and A2, if the dimensions match;
Multiplies every element of A by c
An error (must use the '.' (dot) operator)
Multiplies every element of M by c
Multiplies every element of V by c
Direct evaluation of these expressions is implemented by calls to the rtable/Product library routine.
The result that is returned when an expression of type '^' includes an rtable object base depends on the exponent type.
There are two cases in which the exponent is interpreted specially: R+=LinearAlgebra:−TransposeR and R*=LinearAlgebra:−HermitianTransposeR. (The deprecated notations, RTypesetting:-_Hold⁡%T and RTypesetting:-_Hold⁡%H, respectively, are similarly interpreted.)
Otherwise, the following interpretations of a power of an rtable apply.
The component-wise exponentiation of A.
Constant c can be any (complex) numeric value.
If M is square and c is a positive integer, then
the result is the matrix product M·M·M ... M
(c factors using the dot operator)
If c is a negative integer, the result is
MatrixInverse( M·M·M ... M) (c factors using
the dot operator)
If c=0, the result is 1
If c is not an integer, it returns unevaluated
Direct evaluation of these expressions is implemented by calls to the rtable/Power library routine.
The * operator cannot be used to multiply Matrices or Vectors.
Error, (in `rtable/Product`) use *~ for elementwise multiplication of Vectors or Matrices; use . (dot) for Vector/Matrix multiplication
Note the difference between * and . when one operand is a symbolic scalar.
Download Help Document
What kind of issue would you like to report? (Optional)