- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConsolePrint.cpp
More file actions
Latest commit
72 lines (59 loc) · 1.25 KB
/
Copy pathConsolePrint.cpp
File metadata and controls
72 lines (59 loc) · 1.25 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include"ConsolePrint.h"
voidConsolePrint::print_string(std::string arr)
{
printf("%s\n",arr.c_str());
}
voidConsolePrint::create_dummy_fv(int* vocab_size, int* document_size, int ** fv)
{
for(int i = 0;i<*document_size;i++)
{
for(int j = 0;j<*vocab_size;j++)
{
fv[i][j] = i*(j+1) + j ;
}
}
}
voidConsolePrint::print_1d_float(int num_columns, longdouble * fv)
{
printf("Printing Long Double Array: \n");
for(int j = 0;j<num_columns;j++)
{
printf("%Lf\t",fv[j]);
}
printf("\n");
}
voidConsolePrint::print_1d_int(int vocab_size, int * fv)
{
printf("Printing Array: \n");
for(int j = 0;j<vocab_size;j++)
{
printf("%i ",fv[j]);
}
printf("\n");
}
voidConsolePrint::print_2d_float(int num_columns, int num_rows, longdouble ** fv)
{
printf("Printing Long Double Array: \n");
for(int i = 0;i<num_rows;i++)
{
for(int j = 0;j<num_columns;j++)
{
printf("%Lf\t",fv[i][j]);
}
printf("\n");
}
printf("\n");
}
voidConsolePrint::print_2d_int(int vocab_size, int document_size, int ** fv)
{
printf("Printing Array: \n");
for(int i = 0;i<document_size;i++)
{
for(int j = 0;j<vocab_size;j++)
{
printf("%i ",fv[i][j]);
}
printf("\n");
}
printf("\n");
}