Biographies Characteristics Analysis

Triangular view of the matrix. Triangular matrices and characteristic equation

1. Let a rank matrix be given. Let us introduce the following notation for successive principal minors of this matrix:

.

Let us assume that the conditions for the feasibility of the Gaussian algorithm hold:

Let us denote by the matrix of coefficients the system of equations (18), to which the system of equations is reduced

Gaussian elimination method. The matrix has an upper triangular shape, and the elements of its first rows are determined by formulas (13), and the elements of the last rows are all equal to zero:

.

The transition from matrix to matrix was accomplished using a certain number of operations of the following type: the th row of the matrix was added to the th (th) row, previously multiplied by a certain number . This operation is equivalent to multiplying the matrix being transformed on the left by the matrix

. (31)

In this matrix, the main diagonal contains ones, and all other elements, with the exception of the element, are equal to zero.

Thus

,

where each of the matrices has the form (31) and, therefore, is a lower triangular matrix with diagonal elements equal to 1.

. (32)

The matrix will be called the transformation matrix for the matrix in the Gaussian elimination method. Both matrices, and , are uniquely determined by specifying the matrix . From (32) it follows that is a lower triangular matrix with diagonal elements equal to 1 (see page 28).

Since is a non-singular matrix, then from (33) we find:

We presented the matrix as the product of the lower triangular matrix to the upper triangular matrix. The question of factoring a matrix of this type is completely clarified by the following theorem:

Theorem 1. Any matrix of rank , for which the first consecutive eye minors are nonzero,

, (34)

can be represented as the product of a lower triangular matrix and an upper triangular matrix

. (35)

The first diagonal elements of the matrices and can be given arbitrary values ​​that satisfy conditions (36).

Specifying the first diagonal elements of matrices and uniquely determines the elements of the first columns of the matrix and the first r rows of the matrix. For these elements the following formulas apply:

, (37)

In the case in the last columns of the matrix, you can set all the elements to different zeros, and in the last rows of the matrix give all the elements arbitrary values, or vice versa, fill the last rows of the matrix with zeros, and take the last columns of the matrix arbitrary.

