mirror of
https://github.com/Relintai/MLPP.git
synced 2024-11-20 10:47:17 +01:00
configured gitignore, optimized matmult, fixed implicit conversion issue
This commit is contained in:
parent
2a21d25999
commit
b3aa0d2cc4
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
a.out
|
||||
.DS_Store
|
BIN
MLPP/.DS_Store
vendored
BIN
MLPP/.DS_Store
vendored
Binary file not shown.
@ -171,14 +171,14 @@ namespace MLPP{
|
||||
num[i] = 0;
|
||||
}
|
||||
|
||||
int den = 0;
|
||||
double den = 0;
|
||||
for(int j = 0; j < r.size(); j++){
|
||||
num = alg.addition(num, alg.scalarMultiply(r[j][i], inputSet[j]));
|
||||
}
|
||||
for(int j = 0; j < r.size(); j++){
|
||||
den += r[j][i];
|
||||
}
|
||||
mu[i] = alg.scalarMultiply(1/den, num);
|
||||
mu[i] = alg.scalarMultiply(double(1)/double(den), num);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -77,13 +77,13 @@ namespace MLPP{
|
||||
C[i].resize(B[0].size());
|
||||
}
|
||||
|
||||
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++){
|
||||
C[i][j] += A[i][k] * B[k][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i = 0; i < A.size(); i++){
|
||||
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];
|
||||
}
|
||||
}
|
||||
}
|
||||
return C;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user