HDIM  1.0.0
Packages for High Dimensional Linear Regression
debug.hpp File Reference

Preprocessor macros used for debugging and profiling. More...

#include <stdio.h>
#include <sstream>
#include <string>
#include <stdexcept>
#include <iostream>
#include <type_traits>
#include <assert.h>
#include <fstream>
#include <typeinfo>

Go to the source code of this file.

Macros

#define TIME_IT(func, ...)
 Get the de-mangled name of a type ( as it would appear in the source code ). More...
 
#define DEBUG_PRINT(x, ...)
 

Detailed Description

Preprocessor macros used for debugging and profiling.

Functions designed to aid in debugging.

Definition in file debug.hpp.

Macro Definition Documentation

#define DEBUG_PRINT (   x,
  ... 
)

Print a sequence of statements if program is compilied with the -DDEBUG flag.

Definition at line 73 of file debug.hpp.

#define TIME_IT (   func,
  ... 
)
Value:
do { \
auto start = std::chrono::high_resolution_clock::now(); \
func \
auto end = std::chrono::high_resolution_clock::now();\
std::chrono::duration<double, std::milli> ms = end - start;\
auto time_taken = ms.count();\
std::cout<< "Function took " << time_taken <<" ms." << std::endl;\
} while (0)

Get the de-mangled name of a type ( as it would appear in the source code ).

Returns
name of the template parameter typeMeasure how long a function takes to execute.

Definition at line 59 of file debug.hpp.