-
Notifications
You must be signed in to change notification settings - Fork 6
/
simple_debug.cc
47 lines (36 loc) · 1.1 KB
/
simple_debug.cc
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
// simple_debug.cpp
// Copyright 2016-2016 University of Electronic Science and Technology of China
// (author : Xiaoming Qin)
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file expect in compliance with the License.
#include "simple_debug.h"
// print 1-d array(int)
void print_array(int* data, const int col)
{
cout << "------------------" << endl;
for ( int i = 0; i != col; ++i )
cout << data[i] << " ";
cout << endl;
cout << "------------------" << endl;
}
// print 1-d array(float)
void print_array(float* data, const int col)
{
cout << "------------------" << endl;
for ( int i = 0; i != col; ++i )
cout << data[i] << " ";
cout << endl;
cout << "------------------" << endl;
}
// print 2-d array
void print_array(float** data, const int row, const int col)
{
cout << "------------------" << endl;
for ( int i = 0; i != row; ++i )
{
for (int j = 0; j != col; ++j)
cout << data[i][j] << " ";
cout << endl;
}
cout << "------------------" << endl;
}