linalg 1.8.2
A linear algebra library that provides a user-friendly interface to several BLAS and LAPACK routines.
Loading...
Searching...
No Matches
linalg::cholesky_rank1_downdate Interface Reference

Computes the rank 1 downdate to a Cholesky factored matrix (upper triangular). More...

Public Member Functions

 cholesky_rank1_downdate_dbl
 
 cholesky_rank1_downdate_cmplx
 

Detailed Description

Computes the rank 1 downdate to a Cholesky factored matrix (upper triangular).

Syntax
subroutine cholesky_rank1_downdate(real(real64) r(:,:), real(real64) u(:), optional real(real64) work(:), optional class(errors) err)
subroutine cholesky_rank1_downdate(complex(real64) r(:,:), complex(real64) u(:), optional complex(real64) work(:), optional class(errors) err)
Parameters
[in,out]rOn input, the N-by-N upper triangular matrix R. On output, the updated matrix R1.
[in,out]uOn input, the N-element update vector U. On output, the rotation sines used to transform R to R1.
[out]workAn optional argument that if supplied prevents local memory allocation. If provided, the array must have at least N elements. Additionally, this workspace array is used to contain the rotation cosines used to transform R to R1.
[in,out]errAn optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
  • LA_ARRAY_SIZE_ERROR: Occurs if any of the input array sizes are incorrect.
  • LA_OUT_OF_MEMORY_ERROR: Occurs if local memory must be allocated, and there is insufficient memory available.
  • LA_MATRIX_FORMAT_ERROR: Occurs if the downdated matrix is not positive definite.
  • LA_SINGULAR_MATRIX_ERROR: Occurs if r is singular.
Notes
This routine utilizes the QRUPDATE routine DCH1DN (ZCH1DN in the complex case).
See Also
Source
Usage
The following example illustrates the use of the rank 1 Cholesky downdate, and compares the results to factoring the original rank 1 downdated matrix.
program example
use iso_fortran_env, only : real64, int32
use linalg_factor, only : cholesky_factor, cholesky_rank1_downdate
use linalg, only : rank1_update
implicit none
! Variables
real(real64) :: a(3,3), u(3), ad(3,3)
integer(int32) :: i
! Build the 3-by-3 matrix A.
! | 4.25 11.25 -15 |
! A = | 11.25 39.25 -46 |
! | -15 -46 102 |
a = reshape([4.25d0, 11.25d0, -15.0d0, 11.25d0, 39.25d0, -46.0d0, &
-15.0d0, -46.0d0, 102.0d0], [3, 3])
! The downdate vector
! | 0.5 |
! u = | -1.5 |
! | 2 |
u = [0.5d0, -1.5d0, 2.0d0]
! Compute the rank 1 downdate of A
ad = a
call rank1_update(-1.0d0, u, u, ad)
! Compute the Cholesky factorization of the original matrix
! Apply the rank 1 downdate to the factored matrix
! Compute the Cholesky factorization of the downdate to the original matrix
call cholesky_factor(ad)
! Display the matrices
print '(A)', "Downdating the Factored Form:"
do i = 1, size(a, 1)
print *, a(i,:)
end do
print '(A)', "Downdating A Directly:"
do i = 1, size(ad, 1)
print *, ad(i,:)
end do
end program
Computes the Cholesky factorization of a symmetric, positive definite matrix.
Definition linalg.f90:1687
Computes the rank 1 downdate to a Cholesky factored matrix (upper triangular).
Definition linalg.f90:1893
Performs the rank-1 update to matrix A such that: , where is an M-by-N matrix, is a scalar,...
Definition linalg.f90:396
Provides a set of common linear algebra routines.
Definition linalg.f90:145
The above program produces the following output.
Downdating the Factored Form:
2.0000000000000000 6.0000000000000000 -8.0000000000000000
0.0000000000000000 1.0000000000000000 4.9999999999999973
0.0000000000000000 0.0000000000000000 3.0000000000000049
Downdating A Directly:
2.0000000000000000 6.0000000000000000 -8.0000000000000000
0.0000000000000000 1.0000000000000000 5.0000000000000000
0.0000000000000000 0.0000000000000000 3.0000000000000000

Definition at line 1893 of file linalg.f90.


The documentation for this interface was generated from the following file: