Jump to content

Matrix representation

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Pinglekp (talk | contribs) at 15:55, 13 September 2011 (Theory). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A matrix representation is a method used by a computer language to store matrices of more than one dimension in memory. Fortran and C use different schemes. Fortran uses "Column Major", in which all the elements for a given column are stored contiguously in memory. C uses "Row Major", which stores all the elements for a given row contiguously in memory. LAPACK defines various matrix representations in memory. There is also Sparse matrix representation and Morton-order matrix representation. According to the documentation, in LAPACK the unitary matrix representation is optimized. See [1]. Some languages such as Java store matrices using Iliffe vectors. These are particularly useful for storing irregular matrices. This is a data structure related article.

Introduction

A m x n (read as m by n) matrix is a set of numbers arranged in m rows and n columns. You can add 2 matrices of the same size by adding individual elements. You can multiply 2 matrices as well. But the only condition is that the number of columns of the first matrix is equal to the number of rows of the second matrix. So if you multiply a m x n matrix with a n x r matrix then the resultant matrix will be of the order m x r. Similarly you can also find the inverse of a matrix by various methods like row-transformation , column transformation, ad-joint method, and many more. We can as well solve simultaneous linear equations by matrix method.

Theory

All this was related to mathematics. This same thing can be related to computers. A two-dimensional array can function exactly like a matrix. Two-dimensional arrays can be thought of as a table consisting of rows and columns.

  • int a[3][4], declares an integer array of three rows and four columns. Row index will start from 0 and will go upto 2.
  • Similarly, column index will start from 0 and will go upto 3.
Column 0 Column 1 Column 2 Column 3
row 0 a[0][0] a[0][1] a[0][2] [0][3]
row 1 a[1][0] a[1][1] a[1][2] [1][3]
row 2 a[2][0] a[2][1] a[2][2] [2][3]

See also

^1 R. LEHOUCQ, The computation of elementary unitary matrices, Computer Science Dept. Technical Report CS-94-233, University of Tennessee, Knoxville, 1994. (LAPACK Working Note 72).