ArrayClasses
Class UTRArray

java.lang.Object
  extended byArrayClasses.UTRArray

public class UTRArray
extends java.lang.Object

Upper triangular matrix of doubles (a_ij)_{p<=i<=j< n} stored as straightforward ragged java array. Array indices can be based on any base p.

The purpose here is mainly to have a built in index shift from natural indices to zero based java array indices. This makes program code clearer. However the speed penalty from the use of accessor functions is significant.


Constructor Summary
UTRArray(int p, int n)
          Memory allocation, all entries zero.
 
Method Summary
 double _(int i, int j)
          Get entry (subscripting).
static void main(java.lang.String[] args)
          TEST PROGRAM
 void set(int i, int j, double x)
          Set entry.
 java.lang.String toString()
          String representation for printing and inspection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UTRArray

public UTRArray(int p,
                int n)
Memory allocation, all entries zero. Index range p<=i
Method Detail

set

public void set(int i,
                int j,
                double x)

Set entry. Only built in java bounds checking. Indices must satisfy p<=i<=j< n.

Parameters:
i - row index.
j - column index

_

public double _(int i,
                int j)

Get entry (subscripting). Only built in java bounds checking. Indices must satisfy p<=i<=j< n.

Parameters:
i - row index.
j - column index

toString

public java.lang.String toString()
String representation for printing and inspection.


main

public static void main(java.lang.String[] args)
TEST PROGRAM