BLINF
This function computes the bilinear form xTAy.
Function Return Value
BLINF — The value of xTAy is returned in BLINF. (Output)
Required Arguments
A — Real NRA by NCA matrix. (Input)
X — Real vector of length NRA. (Input)
Y — Real vector of length NCA. (Input)
Optional Arguments
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).
FORTRAN 90 Interface
Generic: BLINF (A, X, Y [])
Specific: The specific interface names are S_BLINF and D_BLINF.
FORTRAN 77 Interface
Single: BLINF(NRA, NCA, A, LDA, X, Y)
Double: The double precision name is DBLINF.
Description
Given the real rectangular matrix A and two vectors x and y, BLINF computes the bilinear form xTAy.
Comments
The quadratic form can be computed by calling BLINF with the vector X in place of the vector Y.
Example
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
Output
 
The bilinear form trans(x)*A*y = 195.000
Published date: 03/19/2020
Last modified date: 03/19/2020