Once number_of_inidices gets over 40, things get very slow.
number_of_buy_channels = number_of_sell_channels ~ 10
days_of_data = 3400
Suggestions?
thanks
number_of_buy_channels = number_of_sell_channels ~ 10
days_of_data = 3400
Suggestions?
thanks
Code:
signal = (int******) calloc (number_of_indices, sizeof(int*****));
for (i = 0; i < number_of_indices; i++)
{
if( (signal[i] = (int*****) calloc (number_of_indices, sizeof(int ****))) == NULL)
printf("couldn't allocated memory\n");
for (j = 0; j < number_of_indices; j++)
{
if ((signal[i][j] = (int****) calloc (num_buy_channels, sizeof(int ***))) == NULL)
printf("couldn't allocated memory\n");
for (k = 0; k < num_buy_channels; k++)
{//printf("c");
if ((signal[i][j][k] = (int***) calloc (num_sell_channels, sizeof(int **))) == NULL)
printf("couldn't allocated memory\n");
for (l = 0; l < num_sell_channels; l++)
{//printf("d\n");
if ((signal[i][j][k][l] = (int**) calloc(2, sizeof(int *))) == NULL)
printf("couldn't allocated memory\n");
for (m = 0; m < 2; m++) // number of fk values
if ( (signal[i][j][k][l][m] = (int*) calloc(days_of_data, sizeof(int ))) == NULL)
printf("couldn't allocated memory\n");
}
}
}
}