Matrix Operations
Transpose
--
Algorithm:
-- exchange the row and column indices.
Addition/Subtraction
--
Precondition:
A
and
B
have the same size.
Algorithm:
-- add/subtract element by element.
# operations
Scalar product
--
Precondition:
c
is a real number.
Algorithm:
-- multiply each element of
A
by
c
.
# operations
Dot product
(of vectors) --
Preconditions:
A row vector (
) times a column vector (
v
);
Two vectors have the same size (
n
).
Algorithm:
# operations
Norm
(
-norm) of a vector --
.
Matrix product
--
Precondition: # columns of
A
equals # rows of
B
.
Algorithm:
Alternatively, write
A
as an array of
row
vectors
and
B
as an array of
column
vectors
then
# operations
:
involves
dot products, and
Each dot product needs
O
(
n
) operations.
Next:
SOLVING LINEAR SYSTEMS
Up:
MATRICES AND VECTORS
Previous:
Definitions