info.mrupp.isoak1
Class Array2Float

java.lang.Object
  extended by info.mrupp.isoak1.Array2Float

public class Array2Float
extends java.lang.Object

Two-dimensional array of single precision floating point numbers. Optimized for speed (memory is never released to save on allocations).


Constructor Summary
Array2Float()
          Creates an empty array.
Array2Float(Array2Float array)
          Creates a copy of another Array2Float.
Array2Float(Array2Float array, boolean transpose)
          Creates a copy of another Array2Float.
Array2Float(float[][] array)
          Creates a copy from a rectangular built-in array.
Array2Float(float[][] array, boolean transpose)
          Creates a copy from a rectangular built-in array.
Array2Float(int rows, int cols)
          Creates an array of given size.
 
Method Summary
 int cols()
          The number of columns.
 int elems()
          The total number of elements in the array.
 float get(int index)
          Reads an element using a single index.
 float get(int row, int col)
          Reads an element using row and column indices.
 void redim(int rows, int cols)
          Changes the dimensions of the array.
 int rows()
          The number of rows.
 void set(int index, float value)
          Writes an element using a single index.
 void set(int row, int col, float value)
          Writes an element using row and column indices.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Array2Float

public Array2Float()
Creates an empty array.


Array2Float

public Array2Float(Array2Float array)
Creates a copy of another Array2Float.


Array2Float

public Array2Float(Array2Float array,
                   boolean transpose)
Creates a copy of another Array2Float.


Array2Float

public Array2Float(float[][] array)
            throws java.lang.IllegalArgumentException
Creates a copy from a rectangular built-in array.

Throws:
java.lang.IllegalArgumentException

Array2Float

public Array2Float(float[][] array,
                   boolean transpose)
            throws java.lang.IllegalArgumentException
Creates a copy from a rectangular built-in array.

Throws:
java.lang.IllegalArgumentException

Array2Float

public Array2Float(int rows,
                   int cols)
            throws java.lang.NegativeArraySizeException
Creates an array of given size.

Throws:
java.lang.NegativeArraySizeException
Method Detail

cols

public int cols()
The number of columns.


elems

public int elems()
The total number of elements in the array.


get

public float get(int index)
Reads an element using a single index.


get

public float get(int row,
                 int col)
Reads an element using row and column indices.


redim

public void redim(int rows,
                  int cols)
Changes the dimensions of the array. Content is lost. New memory is only allocated if the number of elements grows.


rows

public int rows()
The number of rows.


set

public void set(int index,
                float value)
Writes an element using a single index.


set

public void set(int row,
                int col,
                float value)
Writes an element using row and column indices.