This function computes the bilinear form xTAy.
BLINF — The value of xTAy is returned in BLINF. (Output)
A — Real NRA by NCA matrix. (Input)
X — Real vector of length NRA. (Input)
Y — Real vector of length NCA. (Input)
NRA — Number of
rows of A.
(Input)
Default: NRA = size
(A,1).
NCA — Number of
columns of A.
(Input)
Default: NCA = size
(A,2).
LDA — Leading
dimension of A
exactly as specified in the dimension statement of the calling
program. (Input)
Default: LDA = size
(A,1).
Generic: BLINF (A, X, Y [,…])
Specific: The specific interface names are S_BLINF and D_BLINF.
Single: BLINF(NRA, NCA, A, LDA, X, Y)
Double: The double precision name is DBLINF.
Given the real rectangular matrix A and two vectors x and y, BLINF computes the bilinear form xTAy.
The quadratic form can be computed by calling BLINF with the vector X in place of the vector Y.
Compute the bilinear form xTAy, where x is a vector of length 5, A is a 5 ´ 2 matrix and y is a vector of length 2.
USE BLINF_INT
USE UMACH_INT
IMPLICIT NONE
! Declare variables
INTEGER NCA, NRA
PARAMETER (NCA=2, NRA=5)
!
INTEGER NOUT
REAL A(NRA,NCA), VALUE, X(NRA), Y(NCA)
! Set values for A
! A = ( -2.0 2.0 )
! ( 3.0 -6.0 )
! ( -4.0 7.0 )
! ( 1.0 -8.0 )
! ( 0.0 10.0 )
! Set values for X
! X = ( 1.0 -2.0 3.0 -4.0 -5.0 )
! Set values for Y
! Y = ( -6.0 3.0 )
!
DATA A/-2.0, 3.0, -4.0, 1.0, 0.0, 2.0, -6.0, 7.0, -8.0, 10.0/
DATA X/1.0, -2.0, 3.0, -4.0, -5.0/
DATA Y/-6.0, 3.0/
! Compute bilinear form
VALUE = BLINF(A,X,Y)
! Print results
CALL UMACH (2, NOUT)
WRITE (NOUT,*) ' The bilinear form trans(x)*A*y = ', VALUE
END
The bilinear form trans(x)*A*y = 195.000
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |