Intel® Math Kernel Library Cookbook


Add to my manuals
84 Pages

advertisement

Intel® Math Kernel Library Cookbook | Manualzz

Solving a system of linear equations with a block tridiagonal symmetric positive definite coefficient matrix

5

Goal

Solve a system of linear equations with a Cholesky-factored symmetric positive definite block tridiagonal coefficient matrix.

Solution

Given a coefficient symmetric positive definite block tridiagonal matrix (with square blocks each of the same

NB-by-NB size) is LLT factored, the solving stage consists of:

1.

Solve the system of linear equations with a lower bidiagonal coefficient matrix which is composed of N by N blocks of size NB by NB and with diagonal blocks which are lower triangular matrices:

a.

Solve the N local systems of equations with lower triangular diagonal blocks of size NB by NB which are used as coefficient matrices and respective parts of the right hand side vectors.

b.

Update the local right hand sides.

2.

Solve the system of linear equations with an upper bidiagonal coefficient matrix which is composted of block size N by N blocks of size NB by NB and with diagonal blocks which are upper triangular matrices.

a.

Solve the local systems of equations.

b.

Update the local right hand sides.

Source code: see the

BlockTDS_SPD/source/dpbltrs.f

file in the samples archive available at http:// software.intel.com/en-us/mkl_cookbook_samples.

Cholesky factorization of a symmetric positive definite block tridiagonal matrix

CALL DTRSM('L', 'L', 'N', 'N', NB, NRHS, 1D0, D, LDD, F, LDF)

DO K = 2, N

CALL DGEMM('N', 'N', NB, NRHS, NB, -1D0, B(1,(K-2)*NB+1), LDB, F((K-2)*NB+1,1), LDF, 1D0,

F((K-1)*NB+1,1), LDF)

CALL DTRSM('L','L', 'N', 'N', NB, NRHS, 1D0, D(1,(K-1)*NB+1), LDD, F((K-1)*NB+1,1), LDF)

END DO

CALL DTRSM('L', 'L', 'T', 'N', NB, NRHS, 1D0, D(1,(N-1)*NB+1), LDD, F((N-1)*NB+1,1), LDF)

DO K = N-1, 1, -1

CALL DGEMM('T', 'N', NB, NRHS, NB, -1D0, B(1,(K-1)*NB+1), LDB, F(K*NB+1,1), LDF, 1D0,

F((K-1)*NB+1,1), LDF)

CALL DTRSM('L','L', 'T', 'N', NB, NRHS, 1D0, D(1,(K-1)*NB+1), LDD, F((K-1)*NB+1,1), LDF)

END DO

43

5

Intel

®

Math Kernel Library Cookbook

Routines Used

Task Routine

Solve a local system of linear equations

Update the local right hand sides

DTRSM

DGEMM

Discussion

Consider a system of linear equations described by:

Description

Solves a triangular matrix equation.

Computes a matrix-matrix product with general matrices.

Assume that matrix A is a symmetric positive definite block tridiagonal coefficient matrix with all blocks of

size NB by NB. A can be factored as described in Factorizing block tridiagonal symmetric positive definite matrices uisng BLAS and LAPACK routines

to give:

Then the algorithm to solve the system of equations is:

1.

Solve the system of linear equations with a lower bidiagonal coefficient matrix in which the diagonal blocks are lower triangular matrices:

Y

1

=L

1

-1

F do i=2,N

1

//trsm()

G i

Y i end do

=F

=L i i

- C

-1

G i i - 1

Y i - 1

//trsm()

//gemm()

2.

Solve the system of linear equations with an upper bidiagonal coefficient matrix in which the diagonal blocks are upper triangular matrices:

X

N

=L

N

-T

Y

N

//trsm() do i=N-1,1,-1

Z i

X i end do

=F

=L i i

-C

-T i

T

Z

X i i + 1

//gemm()

//trsm()

44

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals