|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--ru.sscc.util.data.RealContainer
|
+--ru.sscc.util.data.DoubleContainer
An implementation of RealContainer based on
double[] type vector.
| Fields inherited from class ru.sscc.util.data.RealContainer |
CANT_MOVE_VECTOR |
| Constructor Summary | |
DoubleContainer(double[] data)
Constructor. |
|
DoubleContainer(int size)
Constructor. |
|
| Method Summary | |
double |
add(int index,
double value)
Adds the value to the container's entry. |
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. |
void |
assign(int index1,
int step1,
int index2,
int step2,
int count)
Assignment vector1 = vector2 when both vectors are stored in the container. |
java.lang.Object |
clone()
Clones the container. |
double |
get(int index)
Gets the value of a container entry. |
java.lang.Object |
getData()
Returns the data container encapsulated in the object (instance of the double[] type). |
RealPointer |
getPointer()
Gets a pointer to the beginning of the container with the unit increment. |
RealVector |
getVector(int index,
int step,
int count)
Creates a vector within the container. |
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. |
void |
moveVector(RealVector vector,
int newStartIndex)
Moves the starting index of vector created upon this container to a new location in the container. |
double |
mul(int index,
double value)
Multiplies the container's entry by the value. |
void |
multiply(int index,
int step,
double value,
int count)
Multiplies the vector posed in the container on a value. |
RealContainer |
newContainer(int size)
Creates a new container of the same type with the required size. |
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. |
double |
normMax(int index,
int step,
int count)
Calculates the maximum modules norm of the vector stored in the container. |
double |
normSum(int index,
int step,
int count)
Calculates the sum of modules norm of the vector stored in the container. |
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. |
double |
postProduct(int index,
int step,
RealPointer vec,
int count)
Calculates an inner product of two vectors with post-increment of starting indices. |
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. |
double |
preProduct(int index,
int step,
RealPointer vec,
int count)
Calculates an inner product of two vectors with pre-increment of starting indices. |
double |
relativeAccuracy()
Returns the relative accuracy: the RealMath.DBL_EPSILON value. |
void |
resize(int newSize)
Changes size of the container to a new size. |
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). |
double |
set(int index,
double value)
Sets the value of a container entry. |
int |
size()
Gets the container size. |
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. |
double |
weightedNormMax(int index,
int step,
RealPointer weight,
int count)
Calculates the weighted maximum modules norm of the vector stored in the container. |
double |
weightedNormSum(int index,
int step,
RealPointer weight,
int count)
Calculates the weighted sum of modules norm of the vector stored in the container. |
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 ru.sscc.util.data.RealContainer |
by,
ensureSize,
getPointer,
getVector,
shiftVector |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public DoubleContainer(double[] data)
data - a data containerpublic DoubleContainer(int size)
size - a container size| Method Detail |
public int size()
public void resize(int newSize)
public RealContainer newContainer(int size)
public double get(int index)
index - an entry position in the container
public double set(int index,
double value)
index - an entry position in the containervalue - a value to set
public double add(int index,
double value)
index - the entry position in the containervalue - the value to add
public double mul(int index,
double value)
index - the entry position in the containervalue - the value to multiplypublic RealPointer getPointer()
RealPointer object
public RealVector getVector(int index,
int step,
int count)
index - a starting index in the containerstep - an increment step in the containercount - a size of the vector
public void moveVector(RealVector vector,
int newStartIndex)
vector - the vector to be moved tonewStartIndex - the new starting indexpublic java.lang.Object clone()
public java.lang.Object getData()
public double relativeAccuracy()
public 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 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 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 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 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 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 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 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 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 int indexOfNormMax(int index,
int step,
int count)
index - the starting indexstep - the increment stepcount - the vector size
public double normMax(int index,
int step,
int count)
index - the starting indexstep - the increment stepcount - the vector size
public double normSum(int index,
int step,
int count)
index - the starting indexstep - the increment stepcount - the vector size
public 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 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 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 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 | |||||||