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