A
a
By previous replies, it seems that the following method somehow solves the
problem up to 1000 * 1000 2D data, but when I try 10k * 10k, the
segmentation fault problem appears again.
Richard Tobin told me there is a system limit that can be changed. But I
don't know which file is to be changed.
I have modified again and again and hope to find out a solution that can
handle 100k * 100k data.
float** array_to_matrix(float* m, int rows, int cols) {
int i,j;
float** r;
r = (float**)calloc(rows,sizeof(float*));
for(i=0;i<rows;i++)
{
r = (float*)calloc(cols,sizeof(float));
for(j=0;j<cols;j++)
r[j] = m[i*cols+j];
}
return r;
}
problem up to 1000 * 1000 2D data, but when I try 10k * 10k, the
segmentation fault problem appears again.
Richard Tobin told me there is a system limit that can be changed. But I
don't know which file is to be changed.
I have modified again and again and hope to find out a solution that can
handle 100k * 100k data.
float** array_to_matrix(float* m, int rows, int cols) {
int i,j;
float** r;
r = (float**)calloc(rows,sizeof(float*));
for(i=0;i<rows;i++)
{
r = (float*)calloc(cols,sizeof(float));
for(j=0;j<cols;j++)
r[j] = m[i*cols+j];
}
return r;
}