fhm.edu.fem.test
Class ENVHullMatrixSpeedUp

java.lang.Object
  extended by fhm.edu.fem.test.ENVHullMatrixSpeedUp

public class ENVHullMatrixSpeedUp
extends java.lang.Object

Class Description: Test Class - Envelope Hull Matrix Speed Up

Author:
Thomas Woellert (thomas@woellert.net), Stefan Weissbach (weissbst@gmx.de)

Field Summary
protected  java.util.Vector<java.util.Vector> data
           
protected  java.util.Vector<java.lang.Double> enlargeVector
           
protected  int entryIndex
           
protected  int[] entryIndexes
           
protected  java.util.Vector<java.lang.Double> subVector
           
 
Constructor Summary
ENVHullMatrixSpeedUp(ENVHullMatrixSpeedUp env)
          Copy Constructor
ENVHullMatrixSpeedUp(int size)
          Construct a new ENV for a HullMatrix with the given number of "0.0" elements
 
Method Summary
 void add(int index, double value)
          Add a new element at a specific index of the list, causing all other elements coming after that element to be shifted to the right (including the element currently at the given index)
protected  void adjustEntryIndexesAfterEnlargement(int index, int difference)
          Adjust all entry indexes after an enlargement
protected  void adjustEntryIndexesAfterReduction(int index, int difference)
          Adjust all entry indexes after a reduction
 java.lang.Object clone()
          Clone this object
 void enlargeAt(int index, int difference)
          Enlarge the ENV by the given difference at the given index
 double get(int index)
          Retrieve a value from the list
 java.util.Vector<java.util.Vector> getData()
          Retrieve the data vector from the ENV
 int[] getEntryIndexes()
          Retrieve the entry index array
protected  int getEntryIndexFor(int index)
          Compute the entry index for the given index and return the correct subvector
 long getRequiredMemory()
          Retrieve the amount of required memory in this matrix (in byte)
 void reduceAt(int index, int difference)
          Reduce the ENV by the given difference at the given index
 double set(int index, double value)
          Replace an already existing value in the list with a new value at the specific index
 int size()
          Retrieve the number of Double elements in the ENV
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected java.util.Vector<java.util.Vector> data

enlargeVector

protected java.util.Vector<java.lang.Double> enlargeVector

entryIndex

protected int entryIndex

entryIndexes

protected int[] entryIndexes

subVector

protected java.util.Vector<java.lang.Double> subVector
Constructor Detail

ENVHullMatrixSpeedUp

public ENVHullMatrixSpeedUp(ENVHullMatrixSpeedUp env)
Copy Constructor

Parameters:
env, - the env object to incorporate in the new ENVHullMatrix object

ENVHullMatrixSpeedUp

public ENVHullMatrixSpeedUp(int size)
Construct a new ENV for a HullMatrix with the given number of "0.0" elements

Parameters:
size, - the size the ENV should have at startup
Method Detail

add

public void add(int index,
                double value)
Add a new element at a specific index of the list, causing all other elements coming after that element to be shifted to the right (including the element currently at the given index)

Parameters:
index, - the index to set the value at (the index starts at 1)
value, - the new value

adjustEntryIndexesAfterEnlargement

protected void adjustEntryIndexesAfterEnlargement(int index,
                                                  int difference)
Adjust all entry indexes after an enlargement

Parameters:
index, - the original index we placed the enlargement at
difference, - the amount of elements by which we expanded

adjustEntryIndexesAfterReduction

protected void adjustEntryIndexesAfterReduction(int index,
                                                int difference)
Adjust all entry indexes after a reduction

Parameters:
index, - the original index we placed the reduction at
difference, - the amount of elements by which we reduced

clone

public java.lang.Object clone()
Clone this object

Overrides:
clone in class java.lang.Object
Returns:
the cloned object

enlargeAt

public void enlargeAt(int index,
                      int difference)
Enlarge the ENV by the given difference at the given index

Parameters:
index, - the index we enlarge the ENV at (all other items are shifted to the right)
difference, - the difference by which to enlarge the ENV

get

public double get(int index)
Retrieve a value from the list

Parameters:
index, - the index of the value to retrieve (the index starts at 1)
Returns:
the value

getData

public java.util.Vector<java.util.Vector> getData()
Retrieve the data vector from the ENV

Returns:
the data vector holding "Double" objects

getEntryIndexes

public int[] getEntryIndexes()
Retrieve the entry index array

Returns:
the entryIndex array holding all entry indexes used internally in the ENV class

getEntryIndexFor

protected int getEntryIndexFor(int index)
Compute the entry index for the given index and return the correct subvector

Parameters:
index, - the real index
Returns:
the entry index for the given index

getRequiredMemory

public long getRequiredMemory()
Retrieve the amount of required memory in this matrix (in byte)

Returns:
the amount of required memory in byte

reduceAt

public void reduceAt(int index,
                     int difference)
Reduce the ENV by the given difference at the given index

Parameters:
index, - the index we reduce the ENV at (all other items are shifted to the left)
difference, - the difference by which to reduce the ENV

set

public double set(int index,
                  double value)
Replace an already existing value in the list with a new value at the specific index

Parameters:
index, - the index of the element to replace (the index starts at 1)
value, - the value to replace the other value with
Returns:
the value we replaced

size

public int size()
Retrieve the number of Double elements in the ENV

Returns:
size