-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinternal.h
55 lines (44 loc) · 1.79 KB
/
internal.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* internal.h
*
* Created on: Apr 25, 2013
* Author: fb
*/
#ifndef INTERNAL_H_
#define INTERNAL_H_
#include <vector>
#include <iostream>
#include <eigen/Eigen/Core>
#include <eigen/Eigen/Sparse>
#define __AUCTION_EPSILON_MULTIPLIER 1e-5 // epsilon multiplier
#define __AUCTION_INF 1e6 // infinity for setting second best match
//// which type of coefficient in weight matrix
typedef double Scalar;
// locking of rows/cols
typedef std::vector<bool> LockVector;
#define MEASURE_DURATION_SINGLE(__MD_COMMAND__) \
{\
double __md_accumulator = 0;\
std::cout << "command <" << #__MD_COMMAND__ << "> took "; \
std::chrono::high_resolution_clock::time_point __md_start = std::chrono::high_resolution_clock::now();\
__MD_COMMAND__ ;\
std::chrono::nanoseconds __md_sec = std::chrono::high_resolution_clock::now() - __md_start;\
__md_accumulator += __md_sec.count();\
std::cout << ( __md_accumulator / 1000. ) << " us " << std::endl;} \
#define MEASURE_DURATION_SINGLE_WITHOUT_PRINTING_COMMAND(__MD_COMMAND__) \
{\
double __md_accumulator = 0;\
std::chrono::high_resolution_clock::time_point __md_start = std::chrono::high_resolution_clock::now();\
__MD_COMMAND__ ;\
std::chrono::nanoseconds __md_sec = std::chrono::high_resolution_clock::now() - __md_start;\
__md_accumulator += __md_sec.count();\
std::cout << ( __md_accumulator / 1000. ) << " us " << std::endl;} \
#define MEASURE_DURATION_SINGLE_STORED(__MD_COMMAND__, __MD_STORE__) \
{\
double __md_accumulator = 0;\
std::chrono::high_resolution_clock::time_point __md_start = std::chrono::high_resolution_clock::now();\
__MD_COMMAND__ ;\
std::chrono::nanoseconds __md_sec = std::chrono::high_resolution_clock::now() - __md_start;\
__md_accumulator += __md_sec.count();\
__MD_STORE__ = (double) ( __md_accumulator / 1000. );} \
#endif /* INTERNAL_H_ */