faster libsvm parser

This commit is contained in:
tqchen
2015-04-17 22:07:59 -07:00
parent c528c1e8e6
commit 788785f164
6 changed files with 348 additions and 62 deletions

View File

@@ -174,5 +174,13 @@ inline const T *BeginPtr(const std::vector<T> &vec) {
return &vec[0];
}
}
inline char* BeginPtr(std::string &str) {
if (str.length() == 0) return NULL;
return &str[0];
}
inline const char* BeginPtr(const std::string &str) {
if (str.length() == 0) return NULL;
return &str[0];
}
} // namespace xgboost
#endif // XGBOOST_UTILS_UTILS_H_