configured gitignore, optimized matmult, fixed implicit conversion issue

This commit is contained in:
novak_99 2022-02-13 15:22:49 -08:00
parent 2a21d25999
commit b3aa0d2cc4
5 changed files with 11 additions and 9 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
a.out
.DS_Store

BIN
MLPP/.DS_Store vendored

Binary file not shown.

View File

@ -171,14 +171,14 @@ namespace MLPP{
num[i] = 0; num[i] = 0;
} }
int den = 0; double den = 0;
for(int j = 0; j < r.size(); j++){ for(int j = 0; j < r.size(); j++){
num = alg.addition(num, alg.scalarMultiply(r[j][i], inputSet[j])); num = alg.addition(num, alg.scalarMultiply(r[j][i], inputSet[j]));
} }
for(int j = 0; j < r.size(); j++){ for(int j = 0; j < r.size(); j++){
den += r[j][i]; den += r[j][i];
} }
mu[i] = alg.scalarMultiply(1/den, num); mu[i] = alg.scalarMultiply(double(1)/double(den), num);
} }
} }

View File

@ -78,8 +78,8 @@ namespace MLPP{
} }
for(int i = 0; i < A.size(); i++){ for(int i = 0; i < A.size(); i++){
for(int j = 0; j < B[0].size(); j++){
for(int k = 0; k < B.size(); k++){ for(int k = 0; k < B.size(); k++){
for(int j = 0; j < B[0].size(); j++){
C[i][j] += A[i][k] * B[k][j]; C[i][j] += A[i][k] * B[k][j];
} }
} }

BIN
a.out

Binary file not shown.