-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDebugHelpers.cpp
More file actions
56 lines (50 loc) · 1.69 KB
/
DebugHelpers.cpp
File metadata and controls
56 lines (50 loc) · 1.69 KB
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
56
//---------------------------------------------------------------------------
#pragma hdrstop
#pragma warn -8123
#include "DebugHelpers.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
//---------------------------------------------------------------------------
void debugOutWithStringAndDouble (const wchar_t *str, double number)
{
UnicodeString ustr = "";
ustr.printf (L"[%s : %lf]", str, number);
OutputDebugString(ustr.c_str());
}
//---------------------------------------------------------------------------
void debugOutArray (double **array, int rows, int cols)
{
OutputDebugString (L"Array =====>");
for (int i = 0; i < rows; ++i) {
UnicodeString ustr = "";
for (int j = 0; j < cols; ++j) {
ustr.cat_printf (L"%.2lf ", array[i][j]);
}
OutputDebugString(ustr.c_str());
}
OutputDebugString (L"Array <=====");
}
//---------------------------------------------------------------------------
void debugOutVector (vector< vector<double> > vect)
{
OutputDebugString (L"Vector =====>");
typedef vector< vector<double> >::iterator vIt;
typedef vector<double>::iterator dIt;
for (vIt i = vect.begin(); i != vect.end(); ++i) {
UnicodeString ustr = "";
for (dIt j = (*i).begin(); j != (*i).end(); ++j) {
ustr.cat_printf (L"%.2lf ", *j);
}
OutputDebugString(ustr.c_str());
}
OutputDebugString (L"Vector <=====");
}
//---------------------------------------------------------------------------
void debugOutTime (time_t time)
{
OutputDebugString (L"Time =====>");
UnicodeString ustr = "";
ustr.cat_printf(L"%lf", time);
OutputDebugString(ustr.c_str());
}
//---------------------------------------------------------------------------