From 8debb8fd102669e2a17764bba2d7d37136479dd6 Mon Sep 17 00:00:00 2001 From: Caspian Rychlik-Prince Date: Mon, 26 Aug 2002 20:39:28 +0000 Subject: [PATCH] This n that --- src/java/org/lwjgl/Math.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/java/org/lwjgl/Math.java b/src/java/org/lwjgl/Math.java index c6636d93..36325006 100644 --- a/src/java/org/lwjgl/Math.java +++ b/src/java/org/lwjgl/Math.java @@ -405,6 +405,8 @@ public final class Math { boolean transposeRightSource, boolean transposeDest); + + abstract MatrixOpClassification classify(); } @@ -822,6 +824,21 @@ public final class Math { boolean transposeDest) { } + /** + * Check a binary operation to make sure that when dealing with n x n + * result sets that when both n's are greater than 1 the operation must + * be safe; otherwise if is direct, then the side where n > 1 must be + * the destination. + */ + abstract MatrixOpClassification checkBinaryOp( + int leftSourceElements, + int rightSourceElements, + int leftSourceAddress, + int rightSourceAddress, + int destinationAddress + ); + + public final MatrixOpClassification check( int sourceAddress, int sourceStride, @@ -1014,6 +1031,7 @@ public final class Math { // Check unary matrix operation type MatrixOpClassification op = operation.classify().check(leftSourceAddress, leftSourceStride, leftElements, destAddress, destStride); op = op.check(rightSourceAddress, rightSourceStride, rightElements, destAddress, destStride); + op = op.checkBinaryOp(leftElements, rightElements, leftSourceAddress, rightSourceAddress, destAddress); op.execute( leftSourceAddress, leftSourceStride,