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
scalm.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 scaling routines
11 C
12 C Input/Output parameters:
13 C
14 C M - rows (int)(input)
15 C N - columns (int)(input)
16 C S - scale factor (real)(input)
17 C A - matrix to be scaled (real)(input, output)
18 C LDA - leading dimesion of A (int)(input)
19 
20  SUBROUTINE sscalm (M, N, S, A, LDA)
21 CDEC$ IF DEFINED (FTN_EXPORTS)
22 CDEC$ ATTRIBUTES DLLEXPORT::SSCALM
23 CDEC$ ENDIF
24  INTEGER m, n, lda
25  REAL s
26  REAL a(lda*n)
27  INTEGER i
28 
29  IF (m .EQ. lda) THEN
30  CALL sscal(m * n, s, a, 1)
31  ELSE
32  DO 10 i = 0, n-1
33  CALL sscal(m, s, a(i*lda+1), 1)
34 10 CONTINUE
35  END IF
36  RETURN
37  END !SUBROUTINE SSCALM
38 
39  SUBROUTINE dscalm (M, N, S, A, LDA)
40 CDEC$ IF DEFINED (FTN_EXPORTS)
41 CDEC$ ATTRIBUTES DLLEXPORT::DSCALM
42 CDEC$ ENDIF
43  INTEGER m, n, lda
44  DOUBLE PRECISION s
45  DOUBLE PRECISION a(lda*n)
46  INTEGER i
47 
48  IF (m .EQ. lda) THEN
49  CALL dscal(m * n, s, a, 1)
50  ELSE
51  DO 10 i = 0, n-1
52  CALL dscal(m, s, a(i*lda+1), 1)
53 10 CONTINUE
54  END IF
55  RETURN
56  END !SUBROUTINE DSCALM
57 
58  SUBROUTINE cscalm (M, N, S, A, LDA)
59 CDEC$ IF DEFINED (FTN_EXPORTS)
60 CDEC$ ATTRIBUTES DLLEXPORT::CSCALM
61 CDEC$ ENDIF
62  INTEGER m, n, lda
63  COMPLEX s
64  COMPLEX a(lda*n)
65  INTEGER i
66 
67  IF (m .EQ. lda) THEN
68  CALL cscal(m * n, s, a, 1)
69  ELSE
70  DO 10 i = 0, n-1
71  CALL cscal(m, s, a(i*lda+1), 1)
72 10 CONTINUE
73  END IF
74  RETURN
75  END !SUBROUTINE CSCALM
76 
77  SUBROUTINE zscalm (M, N, S, A, LDA)
78 CDEC$ IF DEFINED (FTN_EXPORTS)
79 CDEC$ ATTRIBUTES DLLEXPORT::ZSCALM
80 CDEC$ ENDIF
81  INTEGER m, n, lda
82  DOUBLE COMPLEX s
83  DOUBLE COMPLEX a(lda*n)
84  INTEGER i
85 
86  IF (m .EQ. lda) THEN
87  CALL zscal(m * n, s, a, 1)
88  ELSE
89  DO 10 i = 0, n-1
90  CALL zscal(m, s, a(i*lda+1), 1)
91 10 CONTINUE
92  END IF
93  RETURN
94  END !SUBROUTINE ZSCALM