CRGCG

Copies a real general matrix to a complex general matrix.

Required Arguments

A — Real matrix of order N. (Input)

B — Complex matrix of order N containing a copy of A. (Output)

Optional Arguments

N — Order of the matrices A and B. (Input)
Default: N = 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).

LDB — Leading dimension of B exactly as specified in the dimension statement of the calling program. (Input)
Default: LDB = SIZE (B,1).

FORTRAN 90 Interface

Generic: CALL CRGCG (A, B [])

Specific: The specific interface names are S_CRGCG and D_CRGCG.

FORTRAN 77 Interface

Single: CALL CRGCG (N, A, LDA, B, LDB)

Double: The double precision name is DCRGCG.

Description

The routine CRGCG copies a real N × N matrix to a complex N × N matrix.

Example

A 3 × 3 real matrix is copied to a 3 × 3 complex matrix.

 

USE CRGCG_INT

USE WRCRN_INT

 

IMPLICIT NONE

! Declare variables

INTEGER LDA, LDB, N

PARAMETER (LDA=3, LDB=3, N=3)

!

REAL A(LDA,N)

COMPLEX B(LDB,N)

! Set values for A

! A = ( 2.0 1.0 3.0 )

! ( 4.0 1.0 0.0 )

! ( -1.0 2.0 0.0 )

!

DATA A/2.0, 4.0, -1.0, 1.0, 1.0, 2.0, 3.0, 0.0, 0.0/

! Convert real A to complex B

CALL CRGCG (A, B)

! Print results

CALL WRCRN ('B', B)

END

Output

 

B

1 2 3

1 ( 2.000, 0.000) ( 1.000, 0.000) ( 3.000, 0.000)

2 ( 4.000, 0.000) ( 1.000, 0.000) ( 0.000, 0.000)

3 (-1.000, 0.000) ( 2.000, 0.000) ( 0.000, 0.000)