Proof. The possibility of representing a matrix satisfying condition (34) as a product (35) was proven above [see. (33")]

Now let and be arbitrary lower and upper triangular matrices whose product is equal to . Using the formula for minors of the product of two matrices, we find:

Since is an upper triangular matrix, the first columns of the matrix contain only one non-zero minor of the th order . Therefore, equality (38) can be written as follows:

Let's put it here first. Then we get:

from which relations (36) already follow.

Without violating inequality (35), we can multiply the matrix on the right by an arbitrary special diagonal matrix, while simultaneously multiplying the matrix on the left by . This is equivalent to multiplying the columns of the matrix by, respectively, and the rows of the matrix by . Therefore, the diagonal elements , , can be given any values ​​that satisfy conditions (36).

,

i.e., the first formulas (37). The second formulas (37) for the elements of the matrix are established in a completely similar way.

Let us pay attention to the fact that when multiplying matrices, both the elements of the last columns of the matrix and the elements of the last rows of the matrix are multiplied with each other. We have seen that all elements of the last rows of a matrix can be chosen to be zero. Then the elements of the last columns of the matrix can be chosen arbitrarily. It is clear that the product of matrices will not change if we take the last columns of the matrix to be zero, and the elements of the last rows of the matrix to be arbitrary.

The theorem has been proven.

A number of interesting consequences follow from the proven theorem.

Corollary 1. The elements of the first columns of the matrix and the first rows of the matrix are related to the elements of the matrix by recurrence relations:

(41)

Relations (41) directly follow from matrix equality (35); they are convenient to use for actually calculating the elements of the matrices and .

Corollary 2. If is a nonsingular matrix satisfying condition (34), then in representation (35) the matrices and are determined uniquely as soon as the diagonal elements of these matrices are chosen in accordance with conditions (36).

Corollary 3. If is a symmetric matrix of rank and

,

where is the lower triangular matrix in which

2. Let in representation (35) the matrix have elements of the last columns equal to zero. Then you can put:

, , (43)

where is the lower and is the upper triangular matrix; Moreover, the first diagonal elements of the matrices and are equal to 1, and the elements of the last columns of the matrix and the last rows of the matrix are chosen completely arbitrarily. Substituting into (35) expressions (43) for and and using equalities (36), we arrive at the following theorem:

Theorem 2. Any matrix of rank for which

,

Let us present it as the product of a lower triangular matrix, a diagonal matrix and an upper triangular matrix:

(44)

, (45)

a , are arbitrary for ; .

3. Gaussian elimination method, being applied to a rank matrix for which , gives us two matrices: a lower triangular matrix with diagonal elements of 1 and an upper triangular matrix whose first diagonal elements are equal , and the last lines are filled with zeros. - Gaussian form of the matrix, - transformation matrix.

For a specific calculation of matrix elements, the following technique can be recommended.

We will obtain a matrix if we apply to the identity matrix all the transformations (specified by matrices) that we did on the matrix in the Gauss algorithm (in this case, instead of a product equal to , we will have a product equal to ). Therefore, we assign to the matrix on the right identity matrix :

. (46)

Applying all the transformations of the Gaussian algorithm to this rectangular matrix, we obtain a rectangular matrix consisting of two square matrices and:

Thus, applying the Gaussian algorithm to matrix (46) gives both matrix and matrix .

If is a non-singular matrix, i.e., then and . In this case, it follows from (33). Since the matrices are determined using the Gaussian algorithm, then finding inverse matrix reduces to defining and multiplying by ., i.e., the columns of the matrix, the matrix coincides with , and the matrix coincides with the matrix, and therefore formulas (53) and (54) take the form

Page 2


A triangular matrix is ​​a matrix in which all elements on one side of the main or secondary diagonal are equal to zero. What is the determinant of a triangular matrix?  

A triangular matrix is ​​a matrix in which all elements on one side of the main or secondary diagonal are equal to zero. What is the determinant of a triangular matrix?  

Operations to perform the forward progression of the Gauss method in accordance with the theorems of linear algebra do not change the value of the determinant. Obviously, the determinant of a triangular matrix equal to the product its diagonal elements.  

This intuitive idea finds in some cases precise quantitative expression. For example, we know (see (6) from § 1) that the determinant of a triangular matrix (upper or lower) is equal to the product of the elements on the main diagonal.  

Triangular matrices have many remarkable properties, due to which they are widely used in constructing the most various methods solving algebra problems. So, for example, for square matrices, the sum and product of triangular matrices of the same name is a triangular matrix of the same name, the determinant of a triangular matrix is ​​equal to the product of diagonal elements, eigenvalues of a triangular matrix coincide with its diagonal elements, a triangular matrix is ​​easily inverted and its inverse will also be triangular.  

It was noted earlier that directly finding the determinant requires a large amount of calculations. At the same time, the determinant of a triangular matrix is ​​easily calculated: it is equal to the product of its diagonal elements.  

How more zeros among the elements of matrix A and the better they are located, the easier it is to calculate the determinant det A. This intuitive representation finds in some cases an exact quantitative expression. For example, we know (see (6) from § 1) that the determinant of a triangular matrix (upper or lower) is equal to the product of the elements on the main diagonal.  

For example, multiplying a determinant by a scalar is equivalent to multiplying the elements of any row or column of a matrix by that scalar. From equation (40) and from the fact that the expansion is applicable to algebraic complement in the same way as for the determinant, it follows that the determinant of a triangular matrix is ​​equal to the product of its diagonal elements.  

This possibility arises from three basic properties determinants. Adding a multiple of one string to another does not change the determinant. Rearranging two rows changes the sign of the determinant. The determinant of a triangular matrix is ​​simply the product of its diagonal elements. DECOMP uses the last component of the leading element vector to place the value 1 there if it was produced even number permutations, and the value is 1 if odd. To obtain the determinant, this value must be multiplied by the product of the diagonal elements of the output matrix.  

If the upper triangular matrix has n 2 elements, approximately half of them are zero and there is no need to store them explicitly. Specifically, if we subtract n diagonal elements from the sum of n 2 elements, then half of the remaining elements are zero. For example, with n=25 there are 300 elements with value 0:

(n 2 -n)/2 = (25 2 -25)/2=(625-25)/2 = 300

The sum or difference of two triangular matrices A and B is obtained by adding or subtracting the corresponding matrix elements. The resulting matrix is ​​triangular.

Addition C = A + B

Subtraction C = A - B

where C is a triangular matrix with elements C i, j = A i, j + B i, j.

Multiplication C = A * B

The resulting matrix C is a triangular matrix with elements C i, j, the values ​​of which are calculated from the elements of row i of matrix A and column j of matrix B:

C i , j =(A i ,0 *B 0, j)+ (A i ,1 *B 1, j)+ (A i ,2 *B 2, j)+…+ (A i , n -1 *B n -1, j)

For general square matrix The determinant is a difficult function to calculate, but calculating the determinant of a triangular matrix is ​​not difficult. Just get the product of the elements on the diagonal.

Triangular matrix storage

Using a standard two-dimensional array to store the upper triangular matrix requires using all the memory of size n 2 , despite the predicted zeros located below the diagonal. To eliminate this space, we store the elements from the triangular matrix in a one-dimensional array M. All elements below the main diagonal are not stored. Table 3.1 shows the number of elements that are stored in each row.

Triangular matrix storage

Table 1

The storage algorithm requires an access function that must determine the location in the array M of the element A i, j. For j< i элемент A i , j является равным 0 и не сохраняется в М. Для j ³ i функция доступа использует информацию о числе сохраняемых элементов в каждой строке вплоть до строки i. Эта информация может быть вычислена для каждой строки i и сохранена в массиве (rowTable) для использования функцией доступа.

Example 4.

Given that the elements of a triangular matrix are stored row by row in the array M, the access function for A i, j uses following parameters:

Indexes i and j,

rowTable array

The access algorithm for element A i, j is as follows:

If j

If j³i, then the value of rowTable[i] is obtained, which is the number of elements that are stored in the array M, for elements up to row i. In row i, the first i elements are zero and are not stored in M. Element A i, j is placed in M+(j-i)].

Example 5.

Consider the triangular matrix X from Example 3.4:

1.X 0.2 =M=M=M=0

2.X 1.0 not saved

3.X 1.2 =M+(2-1)]=M=M=1

TriMat class

The TriMat class implements a number of triangular matrix operations. Subtraction and multiplication of a triangular matrix are left for exercises at the end of the chapter. Given the restriction that we must only use static arrays, our class limits the row and column size to 25. We will have 300=(25 2 -25)/2 zero elements, so array M must contain 325 elements.

TriMat Class Specification

ANNOUNCEMENT

#include

#include

// maximum number of elements and rows

// upper triangular matrix

const int ELEMENTLIMIT = 325;

const int ROWLIMIT = 25;

// private data members

int rowTable; // starting index of the string in M

int n; // row/column size

double M;

// constructor with parameters TriMat(int matsize);

// access methods to matrix elements

void PutElement(double item, int i, int j);

double GetElement(int i, int j) const;

// matrix arithmetic operations

TriMat AddMat(const TriMat& A) const;

double DelMat(void) const;

// matrix I/O operations

void ReadMat(void);

void WriteMat(void) const;

// get matrix dimension

int GetDimension(void) const;

DESCRIPTION

The constructor accepts the number of rows and columns of the matrix. The PutElement and GetElement methods store and return the elements of an upper triangular matrix. GetElement returns 0 for elements below the diagonal. AddMat returns the sum of matrix A with the current object. This method does not change the value of the current matrix. The ReadMat and WriteMat I/O operators operate on all elements of an n x n matrix. The ReadMat method itself only stores the upper triangular elements of the matrix.

#include trimat.h // include the TriMat class

TriMat A (10), B (10), C (10); // 10x10 triangular matrices

A.ReadMat(); // enter matrices A and B

C = A.AddMat(B); // calculate C = A + B

C.WriteMat(); // print C

Implementation of the TriMat class

The constructor initializes the private member n with the matsize parameter. This sets the number of rows and columns of the matrix. The same parameter is used to initialize the rowTable array, which is used to access matrix elements. If matsize exceeds ROWLIMIT, an error message is issued and program execution is interrupted.

// initialize n and rowTable

TriMat::TriMat (int matsize)

int storedElements = 0;

// abort the program if matsize is greater than ROWLIMIT

if (matsize > ROWLIMIT)

cerr<< "Превышен размер матрицы" << ROWLIMIT << "x" << ROWLIMIT << endl;

// set the table

for (int i = 0; i< n; i++)

rowTable[i] = storedElements;

storedElements += n - i;

Matrix Access Methods. The key when working with triangular matrices is the ability to efficiently store non-zero elements in a linear array. To achieve this efficiency and still use the normal two-dimensional indexes i and j to access a matrix element, we need the PutElement and GetElement functions to store and return the matrix elements in an array.

The GetDimension method gives the client access to the size of the matrix. This information can be used to ensure that accessors are passed parameters corresponding to the correct row and column:

// return matrix dimension n

int TriMat::GetDimension(void) const

The PutElement method checks indexes i and j. If j ³ i, we store the data value in M ​​using the matrix access function for triangular matrices: If i or j is not in the range 0 . . (n-1), then the program ends:

// write the matrix element to array M

void TriMat::PutElement (double item, int i, int j)

// abort the program if the element's indexes are outside

// index range

if ((i< 0 || i >= n) || (j< 0 |1 j >= n))

cerr<< "PutElement: индекс вне диапазона 0-"<< n-1 << endl;

// all elements below the diagonal are ignored if (j >= i)

M + j-i] = item;

To retrieve any element, the GetElement method checks the indexes i and j. If i or j is not in the range 0...(n - 1), the program ends. If j

// get the matrix element of the array M

double TriMat::GetElement(int i, int j) const

// abort the program if the indices are outside the index range

if ((i< 0 || i >= n) || (j< 0 |I j >= n))

cerr<< "GetElement: индекс вне диапазона 0-"<< n-1 << endl;

// return the element if it is above the diagonal

return M + j-i];

// element is 0 if it is below the diagonal

Input/output of matrix objects. Traditionally, matrix input involves entering data row by row with a full set of row and column values. In a TriMat object, the lower triangular matrix is ​​null and the values ​​are not stored in the array. However, the user is prompted to enter these zero values ​​to retain normal matrix input.

// all (n x n) elements

void TriMat::ReadMat (void)

