|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--ru.sscc.util.data.RealContainer
This abstract class implements Cloneable and Serializable interfaces for real data container which is an array of the float[] or double[] type. The main use of this class is a container for matrix entries. Internal inner products and some other methods are added to this class for the efficiency reasons.
| Field Summary | |
protected static java.lang.String |
CANT_MOVE_VECTOR
|
| Constructor Summary | |
RealContainer()
|
|
| Method Summary | |
abstract double |
add(int index,
double value)
Adds the value to the container's entry. |
abstract void |
addVector(int index1,
int step1,
int index2,
int step2,
double factor,
int count)
Operation vector1 += factor * vector2 upon the vectors stored in the container. |
abstract void |
assign(int index1,
int step1,
int index2,
int step2,
int count)
Assignment vector1 = vector2 when both vectors are stored in the container. |
static RealContainer |
by(java.lang.Object obj)
Static service method which creates RealContainer upon an
object convertable to it (double[], float[], or
RealContainer instance). |
java.lang.Object |
clone()
Clones the container. |
void |
ensureSize(int size)
Tests a container size to be not less that specified size and throws the IllegalArgumentException if not. |
abstract double |
get(int index)
Gets the value of a container entry. |
abstract java.lang.Object |
getData()
Returns the data container encapsulated in the object (instance of double[] or float[] type). |
abstract RealPointer |
getPointer()
Gets a pointer to the beginning of the container with the unit increment. |
RealPointer |
getPointer(int index,
int step)
Gets a pointer and resets it for sequential access to the container entries starting from the index position with the step increment. |
RealVector |
getVector()
Gets RealVector consisting of all container entries. |
abstract RealVector |
getVector(int index,
int step,
int length)
Creates a vector within the real container. |
abstract int |
indexOfNormMax(int index,
int step,
int count)
Calculates the index of the first entry having the maximum module for the vector stored in the container. |
abstract void |
moveVector(RealVector vector,
int newStartIndex)
Moves the starting index of vector created upon this container to a new location in the container. |
abstract double |
mul(int index,
double value)
Multiplies the container's entry by the value. |
abstract void |
multiply(int index,
int step,
double value,
int count)
Multiplies the vector posed in the container on a value. |
abstract RealContainer |
newContainer(int size)
Creates a new container of the same type with the required size. |
abstract double |
normalize(int index,
int step,
double value,
int count)
Multiplies the vector posed in the container on a value and calculates its sum-norm. |
abstract double |
normMax(int index,
int step,
int count)
Calculates the maximum modules norm of the vector stored in the container. |
abstract double |
normSum(int index,
int step,
int count)
Calculates the sum of modules norm of the vector stored in the container. |
abstract double |
postProduct(int index1,
int step1,
int index2,
int step2,
int count)
Calculates an inner product of two vectors distributed within the container with post-increment of starting indices. |
abstract double |
postProduct(int index,
int step,
RealPointer vec,
int count)
Calculates an inner product of two vectors with post-increment of starting indices. |
abstract double |
preProduct(int index1,
int step1,
int index2,
int step2,
int count)
Calculates an inner product of two vectors distributed within the container with pre-increment of starting indices. |
abstract double |
preProduct(int index,
int step,
RealPointer vec,
int count)
Calculates an inner product of two vectors with pre-increment of starting indices. |
abstract double |
relativeAccuracy()
Returns the relative accuracy: smallest value e such that 1+e isn't equal to 1 for the data type used in the container. |
abstract void |
resize(int newSize)
Changes size of the container to a new size. |
abstract void |
rotate(double cos,
double sin,
int index1,
int step1,
int index2,
int step2,
int count)
Rotates two container's vectors with the Givens rotataion by the formulas v1' = v1*cos(a) + v2*sin(a), v2' = -v1*sin(a) + v2*cos(a). |
abstract double |
set(int index,
double value)
Sets the value of a container entry. |
void |
shiftVector(RealVector vector,
int startIndexIncrement)
Shifts the starting index of vector created upon this container by a specified increment. |
abstract int |
size()
Gets the container size. |
abstract void |
swap(int index1,
int step1,
int index2,
int step2,
int count)
Swaps entries of vector1 with corresponding entries of vector2 for the vectors stored in the container. |
abstract double |
weightedNormMax(int index,
int step,
RealPointer weight,
int count)
Calculates the weighted maximum modules norm of the vector stored in the container. |
abstract double |
weightedNormSum(int index,
int step,
RealPointer weight,
int count)
Calculates the weighted sum of modules norm of the vector stored in the container. |
abstract double |
weightedProduct(int index1,
int step1,
int index2,
int step2,
RealPointer weight,
int count)
Calculates a weighted inner product of two vectors distributed within the container. |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected static final java.lang.String CANT_MOVE_VECTOR
| Constructor Detail |
public RealContainer()
| Method Detail |
public static RealContainer by(java.lang.Object obj)
RealContainer upon an
object convertable to it (double[], float[], or
RealContainer instance). In the last case the same object
will be returned.public abstract int size()
public final void ensureSize(int size)
size - a minimum size neededpublic abstract void resize(int newSize)
public abstract RealContainer newContainer(int size)
public abstract double get(int index)
index - an entry position in the container
public abstract double set(int index,
double value)
index - an entry position in the containervalue - a value to set
public abstract double add(int index,
double value)
index - the entry position in the containervalue - the value to add
public abstract double mul(int index,
double value)
index - the entry position in the containervalue - the value to multiplypublic abstract RealPointer getPointer()
RealPointer object
public final RealPointer getPointer(int index,
int step)
index - a starting index in the containerstep - an increment step in the container
public abstract RealVector getVector(int index,
int step,
int length)
index - a starting index in the containerstep - an increment step in the containerlength - a length of the vectorpublic final RealVector getVector()
RealVector consisting of all container entries.
public abstract void moveVector(RealVector vector,
int newStartIndex)
vector - the vector to be moved tonewStartIndex - the new starting index
public final void shiftVector(RealVector vector,
int startIndexIncrement)
vector - the vector to be shiftednewStartIndex - the increment to shift the starting indexpublic java.lang.Object clone()
public abstract java.lang.Object getData()
public abstract double relativeAccuracy()
public abstract void assign(int index1,
int step1,
int index2,
int step2,
int count)
index1 - a starting index for the first vectorstep1 - an increment step for the first vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorcount - vector's size
public abstract void multiply(int index,
int step,
double value,
int count)
index - the starting index for the vectorstep - the increment step for the vectorvalue - the multiplecount - the vector length
public abstract double normalize(int index,
int step,
double value,
int count)
index - the starting index for the vectorstep - the increment step for the vectorvalue - the multiplecount - the vector lengththe - sum of modules norm after the multiplication
public abstract void addVector(int index1,
int step1,
int index2,
int step2,
double factor,
int count)
index1 - a starting index for the first vectorstep1 - an increment step for the first vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorfactor - a multipliercount - a vector size
public abstract double postProduct(int index1,
int step1,
int index2,
int step2,
int count)
index1 - a starting index for the first vectorstep1 - an increment step for the first vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorcount - a vectors length
public abstract double postProduct(int index,
int step,
RealPointer vec,
int count)
RealPointer.index - a starting index for the first vectorstep - an increment step for the first vectorvec - a pointer to the second vectorcount - a vectors length
public abstract double preProduct(int index1,
int step1,
int index2,
int step2,
int count)
index1 - an index before the first vectorstep1 - an increment step for the first vectorindex2 - an index before the second vectorstep2 - an increment step for the second vectorcount - a vectors length
public abstract double preProduct(int index,
int step,
RealPointer vec,
int count)
RealPointer.index - an index before the first vectorstep - an increment step for the first vectorvec - a pointer to an entry before the second vectorcount - a vectors length
public abstract double weightedProduct(int index1,
int step1,
int index2,
int step2,
RealPointer weight,
int count)
index1 - a starting index for the first vectorstep1 - an increment step for the first vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorweight - a weight vector (may be equal to null)count - a vectors length
public abstract int indexOfNormMax(int index,
int step,
int count)
index - the starting indexstep - the increment stepcount - the vector size
public abstract double normMax(int index,
int step,
int count)
index - the starting indexstep - the increment stepcount - the vector size
public abstract double normSum(int index,
int step,
int count)
index - the starting indexstep - the increment stepcount - the vector size
public abstract double weightedNormMax(int index,
int step,
RealPointer weight,
int count)
index - the starting indexstep - the increment stepweight - the weight vector (may be equal to null)count - the vector size
public abstract double weightedNormSum(int index,
int step,
RealPointer weight,
int count)
index - the starting indexstep - the increment stepweight - the weight vector (may be equal to null)count - the vector size
public abstract void rotate(double cos,
double sin,
int index1,
int step1,
int index2,
int step2,
int count)
cos - a cosine of the rotaion angle asin - a sine of the rotatin angle aindex1 - a starting index for the first vectorstep1 - an increment step for the first vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorcount - a vectors length
public abstract void swap(int index1,
int step1,
int index2,
int step2,
int count)
index1 - a starting index for the first vectorstep1 - an increment step for the first vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorcount - a vector size
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||