Use string instead of char*
This commit is contained in:
@@ -15,10 +15,11 @@
|
||||
#ifndef __UTILS__
|
||||
#define __UTILS__
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <armadillo>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
/** @def DEBUG(msg)
|
||||
* @brief Writes a debug message
|
||||
@@ -84,10 +85,24 @@ std::string scientific_format(const std::vector<double>& v,
|
||||
* @param msg The message to be displayed
|
||||
* */
|
||||
void m_assert(bool expr,
|
||||
const char* expr_str,
|
||||
const char* func,
|
||||
const char* file,
|
||||
std::string expr_str,
|
||||
std::string func,
|
||||
std::string file,
|
||||
int line,
|
||||
const char* msg);
|
||||
std::string msg);
|
||||
|
||||
|
||||
/** @brief Test if two armadillo vectors are close to each other.
|
||||
*
|
||||
* This function takes in 2 vectors and checks if they are approximately
|
||||
* equal to each other given a tolerance.
|
||||
*
|
||||
* @param a Vector a
|
||||
* @param b Vector b
|
||||
* @param tol The tolerance
|
||||
*
|
||||
* @return Boolean
|
||||
* */
|
||||
bool arma_vector_close_to(arma::vec &a, arma::vec &b, double tol=1e-8);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user