|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.java.dev.joode.util.RealPointer
public class RealPointer
Created originally to ease porting the ODE code. Represents an index to an element of some float data. Used alot by the LCP areas of the code, where a large matrix is broken down into small matrixes for sub methods work with. Creating new instances causes *alot* of garbage, so please switch to using the object pool functionality (aquire & release static instance methods)
| Field Summary | |
|---|---|
Real |
data
|
int |
index
|
static RealPointer |
tmp
|
| Constructor Summary | |
|---|---|
RealPointer(Real data)
Deprecated. |
|
RealPointer(Real data,
int index)
Deprecated. |
|
RealPointer(RealPointer base,
int add)
Deprecated. |
|
| Method Summary | |
|---|---|
RealPointer |
add(int n)
Deprecated. use the passback version wherever possible |
RealPointer |
add(int n,
RealPointer result)
adds to this pointer producing a new pointer in C float * ptr; float * ptr2 = ptr1 + 10; <-- creates new pointer, old pointer is preserved Garabageless |
static RealPointer |
aquireInstance(Real data)
returns an initialized RealPointer that points to the argument. |
static RealPointer |
aquireInstance(Real data,
int index)
|
static RealPointer |
aquireInstance(RealPointer base,
int add)
creates a new RealPointer that points to the same data black, but with an incremented index in C:- float * ptr a = ...; float * ptr b = a + rowskip; |
java.lang.Object |
clone()
|
void |
copy(RealPointer b,
int n)
|
Real |
getData()
|
int |
getIndex()
|
float |
getValue()
returns the value of the cell that the index points to |
float |
getValue(int offset)
|
static void |
releaseInstance(RealPointer instance)
returns an object back to the instance pool, so it can be aquired by aquire instance methods |
RealPointer |
set(RealPointer a)
sets this to be a copy of the passed in parameter (and returns this) an alternative to garbage creating cloning |
void |
setData(Real data)
|
void |
setIndex(int index)
|
void |
setValue(float val)
|
void |
setValue(int offset,
float val)
|
void |
setZero(int n)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static RealPointer tmp
public Real data
public int index
| Constructor Detail |
|---|
public RealPointer(Real data)
data -
public RealPointer(Real data,
int index)
data -
public RealPointer(RealPointer base,
int add)
| Method Detail |
|---|
public static RealPointer aquireInstance(Real data)
data -
public static RealPointer aquireInstance(Real data,
int index)
public static void releaseInstance(RealPointer instance)
public static RealPointer aquireInstance(RealPointer base,
int add)
base - add -
public Real getData()
public void setData(Real data)
data - The data to set.public int getIndex()
public void setIndex(int index)
index - The index to set.public float getValue()
public float getValue(int offset)
public void setValue(float val)
public void setValue(int offset,
float val)
public RealPointer add(int n)
n -
public RealPointer add(int n,
RealPointer result)
n - result - public void setZero(int n)
n -
public void copy(RealPointer b,
int n)
b - n - public java.lang.Object clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic RealPointer set(RealPointer a)
a -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||