for(i = 0; i

for(j = 0; j

//line-by-row output of matrix elements to the stream

void TriMat::WriteMat (void) const

// setting the issuing mode

cout. setf (ios::fixed) ;

cout.precision(3) ;

cout.setf (ios::showpoint) ;

for (i =0; i< n; i++)

for (j = 0; j< n; j++)

cout<< setw(7) << GetElement (i,j);

cout<< endl;

Matrix operations. The TriMat class has methods for calculating the sum of two matrices and the determinant of a matrix. The AddMat method takes a single parameter, which is the right operand in the sum. The current object matches the left operand. For example, the sum of triangular matrices X and Y uses the AddMat method on object X. Suppose the sum is stored in object Z. To calculate

Z = X + Y use the operator

Z = X.AddMat(Y) ;

The algorithm for adding two objects of type TriMat returns a new matrix B with elements B i, j = CurrentObjecty i, j + A i, j:

// returns the sum of the current and matrix A.

// The current object does not change

TriMat TriMat::AddMat (const TriMat& A) const

double itemCurrent, itemA;

TriMat B(A.n); // B will contain the required amount

for (i = 0; i< n; i++) // цикл по строкам

for (j = i; j< n; j++) // пропускать элементы ниже диагонали

itemCurrent=GetElement i, j);

itemA = A.GetElement(i, j);

B. PutElement(itemCurrent + itemA, i, j);

The DetMat method returns the determinant of the current object. The return value is a real number that is the product of the diagonal elements. The complete code for implementing the TriMat class can be found in the software application.

In this topic we will consider the concept of a matrix, as well as types of matrices. Since there are a lot of terms in this topic, I will add a brief summary to make it easier to navigate the material.

Definition of a matrix and its element. Notation.

Matrix is a table of $m$ rows and $n$ columns. The elements of a matrix can be objects of a completely different nature: numbers, variables or, for example, other matrices. For example, the matrix $\left(\begin(array) (cc) 5 & 3 \\ 0 & -87 \\ 8 & 0 \end(array) \right)$ contains 3 rows and 2 columns; its elements are integers. The matrix $\left(\begin(array) (cccc) a & a^9+2 & 9 & \sin x \\ -9 & 3t^2-4 & u-t & 8\end(array) \right)$ contains 2 rows and 4 columns.

Different ways to write matrices: show\hide

The matrix can be written not only in round, but also in square or double straight brackets. That is, the entries below mean the same matrix:

$$ \left(\begin(array) (cc) 5 & 3 \\ 0 & -87 \\ 8 & 0 \end(array) \right);\;\; \left[ \begin(array) (cc) 5 & 3 \\ 0 & -87 \\ 8 & 0 \end(array) \right]; \;\; \left \Vert \begin(array) (cc) 5 & 3 \\ 0 & -87 \\ 8 & 0 \end(array) \right \Vert $$

The product $m\times n$ is called matrix size. For example, if a matrix contains 5 rows and 3 columns, then we speak of a matrix of size $5\times 3$. The matrix $\left(\begin(array)(cc) 5 & 3\\0 & -87\\8 & ​​0\end(array)\right)$ has size $3 \times 2$.

Typically, matrices are denoted by capital letters of the Latin alphabet: $A$, $B$, $C$ and so on. For example, $B=\left(\begin(array) (ccc) 5 & 3 \\ 0 & -87 \\ 8 & 0 \end(array) \right)$. Line numbering goes from top to bottom; columns - from left to right. For example, the first row of matrix $B$ contains elements 5 and 3, and the second column contains elements 3, -87, 0.

Elements of matrices are usually denoted in small letters. For example, the elements of the matrix $A$ are denoted by $a_(ij)$. The double index $ij$ contains information about the position of the element in the matrix. The number $i$ is the row number, and the number $j$ is the column number, at the intersection of which is the element $a_(ij)$. For example, at the intersection of the second row and the fifth column of the matrix $A=\left(\begin(array) (cccccc) 51 & 37 & -9 & 0 & 9 & 97 \\ 1 & 2 & 3 & 41 & 59 & 6 \ \ -17 & -15 & -13 & -11 & -8 & -5 \\ 52 & 31 & -4 & -1 & 17 & 90 \end(array) \right)$ element $a_(25)= $59:

In the same way, at the intersection of the first row and the first column we have the element $a_(11)=51$; at the intersection of the third row and the second column - the element $a_(32)=-15$ and so on. Note that the entry $a_(32)$ reads “a three two”, but not “a thirty two”.

To abbreviate the matrix $A$, the size of which is $m\times n$, the notation $A_(m\times n)$ is used. You can write it in a little more detail:

$$ A_(m\times n)=(a_(ij)) $$

where the notation $(a_(ij))$ denotes the elements of the matrix $A$. In its fully expanded form, the matrix $A_(m\times n)=(a_(ij))$ can be written as follows:

$$ A_(m\times n)=\left(\begin(array)(cccc) a_(11) & a_(12) & \ldots & a_(1n) \\ a_(21) & a_(22) & \ldots & a_(2n) \\ \ldots & \ldots & \ldots & \ldots \\ a_(m1) & a_(m2) & \ldots & a_(mn) \end(array) \right) $$

Let's introduce another term - equal matrices.

Two matrices of the same size $A_(m\times n)=(a_(ij))$ and $B_(m\times n)=(b_(ij))$ are called equal, if their corresponding elements are equal, i.e. $a_(ij)=b_(ij)$ for all $i=\overline(1,m)$ and $j=\overline(1,n)$.

Explanation for the entry $i=\overline(1,m)$: show\hide

The notation "$i=\overline(1,m)$" means that the parameter $i$ varies from 1 to m. For example, the notation $i=\overline(1,5)$ indicates that the parameter $i$ takes the values ​​1, 2, 3, 4, 5.

So, for matrices to be equal, two conditions must be met: coincidence of sizes and equality of the corresponding elements. For example, the matrix $A=\left(\begin(array)(cc) 5 & 3\\0 & -87\\8 & ​​0\end(array)\right)$ is not equal to the matrix $B=\left(\ begin(array)(cc) 8 & -9\\0 & -87 \end(array)\right)$ because matrix $A$ has size $3\times 2$ and matrix $B$ has size $2\times $2. Also, matrix $A$ is not equal to matrix $C=\left(\begin(array)(cc) 5 & 3\\98 & -87\\8 & ​​0\end(array)\right)$, since $a_( 21)\neq c_(21)$ (i.e. $0\neq 98$). But for the matrix $F=\left(\begin(array)(cc) 5 & 3\\0 & -87\\8 & ​​0\end(array)\right)$ we can safely write $A=F$ because both the sizes and the corresponding elements of the matrices $A$ and $F$ coincide.

Example No. 1

Determine the size of the matrix $A=\left(\begin(array) (ccc) -1 & -2 & 1 \\ 5 & 9 & -8 \\ -6 & 8 & 23 \\ 11 & -12 & -5 \ \4 & 0 & -10 \\ \end(array) \right)$. Indicate what the elements $a_(12)$, $a_(33)$, $a_(43)$ are equal to.

This matrix contains 5 rows and 3 columns, so its size is $5\times 3$. You can also use the notation $A_(5\times 3)$ for this matrix.

Element $a_(12)$ is at the intersection of the first row and second column, so $a_(12)=-2$. Element $a_(33)$ is at the intersection of the third row and third column, so $a_(33)=23$. Element $a_(43)$ is at the intersection of the fourth row and third column, so $a_(43)=-5$.

Answer: $a_(12)=-2$, $a_(33)=23$, $a_(43)=-5$.

Types of matrices depending on their size. Main and secondary diagonals. Matrix trace.

Let a certain matrix $A_(m\times n)$ be given. If $m=1$ (the matrix consists of one row), then the given matrix is ​​called matrix-row. If $n=1$ (the matrix consists of one column), then such a matrix is ​​called matrix-column. For example, $\left(\begin(array) (ccccc) -1 & -2 & 0 & -9 & 8 \end(array) \right)$ is a row matrix, and $\left(\begin(array) (c) -1 \\ 5 \\ 6 \end(array) \right)$ is a column matrix.

If the matrix $A_(m\times n)$ satisfies the condition $m\neq n$ (i.e., the number of rows is not equal to the number of columns), then it is often said that $A$ is a rectangular matrix. For example, the matrix $\left(\begin(array) (cccc) -1 & -2 & 0 & 9 \\ 5 & 9 & 5 & 1 \end(array) \right)$ has size $2\times 4$, those. contains 2 rows and 4 columns. Since the number of rows is not equal to the number of columns, this matrix is ​​rectangular.

If the matrix $A_(m\times n)$ satisfies the condition $m=n$ (i.e., the number of rows is equal to the number of columns), then $A$ is said to be a square matrix of order $n$. For example, $\left(\begin(array) (cc) -1 & -2 \\ 5 & 9 \end(array) \right)$ is a second-order square matrix; $\left(\begin(array) (ccc) -1 & -2 & 9 \\ 5 & 9 & 8 \\ 1 & 0 & 4 \end(array) \right)$ is a third-order square matrix. In general, the square matrix $A_(n\times n)$ can be written as follows:

$$ A_(n\times n)=\left(\begin(array)(cccc) a_(11) & a_(12) & \ldots & a_(1n) \\ a_(21) & a_(22) & \ldots & a_(2n) \\ \ldots & \ldots & \ldots & \ldots \\ a_(n1) & a_(n2) & \ldots & a_(nn) \end(array) \right) $$

The elements $a_(11)$, $a_(22)$, $\ldots$, $a_(nn)$ are said to be on main diagonal matrices $A_(n\times n)$. These elements are called main diagonal elements(or just diagonal elements). The elements $a_(1n)$, $a_(2 \; n-1)$, $\ldots$, $a_(n1)$ are on side (minor) diagonal; they are called side diagonal elements. For example, for the matrix $C=\left(\begin(array)(cccc)2&-2&9&1\\5&9&8& 0\\1& 0 & 4 & -7 \\ -4 & -9 & 5 & 6\end(array) \right)$ we have:

The elements $c_(11)=2$, $c_(22)=9$, $c_(33)=4$, $c_(44)=6$ are the main diagonal elements; elements $c_(14)=1$, $c_(23)=8$, $c_(32)=0$, $c_(41)=-4$ are side diagonal elements.

The sum of the main diagonal elements is called followed by the matrix and is denoted by $\Tr A$ (or $\Sp A$):

$$ \Tr A=a_(11)+a_(22)+\ldots+a_(nn) $$

For example, for the matrix $C=\left(\begin(array) (cccc) 2 & -2 & 9 & 1\\5 & 9 & 8 & 0\\1 & 0 & 4 & -7\\-4 & -9 & 5 & 6 \end(array)\right)$ we have:

$$ \Tr C=2+9+4+6=21. $$

The concept of diagonal elements is also used for non-square matrices. For example, for the matrix $B=\left(\begin(array) (ccccc) 2 & -2 & 9 & 1 & 7 \\ 5 & -9 & 8 & 0 & -6 \\ 1 & 0 & 4 & - 7 & -6 \end(array) \right)$ the main diagonal elements will be $b_(11)=2$, $b_(22)=-9$, $b_(33)=4$.

Types of matrices depending on the values ​​of their elements.

If all elements of the matrix $A_(m\times n)$ are equal to zero, then such a matrix is ​​called null and is usually denoted by the letter $O$. For example, $\left(\begin(array) (cc) 0 & 0 \\ 0 & 0 \\ 0 & 0 \end(array) \right)$, $\left(\begin(array) (ccc) 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end(array) \right)$ - zero matrices.

Let the matrix $A_(m\times n)$ have the following form:

Then this matrix is ​​called trapezoidal. It may not contain zero rows, but if they exist, they are located at the bottom of the matrix. In a more general form, a trapezoidal matrix can be written as follows:

Again, trailing null lines are not required. Those. Formally, we can distinguish the following conditions for a trapezoidal matrix:

  1. All elements below the main diagonal are zero.
  2. All elements from $a_(11)$ to $a_(rr)$ lying on the main diagonal are not equal to zero: $a_(11)\neq 0, \; a_(22)\neq 0, \ldots, a_(rr)\neq 0$.
  3. Either all elements of the last $m-r$ rows are zero, or $m=r$ (i.e. there are no zero rows at all).

Examples of trapezoidal matrices:

Let's move on to the next definition. The matrix $A_(m\times n)$ is called stepped, if it satisfies the following conditions:


For example, step matrices would be:

For comparison, the matrix $\left(\begin(array) (cccc) 2 & -2 & 0 & 1\\0 & 0 & 8 & 7\\0 & 0 & 4 & -7\\0 & 0 & 0 & 0 \end(array)\right)$ is not echelon because the third row has the same zero part as the second row. That is, the principle “the lower the line, the larger the zero part” is violated. I will add that a trapezoidal matrix is ​​a special case of a stepped matrix.

Let's move on to the next definition. If all elements of a square matrix located under the main diagonal are equal to zero, then such a matrix is ​​called upper triangular matrix. For example, $\left(\begin(array) (cccc) 2 & -2 & 9 & 1 \\ 0 & 9 & 8 & 0 \\ 0 & 0 & 4 & -7 \\ 0 & 0 & 0 & 6 \end(array) \right)$ is an upper triangular matrix. Note that the definition of an upper triangular matrix does not say anything about the values ​​of the elements located above the main diagonal or on the main diagonal. They can be zero or not - it doesn't matter. For example, $\left(\begin(array) (ccc) 0 & 0 & 9 \\ 0 & 0 & 0\\ 0 & 0 & 0 \end(array) \right)$ is also an upper triangular matrix.

If all elements of a square matrix located above the main diagonal are equal to zero, then such a matrix is ​​called lower triangular matrix. For example, $\left(\begin(array) (cccc) 3 & 0 & 0 & 0 \\ -5 & 1 & 0 & 0 \\ 8 & 2 & 1 & 0 \\ 5 & 4 & 0 & 6 \ end(array) \right)$ - lower triangular matrix. Note that the definition of a lower triangular matrix does not say anything about the values ​​of the elements located under or on the main diagonal. They may be zero or not - it doesn't matter. For example, $\left(\begin(array) (ccc) -5 & 0 & 0 \\ 0 & 0 & 0\\ 0 & 0 & 9 \end(array) \right)$ and $\left(\begin (array) (ccc) 0 & 0 & 0 \\ 0 & 0 & 0\\ 0 & 0 & 0 \end(array) \right)$ are also lower triangular matrices.

The square matrix is ​​called diagonal, if all elements of this matrix that do not lie on the main diagonal are equal to zero. Example: $\left(\begin(array) (cccc) 3 & 0 & 0 & 0 \\ 0 & -2 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 6 \ end(array)\right)$. The elements on the main diagonal can be anything (equal to zero or not) - it doesn't matter.

The diagonal matrix is ​​called single, if all elements of this matrix located on the main diagonal are equal to 1. For example, $\left(\begin(array) (cccc) 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end(array)\right)$ - fourth-order identity matrix; $\left(\begin(array) (cc) 1 & 0 \\ 0 & 1 \end(array)\right)$ is the second-order identity matrix.