org.ojalgo.access
Class SimpleArray<N extends Number>

java.lang.Object
  extended by org.ojalgo.access.SimpleArray<N>
All Implemented Interfaces:
Access1D<N>
Direct Known Subclasses:
SimpleArray.Big, SimpleArray.Complex, SimpleArray.Primitive

public abstract class SimpleArray<N extends Number>
extends Object
implements Access1D<N>

The purpose of (use case for) this class is to provide a minimal class that implements the Access1D interface and is mutable. Further the user can assume that a SimpleArray instance really is an SimpleArray.Big instance (and correspondingly for Double and ComplexNumber). Therefore it is safe to type cast and reference the data attribute.

Author:
apete

Nested Class Summary
static class SimpleArray.Big
           
static class SimpleArray.Complex
           
static class SimpleArray.Primitive
           
 
Field Summary
 int length
           
 
Method Summary
 double doubleValue(int anInd)
           
 N get(int anInd)
           
static SimpleArray.Big makeBig(int aLength)
           
static SimpleArray.Complex makeComplex(int aLength)
           
static SimpleArray.Primitive makePrimitive(int aLength)
           
abstract  void set(int anInd, double aNmbr)
           
abstract  void set(int anInd, N aNmbr)
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

length

public final int length
Method Detail

makeBig

public static final SimpleArray.Big makeBig(int aLength)

makeComplex

public static final SimpleArray.Complex makeComplex(int aLength)

makePrimitive

public static final SimpleArray.Primitive makePrimitive(int aLength)

set

public abstract void set(int anInd,
                         double aNmbr)

set

public abstract void set(int anInd,
                         N aNmbr)

size

public int size()
Returns:
The total number of elements contained in this structure

doubleValue

public double doubleValue(int anInd)

get

public N get(int anInd)