Computes the product of a matrix or vector and the inverse of a matrix.
Matrix containing the product of A and B-1. (Output)
A — Right operand matrix or vector. This is an array of rank 1, 2, or 3. It may be real, double, complex, or double complex. (Input)
B — Left operand matrix. This is an array of rank 2, or 3. It may be real, double, complex, double complex, or one of the computational sparse matrix derived types, ?_hbc_sparse. (Input)
This operator uses the routines lin_sol_gen or lin_sol_lsq (See Chapter 1, “Linear Systems”).
The option and derived type names are given in the following tables:
For a description on how to use these options, see Matrix Optional Data Changes. See lin_sol_gen and lin_sol_lsq located in Chapter 1, “Linear Systems” for the specific options for these routines.
Computes the product of matrix A and the inverse of matrix B, for square non-singular matrices or the corresponding Moore-Penrose generalized inverse matrix for singular square matrices or rectangular matrices. The operation may be read times generalized inverse. The results are in a precision and data type that matches the most accurate or complex operand.
.xi. can be used with either dense or sparse matrices. It is MPI capable for dense matrices only.
real(kind(1e0)) :: one=1.0e0, err
real(kind(1e0)), dimension(n,n) :: A, b, x
! Generate random matrices for A and b:
! Compute the solution matrix of xA = b.
err = norm(b - (x .x. A))/(norm(A)*norm(x)+norm(b))
if (err <= sqrt(epsilon(one))) &
write (*,*) 'Example for .xi. operator is correct.'
real (kind(1.e0)) x(N,N), y(N,N), a(N,N)
if (err <= sqrt(epsilon(one))) then
write (*,*) 'Sparse example for .xi. operator is correct.'
Sparse example for .xi. operator is correct.
! This is the equivalent of Parallel Example 1 for .xi., with box data types
integer, parameter :: n=32, nr=4
real(kind(1e0)), dimension(n,n,nr) :: A, b, x, err(nr)
! Generate random matrices for A and b:
! Compute the box solution matrix of xA = b.
err = norm(b - (x .x. A))/(norm(A)*norm(x)+norm(b))
if (ALL(err <= sqrt(epsilon(one))) .and. MP_RANK == 0) &
write (*,*) 'Parallel Example 1 is correct.'
! See to any error messages and quit MPI.
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |