Ifpack_ConfigDefs.h

00001 /*@HEADER
00002 // ***********************************************************************
00003 // 
00004 //       Ifpack: Object-Oriented Algebraic Preconditioner Package
00005 //                 Copyright (2002) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 //@HEADER
00028 */
00029 
00030 #ifndef _IFPACK_CONFIGDEFS_H_
00031 #define _IFPACK_CONFIGDEFS_H_
00032 
00033 #ifdef HAVE_CONFIG_H
00034 
00035 /*
00036  * The macros PACKAGE, PACKAGE_NAME, etc, get defined for each package and need to
00037  * be undef'd here to avoid warnings when this file is included from another package.
00038  * KL 11/25/02
00039  */
00040 #ifdef PACKAGE
00041 #undef PACKAGE
00042 #endif
00043 
00044 #ifdef PACKAGE_NAME
00045 #undef PACKAGE_NAME
00046 #endif
00047 
00048 #ifdef PACKAGE_BUGREPORT
00049 #undef PACKAGE_BUGREPORT
00050 #endif
00051 
00052 #ifdef PACKAGE_STRING
00053 #undef PACKAGE_STRING
00054 #endif
00055 
00056 #ifdef PACKAGE_TARNAME
00057 #undef PACKAGE_TARNAME
00058 #endif
00059 
00060 #ifdef PACKAGE_VERSION
00061 #undef PACKAGE_VERSION
00062 #endif
00063 
00064 #ifdef VERSION
00065 #undef VERSION
00066 #endif
00067 
00068 #include <Ifpack_config.h>
00069 
00070 #ifdef PACKAGE
00071 #undef PACKAGE
00072 #endif
00073 
00074 #ifdef PACKAGE_NAME
00075 #undef PACKAGE_NAME
00076 #endif
00077 
00078 #ifdef PACKAGE_BUGREPORT
00079 #undef PACKAGE_BUGREPORT
00080 #endif
00081 
00082 #ifdef PACKAGE_STRING
00083 #undef PACKAGE_STRING
00084 #endif
00085 
00086 #ifdef PACKAGE_TARNAME
00087 #undef PACKAGE_TARNAME
00088 #endif
00089 
00090 #ifdef PACKAGE_VERSION
00091 #undef PACKAGE_VERSION
00092 #endif
00093 
00094 #ifdef VERSION
00095 #undef VERSION
00096 #endif
00097 
00098 #ifdef HAVE_MPI
00099 
00100 #ifndef EPETRA_MPI
00101 #define EPETRA_MPI
00102 #endif
00103 
00104 #endif
00105 
00106 /******************************************************************************
00107  *   Choose header file flavor: either ANSI-style (no .h, e.g. <iostream>) or
00108  * old-style (with .h, e.g., <iostream.h>). 
00109  * KL 9/26/03
00110  *****************************************************************************/
00111 
00112 #if HAVE_CSTDIO
00113 #include <cstdio>
00114 #elif HAVE_STDIO_H
00115 #include <stdio.h>
00116 #else
00117 #error "Found neither cstdio nor stdio.h"
00118 #endif
00119 
00120 #if HAVE_STRING
00121 #include <string>
00122 #elif HAVE_STRING_H
00123 #include <string.h>
00124 #else
00125 #error "Found neither string nor string.h"
00126 #endif
00127 
00128 #if HAVE_IOSTREAM
00129 #include <iostream>
00130 #elif HAVE_IOSTREAM_H
00131 #include <iostream.h>
00132 #else
00133 #error "Found neither iostream nor iostream.h"
00134 #endif
00135 
00136 #ifdef HAVE_ALGORITHM
00137 #include <algorithm>
00138 #elif defined(HAVE_ALGO_H)
00139 #include <algo.h>
00140 #elif defined(HAVE_ALGORITHM_H)
00141 #include <algorithm.h>
00142 #else
00143 #error "Did not find algorithm, algo.h or algorithm.h"
00144 #endif
00145 
00146 #if HAVE_VECTOR
00147 #include <vector>
00148 #elif HAVE_IOSTREAM_H
00149 #include <vector.h>
00150 #else
00151 #error "Found neither vector nor vector.h"
00152 #endif
00153 
00154 #if defined(TFLOP)
00155 #ifdef HAVE_STRING
00156 using std::string;
00157 #endif
00158 #ifdef HAVE_IOSTREAM
00159 using std::istream;
00160 using std::ostream;
00161 using std::cerr;
00162 using std::cout;
00163 using std::endl;
00164 #endif
00165 #else /* NOT TFLOP */
00166 using namespace std;
00167 #endif /* defined(TFLOP) */
00168 
00169 #endif
00170 
00171 // prints out an error message if variable is not zero,
00172 // and returns this value.
00173 #define IFPACK_CHK_ERR(ifpack_err) \
00174 { if (ifpack_err < 0) { \
00175   std::cerr << "IFPACK ERROR " << ifpack_err << ", " \
00176     << __FILE__ << ", line " << __LINE__ << std::endl; \
00177     return(ifpack_err);  } }
00178 
00179 // prints out an error message if variable is not zero,
00180 // and returns void
00181 #define IFPACK_CHK_ERRV(ifpack_err) \
00182 { if (ifpack_err < 0) { \
00183   std::cerr << "IFPACK ERROR " << ifpack_err << ", " \
00184     << __FILE__ << ", line " << __LINE__ << std::endl; \
00185     return;  } }
00186 // prints out an error message and returns
00187 #define IFPACK_RETURN(ifpack_err) \
00188 { if (ifpack_err < 0) { \
00189   std::cerr << "IFPACK ERROR " << ifpack_err << ", " \
00190     << __FILE__ << ", line " << __LINE__ << std::endl; \
00191                } return(ifpack_err); }
00192 
00193 #define IFPACK_SGN(x) (((x) < 0.0) ? -1.0 : 1.0)  /* sign function */
00194 #define IFPACK_ABS(x) (((x) > 0.0) ? (x) : (-x))  /* abs function */
00195 
00196 #endif /*_IFPACK_CONFIGDEFS_H_*/

Generated on Tue Oct 20 12:48:53 2009 for IFPACK by doxygen 1.4.7