mlpack
3.4.2
mlpack-3.4.2
src
mlpack
core
data
extension.hpp
Go to the documentation of this file.
1
13
#ifndef MLPACK_CORE_DATA_EXTENSION_HPP
14
#define MLPACK_CORE_DATA_EXTENSION_HPP
15
16
#include <
mlpack/prereqs.hpp
>
17
18
namespace
mlpack
{
19
namespace
data {
20
21
inline
std::string
Extension
(
const
std::string& filename)
22
{
23
const
size_t
ext = filename.rfind(
'.'
);
24
std::string extension;
25
if
(ext == std::string::npos)
26
return
extension;
27
28
extension = filename.substr(ext + 1);
29
std::transform(extension.begin(), extension.end(), extension.begin(),
30
::tolower);
31
32
return
extension;
33
}
34
35
}
// namespace data
36
}
// namespace mlpack
37
38
#endif
prereqs.hpp
The core includes that mlpack expects; standard C++ includes and Armadillo.
mlpack::data::Extension
std::string Extension(const std::string &filename)
Definition:
extension.hpp:21
mlpack
Linear algebra utility functions, generally performed on matrices or vectors.
Definition:
add_to_cli11.hpp:21
Generated by
1.8.20