Teuchos_Utils.cpp

Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //                    Teuchos: Common Tools 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 #include "Teuchos_Utils.hpp"
00030 
00031 namespace Teuchos
00032 {
00033 
00034 // These characters are needed for BLAS & LAPACK routines for compile time debugging
00035 char ESideChar[] = {'L' , 'R' };
00036 char ETranspChar[] = {'N' , 'T' , 'C' };
00037 char EUploChar[] = {'U' , 'L' };
00038 char EDiagChar[] = {'U' , 'N' };
00039 char EFactChar[] = {'F', 'N' };
00040 char ENormChar[] = {'O', 'I' };
00041 char ECompQChar[] = {'N', 'I', 'V' };
00042 char EJobChar[] = {'E', 'V', 'B' };
00043 char EJobSChar[] = {'E', 'S' };
00044 char EJobVSChar[] = {'V', 'N' };
00045 char EHowmnyChar[] = {'A', 'S' };
00046 char ECMachChar[] = {'E', 'S', 'B', 'P', 'N', 'R', 'M', 'U', 'L', 'O' };
00047 char ESortChar[] = {'N', 'S'};
00048 
00049 double Utils::chopVal_ = 1.0e-16;
00050 
00051 
00052 double Utils::chop(const double& x) 
00053 {
00054   if (fabs(x) < chopVal_) return 0;
00055   return x;
00056 }
00057 
00058 string Utils::toString(const int& x)
00059 {
00060   char s[100];
00061   sprintf(s, "%d", x);
00062   return string(s);
00063 }
00064 
00065 string Utils::toString(const double& x)
00066 {
00067   char s[100];
00068   sprintf(s, "%g", x);
00069   return string(s);
00070 }
00071 
00072 
00073 } // end namespace Teuchos

Generated on Thu Sep 18 12:42:50 2008 for Teuchos - Trilinos Tools Package by doxygen 1.3.9.1