ergo
template_lapack_laisnan.h
Go to the documentation of this file.
1/* Ergo, version 3.8.2, a program for linear scaling electronic structure
2 * calculations.
3 * Copyright (C) 2023 Elias Rudberg, Emanuel H. Rubensson, Pawel Salek,
4 * and Anastasia Kruchinina.
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * Primary academic reference:
20 * Ergo: An open-source program for linear-scaling electronic structure
21 * calculations,
22 * Elias Rudberg, Emanuel H. Rubensson, Pawel Salek, and Anastasia
23 * Kruchinina,
24 * SoftwareX 7, 107 (2018),
25 * <http://dx.doi.org/10.1016/j.softx.2018.03.005>
26 *
27 * For further information about Ergo, see <http://www.ergoscf.org>.
28 */
29
30 /* This file belongs to the template_lapack part of the Ergo source
31 * code. The source files in the template_lapack directory are modified
32 * versions of files originally distributed as CLAPACK, see the
33 * Copyright/license notice in the file template_lapack/COPYING.
34 */
35
36
37#ifndef TEMPLATE_LAPACK_LAISNAN_HEADER
38#define TEMPLATE_LAPACK_LAISNAN_HEADER
39
40template<class Treal>
41logical template_lapack_laisnan(Treal *din1, Treal *din2)
42{
43 /* System generated locals */
44 logical ret_val;
45
46
47/* -- LAPACK auxiliary routine (version 3.2) -- */
48/* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
49/* November 2006 */
50
51/* .. Scalar Arguments .. */
52/* .. */
53
54/* Purpose */
55/* ======= */
56
57/* This routine is not for general use. It exists solely to avoid */
58/* over-optimization in DISNAN. */
59
60/* DLAISNAN checks for NaNs by comparing its two arguments for */
61/* inequality. NaN is the only floating-point value where NaN != NaN */
62/* returns .TRUE. To check for NaNs, pass the same variable as both */
63/* arguments. */
64
65/* A compiler must assume that the two arguments are */
66/* not the same variable, and the test will not be optimized away. */
67/* Interprocedural or whole-program optimization may delete this */
68/* test. The ISNAN functions will be replaced by the correct */
69/* Fortran 03 intrinsic once the intrinsic is widely available. */
70
71/* Arguments */
72/* ========= */
73
74/* DIN1 (input) DOUBLE PRECISION */
75/* DIN2 (input) DOUBLE PRECISION */
76/* Two numbers to compare for inequality. */
77
78/* ===================================================================== */
79
80/* .. Executable Statements .. */
81 ret_val = *din1 != *din2;
82 return ret_val;
83} /* dlaisnan_ */
84
85#endif
bool logical
Definition template_blas_common.h:41
logical template_lapack_laisnan(Treal *din1, Treal *din2)
Definition template_lapack_laisnan.h:41