CVM Class Library  8.1
This C++ class library encapsulates concepts of vector and different matrices including square, band, symmetric and hermitian ones in Euclidean space of real and complex numbers.
 All Classes Files Functions Variables Typedefs Friends Macros Pages
copym.f
Go to the documentation of this file.
1 C CVM Class Library
2 C http://cvmlib.com
3 C
4 C Copyright Sergei Nikolaev 1992-2013
5 C Distributed under the Boost Software License, Version 1.0.
6 C (See accompanying file LICENSE_1_0.txt or copy at
7 C http://www.boost.org/LICENSE_1_0.txt)
8 C
9 C
10 C Matrix copy routines
11 C
12 C Input/Output parameters:
13 C
14 C M - rows (int)(input)
15 C N - columns (int)(input)
16 C A - source matrix (real)(input)
17 C B - destination matrix (real)(output)
18 C LDA - leading dimesion of A (int)(input)
19 C LDB - leading dimesion of B (int)(input)
20 
21  SUBROUTINE scopym (M, N, A, LDA, B, LDB)
22 CDEC$ IF DEFINED (FTN_EXPORTS)
23 CDEC$ ATTRIBUTES DLLEXPORT::SCOPYM
24 CDEC$ ENDIF
25  INTEGER m, n, lda, ldb
26  REAL a(lda*n), b(ldb*n)
27  INTEGER i
28 
29  IF (m .EQ. lda .AND. m .EQ. ldb) THEN
30  CALL scopy(m * n, a, 1, b, 1)
31  ELSE
32  DO 10 i = 0, n-1
33  CALL scopy(m, a(i*lda+1), 1, b(i*ldb+1), 1)
34 10 CONTINUE
35  END IF
36  RETURN
37  END !SUBROUTINE SCOPYM
38 
39  SUBROUTINE dcopym (M, N, A, LDA, B, LDB)
40 CDEC$ IF DEFINED (FTN_EXPORTS)
41 CDEC$ ATTRIBUTES DLLEXPORT::DCOPYM
42 CDEC$ ENDIF
43  INTEGER m, n, lda, ldb
44  DOUBLE PRECISION a(lda*n), b(ldb*n)
45  INTEGER i
46 
47  IF (m .EQ. lda .AND. m .EQ. ldb) THEN
48  CALL dcopy(m * n, a, 1, b, 1)
49  ELSE
50  DO 20 i = 0, n-1
51  CALL dcopy(m, a(i*lda+1), 1, b(i*ldb+1), 1)
52 20 CONTINUE
53  END IF
54  RETURN
55  END !SUBROUTINE DCOPYM
56 
57  SUBROUTINE ccopym (M, N, A, LDA, B, LDB)
58 CDEC$ IF DEFINED (FTN_EXPORTS)
59 CDEC$ ATTRIBUTES DLLEXPORT::CCOPYM
60 CDEC$ ENDIF
61  INTEGER m, n, lda, ldb
62  COMPLEX a(lda*n), b(ldb*n)
63  INTEGER i
64 
65  IF (m .EQ. lda .AND. m .EQ. ldb) THEN
66  CALL ccopy(m * n, a, 1, b, 1)
67  ELSE
68  DO 30 i = 0, n-1
69  CALL ccopy(m, a(i*lda+1), 1, b(i*ldb+1), 1)
70 30 CONTINUE
71  END IF
72  RETURN
73  END !SUBROUTINE CCOPYM
74 
75  SUBROUTINE zcopym (M, N, A, LDA, B, LDB)
76 CDEC$ IF DEFINED (FTN_EXPORTS)
77 CDEC$ ATTRIBUTES DLLEXPORT::ZCOPYM
78 CDEC$ ENDIF
79  INTEGER m, n, lda, ldb
80  DOUBLE COMPLEX a(lda*n), b(ldb*n)
81  INTEGER i
82 
83  IF (m .EQ. lda .AND. m .EQ. ldb) THEN
84  CALL zcopy(m * n, a, 1, b, 1)
85  ELSE
86  DO 40 i = 0, n-1
87  CALL zcopy(m, a(i*lda+1), 1, b(i*ldb+1), 1)
88 40 CONTINUE
89  END IF
90  RETURN
91  END !SUBROUTINE ZCOPYM