Loading src/Ainur/AinurState.h +10 −2 Original line number Diff line number Diff line Loading @@ -267,7 +267,11 @@ private: typename EnableIf<Loki::TypeTraits<T>::isIntegral, int>::Type = 0) const { t = atoi(label.c_str()); try { t = PsimagLite::atoi(label.c_str()); } catch (...) { err("FATAL: AinurState: Label " + label + " must be an integer\n"); } } template<typename T> Loading @@ -276,7 +280,11 @@ private: typename EnableIf<Loki::TypeTraits<T>::isFloat, int>::Type = 0) const { t = atof(label.c_str()); try { t = PsimagLite::atof(label.c_str()); } catch (...) { err("FATAL: AinurState: Label " + label + " must be a real number\n"); } } void convertInternal(String& t, String label) const Loading src/AllocatorCpu.h +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ Please see full open source license included in file LICENSE. #include <cstdlib> #include <sstream> #include <type_traits> #include <cctype> #ifdef USE_CUSTOM_ALLOCATOR #include "MemoryCpu.h" #endif Loading src/PsimagLite.cpp +28 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,34 @@ String basename(const String& path) path.end()); } int atoi(String str) { const SizeType n = str.length(); for (SizeType i = 0; i < n; ++i) { if (isdigit(str[i])) continue; if (str[i] == '-' || str[i] == '+') continue; throw RuntimeError("atoi received a non-digit\n"); } return std::atoi(str.c_str()); } int atof(String str) { const SizeType n = str.length(); for (SizeType i = 0; i < n; ++i) { if (isdigit(str[i])) continue; if (str[i] == '-' || str[i] == '+' || str[i] == 'e' || str[i] == 'E' || str[i] == '.') continue; throw RuntimeError("atof received a non-digit\n"); } return std::atoi(str.c_str()); } const int PsiApp::libSizeOfSizeType_ = sizeof(SizeType); } // namespace PsimagLite Loading src/PsimagLite.h +4 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,10 @@ std::istream& operator>>(std::istream&,std::pair<SizeType,SizeType>&); SizeType log2Integer(SizeType x); int atoi(String); int atof(String); void err(String); struct MatchPathSeparator { Loading Loading
src/Ainur/AinurState.h +10 −2 Original line number Diff line number Diff line Loading @@ -267,7 +267,11 @@ private: typename EnableIf<Loki::TypeTraits<T>::isIntegral, int>::Type = 0) const { t = atoi(label.c_str()); try { t = PsimagLite::atoi(label.c_str()); } catch (...) { err("FATAL: AinurState: Label " + label + " must be an integer\n"); } } template<typename T> Loading @@ -276,7 +280,11 @@ private: typename EnableIf<Loki::TypeTraits<T>::isFloat, int>::Type = 0) const { t = atof(label.c_str()); try { t = PsimagLite::atof(label.c_str()); } catch (...) { err("FATAL: AinurState: Label " + label + " must be a real number\n"); } } void convertInternal(String& t, String label) const Loading
src/AllocatorCpu.h +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ Please see full open source license included in file LICENSE. #include <cstdlib> #include <sstream> #include <type_traits> #include <cctype> #ifdef USE_CUSTOM_ALLOCATOR #include "MemoryCpu.h" #endif Loading
src/PsimagLite.cpp +28 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,34 @@ String basename(const String& path) path.end()); } int atoi(String str) { const SizeType n = str.length(); for (SizeType i = 0; i < n; ++i) { if (isdigit(str[i])) continue; if (str[i] == '-' || str[i] == '+') continue; throw RuntimeError("atoi received a non-digit\n"); } return std::atoi(str.c_str()); } int atof(String str) { const SizeType n = str.length(); for (SizeType i = 0; i < n; ++i) { if (isdigit(str[i])) continue; if (str[i] == '-' || str[i] == '+' || str[i] == 'e' || str[i] == 'E' || str[i] == '.') continue; throw RuntimeError("atof received a non-digit\n"); } return std::atoi(str.c_str()); } const int PsiApp::libSizeOfSizeType_ = sizeof(SizeType); } // namespace PsimagLite Loading
src/PsimagLite.h +4 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,10 @@ std::istream& operator>>(std::istream&,std::pair<SizeType,SizeType>&); SizeType log2Integer(SizeType x); int atoi(String); int atof(String); void err(String); struct MatchPathSeparator { Loading