org.apfloat.internal
Class IntMatrix

java.lang.Object
  extended byorg.apfloat.internal.IntMatrix

public class IntMatrix
extends Object

Optimized matrix transposition methods for the int type.

Version:
1.0
Author:
Mikko Tommila

Method Summary
static void transpose(ArrayAccess arrayAccess, int n1, int n2)
          Transpose a n1 x n2 matrix.
static void transposeSquare(ArrayAccess arrayAccess, int n1, int n2)
          Transpose a square n1 x n1 block of n1 x n2 matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

transpose

public static void transpose(ArrayAccess arrayAccess,
                             int n1,
                             int n2)
                      throws ApfloatRuntimeException
Transpose a n1 x n2 matrix.

Both n1 and n2 must be powers of two. Additionally, one of these must be true:

n1 = n2
n1 = 2*n2
n2 = 2*n1

Parameters:
arrayAccess - Accessor to the matrix data. This data will be transposed.
n1 - Number of rows in the matrix.
n2 - Number of columns in the matrix.
Throws:
ApfloatRuntimeException

transposeSquare

public static void transposeSquare(ArrayAccess arrayAccess,
                                   int n1,
                                   int n2)
                            throws ApfloatRuntimeException
Transpose a square n1 x n1 block of n1 x n2 matrix.

Both n1 and n2 must be powers of two, and n1 <= n2.

Parameters:
arrayAccess - Accessor to the matrix data. This data will be transposed.
n1 - Number of rows and columns in the block to be transposed.
n2 - Number of columns in the matrix.
Throws:
ApfloatRuntimeException