mirror of
https://github.com/Relintai/MLPP.git
synced 2024-11-14 10:17:18 +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;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user