00001 /* Ergo, version 3.7, a program for linear scaling electronic structure 00002 * calculations. 00003 * Copyright (C) 2018 Elias Rudberg, Emanuel H. Rubensson, Pawel Salek, 00004 * and Anastasia Kruchinina. 00005 * 00006 * This program is free software: you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation, either version 3 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00018 * 00019 * Primary academic reference: 00020 * Ergo: An open-source program for linear-scaling electronic structure 00021 * calculations, 00022 * Elias Rudberg, Emanuel H. Rubensson, Pawel Salek, and Anastasia 00023 * Kruchinina, 00024 * SoftwareX 7, 107 (2018), 00025 * <http://dx.doi.org/10.1016/j.softx.2018.03.005> 00026 * 00027 * For further information about Ergo, see <http://www.ergoscf.org>. 00028 */ 00029 00030 /* This file belongs to the template_lapack part of the Ergo source 00031 * code. The source files in the template_lapack directory are modified 00032 * versions of files originally distributed as CLAPACK, see the 00033 * Copyright/license notice in the file template_lapack/COPYING. 00034 */ 00035 00036 00037 #ifndef TEMPLATE_LAPACK_LAISNAN_HEADER 00038 #define TEMPLATE_LAPACK_LAISNAN_HEADER 00039 00040 template<class Treal> 00041 logical template_lapack_laisnan(Treal *din1, Treal *din2) 00042 { 00043 /* System generated locals */ 00044 logical ret_val; 00045 00046 00047 /* -- LAPACK auxiliary routine (version 3.2) -- */ 00048 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 00049 /* November 2006 */ 00050 00051 /* .. Scalar Arguments .. */ 00052 /* .. */ 00053 00054 /* Purpose */ 00055 /* ======= */ 00056 00057 /* This routine is not for general use. It exists solely to avoid */ 00058 /* over-optimization in DISNAN. */ 00059 00060 /* DLAISNAN checks for NaNs by comparing its two arguments for */ 00061 /* inequality. NaN is the only floating-point value where NaN != NaN */ 00062 /* returns .TRUE. To check for NaNs, pass the same variable as both */ 00063 /* arguments. */ 00064 00065 /* A compiler must assume that the two arguments are */ 00066 /* not the same variable, and the test will not be optimized away. */ 00067 /* Interprocedural or whole-program optimization may delete this */ 00068 /* test. The ISNAN functions will be replaced by the correct */ 00069 /* Fortran 03 intrinsic once the intrinsic is widely available. */ 00070 00071 /* Arguments */ 00072 /* ========= */ 00073 00074 /* DIN1 (input) DOUBLE PRECISION */ 00075 /* DIN2 (input) DOUBLE PRECISION */ 00076 /* Two numbers to compare for inequality. */ 00077 00078 /* ===================================================================== */ 00079 00080 /* .. Executable Statements .. */ 00081 ret_val = *din1 != *din2; 00082 return ret_val; 00083 } /* dlaisnan_ */ 00084 00085 #endif