Scientific Computing Lecture 5 - Matrix Operations 1
Overview
Definitions |
|
Matrix Field of m rows and n columns If m=n called square matrix Otherwise rectangular |
Submatrice
Vector can be
considered as m×1 matrix |
Partitioning
Splitting
matrix into submatrices |
Special Matric
An n×n matrix
is called |
More Special Matrices
The transposed
AT of an m×n matrix is
A is called
symmetric if A=AT |
Matrix Addition
Matrices are
added element-wise
Is this
operation faster or slower then vector |
Run Time of Matrix Addition
Adding matrices
of dimensions m×n takes |
Is Matrix or Vector Addition Faste
Adding vectors
of length l = m×n takes |
Row Major and Column Major
In C and C++ 2D
arrays are stored row major
|
Loop Nesting
Loop nesting should fit storing scheme |
Matrix Norms
Matrices are
operators on vectors |
Special Matrix Norms
||.||p for p =
1, 2, and ∞ are the most
The first is
the maximum of column sums |
Matrix Vector Product
Number of
columns must be equal to vector
i-th element of
result is dot product of i-th |
Alternative Computation
Dot product is
loop over matrix rows
Is this faster or slower than dot product? |
Run Time Analysis
Operand vector:
n loads |
Run Time Analysis (ii)
Number of
additions, multiplications and loads for |