46 #ifndef _PEXSI_ENVIRONMENT_HPP_
47 #define _PEXSI_ENVIRONMENT_HPP_
91 #define _DEBUGlevel_ DEBUG
98 #define _DEBUGlevel -1
113 #define FORTRAN(name) name
114 #define BLAS(name) name
115 #define LAPACK(name) name
117 #define FORTRAN(name) name##_
118 #define BLAS(name) name##_
119 #define LAPACK(name) name##_
122 typedef int64_t LongInt;
124 typedef std::complex<double> Complex;
126 typedef std::complex<double> Scalar;
128 typedef double Scalar;
132 extern std::ofstream statusOFS;
138 const Int I_ZERO = 0;
140 const Int I_MINUS_ONE = -1;
141 const Real D_ZERO = 0.0;
142 const Real D_ONE = 1.0;
143 const Real D_MINUS_ONE = -1.0;
144 const Complex Z_ZERO = Complex(0.0, 0.0);
145 const Complex Z_ONE = Complex(1.0, 0.0);
146 const Complex Z_MINUS_ONE = Complex(-1.0, 0.0);
147 const Complex Z_I = Complex(0.0, 1.0);
148 const Complex Z_MINUS_I = Complex(0.0, -1.0);
149 const Scalar SCALAR_ZERO =
static_cast<Scalar
>(0.0);
150 const Scalar SCALAR_ONE =
static_cast<Scalar
>(1.0);
151 const Scalar SCALAR_MINUS_ONE =
static_cast<Scalar
>(-1.0);
154 const T ZERO(){
return static_cast<T
>(0.0);};
156 const T ONE(){
return static_cast<T
>(1.0);};
158 const T MINUS_ONE(){
return static_cast<T
>(-1.0);};
160 const char UPPER =
'U';
161 const char LOWER =
'L';
165 const Real au2K = 315774.67;
166 const Real PI = 3.141592653589793;
178 void PushCallStack( std::string s );
180 void DumpCallStack();
181 #endif // ifndef _RELEASE_
190 Int overflow( Int c ) {
return traits_type::not_eof(c); }
194 : std::ios(&nullStreamBuffer_), std::ostream(&nullStreamBuffer_)
206 int nSize = backtrace(array, 25);
207 char ** symbols = backtrace_symbols(array, nSize);
209 for (
int i = 0; i < nSize; i++)
211 std::cout << symbols[i] << std::endl;
223 inline Int iround(Real a){
225 if(a>0) b = (a-Int(a)<0.5)?Int(a):(Int(a)+1);
226 else b = (Int(a)-a<0.5)?Int(a):(Int(a)-1);
231 inline void OptionsCreate(Int argc,
char** argv, std::map<std::string,std::string>& options){
233 for(Int k=1; k<argc; k=k+2) {
234 options[ std::string(argv[k]) ] = std::string(argv[k+1]);
240 inline Int Size( std::stringstream& sstm ){
242 sstm.seekg (0, std::ios::end);
243 length = sstm.tellg();
244 sstm.seekg (0, std::ios::beg);
252 #endif // _PEXSI_ENVIRONMENT_HPP_
Definition: environment.hpp:188
Definition: environment.hpp:200
Definition: environment.hpp:186