annotate liboctave/util/i1mach.f @ 31225:3eab70385569

sparse-xpow.cc: Use faster multiplication technique, this time for complex
author Arun Giridhar <arungiridhar@gmail.com>
date Sun, 11 Sep 2022 13:53:38 -0400
parents 796f54d4ddbf
children 597f3ee61a48
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
1 c Copyright (C) 1996-2022 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
2 c
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
3 c See the file COPYRIGHT.md in the top-level directory of this
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 c distribution or <https://octave.org/copyright/>.
24537
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
5 c
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
6 c This file is part of Octave.
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
7 c
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
8 c Octave is free software: you can redistribute it and/or modify it
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
9 c under the terms of the GNU General Public License as published by
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
10 c the Free Software Foundation, either version 3 of the License, or
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
11 c (at your option) any later version.
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
12 c
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
13 c Octave is distributed in the hope that it will be useful, but
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
14 c WITHOUT ANY WARRANTY; without even the implied warranty of
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
15 c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
16 c GNU General Public License for more details.
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
17 c
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
18 c You should have received a copy of the GNU General Public License
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
19 c along with Octave; see the file COPYING. If not, see
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
20 c <https://www.gnu.org/licenses/>.
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23426
diff changeset
21 c
9372
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
22 integer function i1mach (i)
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
23 integer i, imach(16)
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
24 logical init
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
25 double precision dlamch
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
26 real slamch
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
27 external dlamch, slamch
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
28 save imach, init
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
29 data imach / 5, 6, 0, 6, 32, 4, 2, 31, 2147483647,
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
30 $ 2, 0, 0, 0, 0, 0, 0 /
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
31 data init /.false./
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
32 if (.not. init) then
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
33 imach(11) = slamch ('n')
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
34 imach(12) = slamch ('m')
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
35 imach(13) = slamch ('l')
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
36 imach(14) = dlamch ('n')
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
37 imach(15) = dlamch ('m')
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
38 imach(16) = dlamch ('l')
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
39 init = .true.
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
40 endif
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
41 if (i .lt. 1 .or. i .gt. 16) goto 999
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
42 i1mach = imach(i)
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
43 return
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
44 999 write (*, 1999) i
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
45 1999 format (' i1mach - i out of bounds', i10)
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
46 call xstopx (' ')
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
47 i1mach = 0
32b15d5c3147 implement d1mach, i1mach, and r1mach using slamch and dlamch from lapack
John W. Eaton <jwe@octave.org>
parents: 982
diff changeset
48 end