UFJF - Machine Learning Toolkit  0.51.8
Utils.hpp File Reference
#include <vector>
#include <cstring>
#include <string>
#include <sstream>
#include <iterator>
#include <ctime>
Include dependency graph for Utils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 mltk
 UFJF-MLTK main namespace for core functionalities.
 

Macros

#define PRECISION   1E-9
 
#define MAX_NUMBER_STRING_SIZE   32
 
#define INF   1E8
 

Typedefs

typedef std::vector< std::vector< double > > mltk::dMatrix
 

Enumerations

enum  NormType { NORM_LINF = 0 , NORM_L1 = 1 , NORM_L2 = 2 }
 

Functions

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)
 
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...
 
std::vector< std::string > mltk::utils::tokenize (const std::string &str, const char delim)
 
std::string mltk::utils::timestamp ()
 

Detailed Description

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.