Fixed some bugs that were not allowing bulk adds and some binary incompatibilities.

Fixed error involving incorrectly setting strides when the stride is 0.
This commit is contained in:
Tristan Campbell 2003-03-23 01:13:43 +00:00
parent 46802b3486
commit 7bbb1273d0
1 changed files with 8 additions and 5 deletions

View File

@ -905,7 +905,10 @@ public final class Math {
return this;
else
return MATRIXOP_UNSAFE;
} else {
} else if (leftSourceElements == 1 && rightSourceElements == 1) {
return this; // even though this seems silly it is needed
}
else {
return MATRIXOP_UNSAFE;
}
}
@ -994,7 +997,7 @@ public final class Math {
// Calculate actual strides
if (sourceStride == 0)
sourceStride = sourceWidth * sourceHeight;
sourceStride = (sourceWidth * sourceHeight) << 2;
if (destStride == 0)
destStride = sourceStride;
@ -1087,9 +1090,9 @@ public final class Math {
// Calculate actual strides
if (leftSourceStride == 0)
leftSourceStride = leftSourceWidth * leftSourceHeight;
leftSourceStride = (leftSourceWidth * leftSourceHeight) << 2;
if (rightSourceStride == 0)
rightSourceStride = rightSourceWidth * rightSourceHeight;
rightSourceStride = (rightSourceWidth * rightSourceHeight) << 2;
// Ensure the source and destination matrices are compatible
int minStride = operation.checkCompatibility(
@ -1097,7 +1100,7 @@ public final class Math {
leftSourceHeight,
transposeLeftSource,
rightSourceWidth,
rightSourceWidth,
rightSourceHeight,
transposeRightSource,
transposeDest);