Skip to content

Commit f5caaa8

Browse files
committed
Use big_string in checkpoint
1 parent ad616b4 commit f5caaa8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cp-algo/util/big_alloc.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ namespace cp_algo {
6565
using big_vector = std::vector<T, big_alloc<T>>;
6666
template<typename T>
6767
using big_basic_string = std::basic_string<T, std::char_traits<T>, big_alloc<T>>;
68+
template<typename T>
69+
using big_deque = std::deque<T, big_alloc<T>>;
6870
using big_string = big_basic_string<char>;
6971
}
7072
#endif // CP_ALGO_UTIL_big_alloc_HPP

cp-algo/util/checkpoint.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
#ifndef CP_ALGO_UTIL_CHECKPOINT_HPP
22
#define CP_ALGO_UTIL_CHECKPOINT_HPP
3+
#include "../util/big_alloc.hpp"
34
#include <iostream>
45
#include <chrono>
56
#include <string>
67
#include <map>
78
namespace cp_algo {
89
#ifdef CP_ALGO_CHECKPOINT
9-
std::map<std::string, double> checkpoints;
10+
std::map<big_string, double> checkpoints;
1011
double last;
1112
#endif
1213
template<bool final = false>
1314
void checkpoint([[maybe_unused]] auto const& _msg) {
1415
#ifdef CP_ALGO_CHECKPOINT
15-
std::string msg = _msg;
16+
big_string msg = _msg;
1617
double now = (double)clock() / CLOCKS_PER_SEC;
1718
double delta = now - last;
1819
last = now;

0 commit comments

Comments
 (0)