UFJF - Machine Learning Toolkit  0.51.8
Utils.cpp File Reference

Implementation of methods for general use in the system. More...

#include <cmath>
#include <sstream>
#include <algorithm>
#include <iostream>
#include "ufjfmltk/core/Utils.hpp"
Include dependency graph for Utils.cpp:

Namespaces

 mltk
 UFJF-MLTK main namespace for core functionalities.
 

Functions

bool mltk::utils::is_number (std::string str)
 Verify if the string is a number. More...
 
int mltk::utils::stoin (std::string str)
 Converts the string to an integer. More...
 
double mltk::utils::atod (const char *str)
 Converts the string to a double. More...
 
std::string mltk::utils::itos (int n)
 itos Integer to string conversion. More...
 
std::string mltk::utils::dtoa (double n)
 dtoa Double to string conversion. More...
 
void mltk::utils::printConfusionMatrix (const std::vector< int > &classes, const std::vector< std::string > &classes_names, const std::vector< std::vector< size_t > > &confusion_m, bool show_names=false)
 
std::vector< std::string > mltk::utils::tokenize (const std::string &str, const char delim)
 
std::string mltk::utils::timestamp ()
 

Detailed Description

Implementation of methods for general use in the system.

Utils functions

Author
Mateus Coutinho Marim

Function Documentation

◆ atod()

double mltk::utils::atod ( const char *  str)

Converts the string to a double.

Parameters
strThe string to be converted.
Returns
The double resulted from the conversion.

◆ dtoa()

std::string mltk::utils::dtoa ( double  n)

dtoa Double to string conversion.

Parameters
nDouble to be converted.
Returns
string

◆ is_number()

bool mltk::utils::is_number ( std::string  str)

Verify if the string is a number.

Parameters
strString to be tested.
Returns
bool

◆ itos()

std::string mltk::utils::itos ( int  n)

itos Integer to string conversion.

Parameters
nInteger to be converted.
Returns
string

◆ stoin()

int mltk::utils::stoin ( std::string  str)

Converts the string to an integer.

Parameters
strString to be converted.
Returns
The integer resulted from the conversion.