• Main Page
  • Related Pages
  • Classes
  • Files
  • File List
  • File Members

Amesos_ConfigDefs.h

Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //                Amesos: Direct Sparse Solver Package
00005 //                 Copyright (2004) 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 #ifndef AMESOS_CONFIGDEFS
00030 #define AMESOS_CONFIGDEFS
00031 
00032 #ifdef PACKAGE
00033 #undef PACKAGE
00034 #endif
00035 
00036 #ifdef PACKAGE_NAME
00037 #undef PACKAGE_NAME
00038 #endif
00039 
00040 #ifdef PACKAGE_BUGREPORT
00041 #undef PACKAGE_BUGREPORT
00042 #endif
00043 
00044 #ifdef PACKAGE_STRING
00045 #undef PACKAGE_STRING
00046 #endif
00047 
00048 #ifdef PACKAGE_TARNAME
00049 #undef PACKAGE_TARNAME
00050 #endif
00051 
00052 #ifdef PACKAGE_VERSION
00053 #undef PACKAGE_VERSION
00054 #endif
00055 
00056 #ifdef VERSION
00057 #undef VERSION
00058 #endif
00059 
00060 #ifdef F77_FUNC
00061 #undef F77_FUNC
00062 #endif
00063 
00064 #include "Amesos_config.h"
00065 #include "Epetra_ConfigDefs.h"
00066 #ifdef HAVE_VECTOR
00067 #include <vector>
00068 #else
00069   Amesos requires STL vector class
00070 #endif
00071 
00072 #define AMESOS_PRINT(variable) { { \
00073                       if ( debug_ != 0) { std::cerr << "AMESOS_PRINT " << # variable << "= " << variable << ", " \
00074                            << __FILE__ << ", line " << __LINE__ << std::endl; }  }\
00075                    }
00076 
00077 // prints out an error message if variable is not zero,
00078 // and return this value. This is a copy of macro EPETRA_CHK_ERR,
00079 // here modified so that the user sees an "AMESOS ERROR" instead
00080 // of a possibly misleading "Epetra ERROR".
00081 
00082 #define AMESOS_CHK_ERR(a) { { int amesos_err = a; \
00083                               if ((amesos_err < 0 && Epetra_Object::GetTracebackMode() > 0) || \
00084                                   (amesos_err > 0 && Epetra_Object::GetTracebackMode() > 1)) { \
00085                       std::cerr << "AMESOS ERROR " << amesos_err << ", " \
00086                            << __FILE__ << ", line " << __LINE__ << std::endl; }\
00087                       if (amesos_err != 0) return(amesos_err);  }\
00088                    }
00089 //#define AMESOS_CHK_ERR(amesos_err) { EPETRA_CHK_ERR( amesos_err ) }
00090 
00091 // prints out an error message if variable is not zero,
00092 // returns void
00093 #define AMESOS_CHK_ERRV(amesos_err) \
00094 { if (amesos_err != 0) { \
00095   std::cerr << "AMESOS ERROR " << amesos_err << ", " \
00096     << __FILE__ << ", line " << __LINE__ << std::endl; \
00097     return;  } }
00098 
00099 // prints out an error message if variable is not zero,
00100 // returns void
00101 #define AMESOS_RETURN(amesos_err) \
00102 { \
00103   if (amesos_err != 0) \
00104     std::cerr << "AMESOS ERROR " << amesos_err << ", " \
00105       << __FILE__ << ", line " << __LINE__ << std::endl; \
00106   return(amesos_err);  }
00107 
00108 
00109 #endif