//m*n行列Aを用いてy = A*x +b を計算する
void fc(int m, int n, const float *x, const float *A, const float *b, float *y){
int i, j;
for (i = 0; i < m; i++){
y[i] = b[i];
for (j = 0; j < n; j++){
y[i] += A[i * n + j] * x[j];
}
}
}
This is a code that does AX+b calculation of matrixes. But as in the photo, an arithmetic exception is occurred. Why is this happening? Even though it is multiplication and there is nothing divided by 0. How can I solve this error?
Sorry that I cannot add the values, or else I will have to add the whole file here. These are the parameters of the Neural Network and I will have to add .dat files here then I will also need other codes that can load those files. Also, I do not know how to bring only numbers from the .dat files, they are kind of weirdly encoded, so.
I will provide all the other information otherwise, so please don't close this question and I really want to know why this happens and how to solve it.
This is also another example of the exception. Example
What I want to know is how can this happen even where there is nothing divided by 0 in this example. How I can interpret this situation.
according to you image, your matrices size is 100x50 (m,n) that means 5000 items. but you entered A[j*m+i]
where 'j' is equal with 55 and 'i' is equal with 0. that means accessing the 5500 item of array which is not allowed.