Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | mathematics |
include "matrix.g"
angle | Find the angle between two vectors |
cosangle | Find the cosine of the angle between two vectors |
crossproduct | vector cross-product |
diagonalmatrix | make an n x n diagonal matrix |
directproduct | Direct Matrix Product |
dotproduct | vector dot-product |
help | print a summary of matrix functions |
invert | Invert a matrix |
mean | the mean of the elements |
mult | matrix multiplication |
norm | the `norm' of a vector or matrix |
print a matrix/vector | |
rms | the root mean square (rms) of the elements |
rotate | rotate a 2D (plain) vector |
rotationmatrix | make a 2 x 2 rotation matrix |
symbolic | Make a symbolic matrix/vector |
test | a test of most matrix functions |
transpose | Transpose a matrix |
unitmatrix | make an n x n unit matrix |
The functions in this tool have not been tested as rigorously as other parts of AIPS++. This tool can be considered ``alpha'' code.
matrix is a collection of common matrix and vector operations in Glish. It includes the Direct Matrix Product (used in the AIPS++ Measurement Equation), and a simple matrix inversion which also works with rectangular matrices. The latter should in time be replaced by a C++ executable (DO), which should then implement a choice of more sophisticated techniques than Gauss-Jordan inversion. All operations also work with complex numbers.
NB: Glish itself provides a number of element-by-element vector and array operations like addition etc. These have not been duplicated here.
- include "matrix.g" - mx.help();Now, let us do a matrix multiplication:
- m1 := array([1:6],2,3); - print m1; - m2 := array([1:12],3,4); - print m2; - m3 := mx.mult(m1,m2); - print m3;