Hey,
ich weiß ehrlich gesagt nicht, was ich noch falsch mache.
Kann mir jemand einen Tipp geben wo mein Fehler ist? Danke
ich weiß ehrlich gesagt nicht, was ich noch falsch mache.
Java:
static Matrix multiply(Matrix a, Matrix b){
long erg = 0;
Matrix result = new Matrix(a.getNumberOfRows(), b.getNumberOfColumns());
if (a != null && b != null){
if (a.getNumberOfColumns() == b.getNumberOfRows()){
for(int i = 0; i < a.getNumberOfColumns(); i++)
{
for(int j = 0; j < a.getNumberOfRows(); j++)
{
for(int k = 0; k < b.getNumberOfRows(); k++)
{
erg += a.get(i,k) * b.get(k,j);
result.set(i,j,erg);
}
}
}
} return result;
}
return null;
}