summaryrefslogtreecommitdiff
path: root/htk_io/tools/tnet_to_nerv.cpp
diff options
context:
space:
mode:
authorYimmon Zhuang <[email protected]>2015-08-14 17:40:18 +0800
committerYimmon Zhuang <[email protected]>2015-08-14 17:40:18 +0800
commitdfdd17afc2e984ec6c32ea01290f5c76309a456a (patch)
treebfea20e97c200cf734021e3756d749c892e658a4 /htk_io/tools/tnet_to_nerv.cpp
parent70d52a3dc6c120fe76e1109e844303e2f5e61872 (diff)
parent10cce5f6a5c9e2f8e00d5a2a4d87c9cb7c26bf4c (diff)
solve dependencies
Diffstat (limited to 'htk_io/tools/tnet_to_nerv.cpp')
-rw-r--r--htk_io/tools/tnet_to_nerv.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/htk_io/tools/tnet_to_nerv.cpp b/htk_io/tools/tnet_to_nerv.cpp
index bbfddcf..a779a25 100644
--- a/htk_io/tools/tnet_to_nerv.cpp
+++ b/htk_io/tools/tnet_to_nerv.cpp
@@ -2,9 +2,10 @@
#include <fstream>
#include <string>
#include <cstring>
+#include <cstdlib>
char token[1024];
char output[1024];
-double mat[4096][4096];
+double **mat;
int main(int argc, char **argv) {
std::ofstream fout;
fout.open(argv[1]);
@@ -18,6 +19,9 @@ int main(int argc, char **argv) {
scanf("%d %d", &ncol, &nrow);
scanf("%s %d %d", token, &ncol, &nrow);
printf("%d %d\n", nrow, ncol);
+ mat = (double **)malloc(nrow * sizeof(double *));
+ for (i = 0; i < nrow; i++)
+ mat[i] = (double *)malloc(ncol * sizeof(double));
for (j = 0; j < ncol; j++)
for (i = 0; i < nrow; i++)
scanf("%lf", mat[i] + j);
@@ -34,7 +38,9 @@ int main(int argc, char **argv) {
for (j = 0; j < ncol; j++)
fout << mat[i][j] << " ";
fout << std::endl;
+ free(mat[i]);
}
+ free(mat);
long length = fout.tellp() - base;
fout.seekp(base);
sprintf(output, "[%13lu]\n", length);