git://www.ginac.de
/
ginac.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
20bd3aa
)
* Don't expand elements of a matrix multiplication.
author
Richard Kreckel
<Richard.Kreckel@uni-mainz.de>
Thu, 9 Mar 2006 01:24:28 +0000
(
01:24
+0000)
committer
Richard Kreckel
<Richard.Kreckel@uni-mainz.de>
Thu, 9 Mar 2006 01:24:28 +0000
(
01:24
+0000)
ginac/matrix.cpp
patch
|
blob
|
history
diff --git
a/ginac/matrix.cpp
b/ginac/matrix.cpp
index 5dc90e26e514b487181b27230d8fcb7c663d425a..f62e2d409244d8a50d44890b8eae74f8ac5e4eb1 100644
(file)
--- a/
ginac/matrix.cpp
+++ b/
ginac/matrix.cpp
@@
-580,10
+580,11
@@
matrix matrix::mul(const matrix & other) const
for (unsigned r1=0; r1<this->rows(); ++r1) {
for (unsigned c=0; c<this->cols(); ++c) {
+ // Quick test: can we shortcut?
if (m[r1*col+c].is_zero())
continue;
for (unsigned r2=0; r2<other.cols(); ++r2)
- prod[r1*other.col+r2] += (m[r1*col+c] * other.m[c*other.col+r2])
.expand()
;
+ prod[r1*other.col+r2] += (m[r1*col+c] * other.m[c*other.col+r2]);
}
}
return matrix(row, other.col, prod);