|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ru.sscc.util.Rotation
The class provides Givens rotation by the formulas x' = x*cos(a) + y*sin(a), y' = -x*sin(a) + y*cos(a). The rotation angle a is always choosen from the interval [-p/2,p/2]. Note that rotation coefficients are uniquely reconstructed via tan(a/2) value. This fact is useful for storing of rotation coefficients in place of annuled matrix entries in rotation based factorization methods. The construction of a rotation coefficients is implemented in a number of construct methods by the efficiency reason (to provide reusing of the class instance).
The prepare() methods may be also used for constructing of rotation by already calculated tan(a/2) value or by the pair of sin(a) and cos(a) values.
Constructor Summary | |
Rotation()
|
Method Summary | |
double |
construct(double x,
double y)
Calculates rotation coefficients in such a way to annigilate a second argument. |
void |
construct(RealPointer px,
RealPointer py)
Calculates rotation coefficients in such a way to annigilate an entry pointed by the second parameter and modifies pointed entries by placing the rotated value at the first entry and tan(a/2) value at the second one. |
void |
constructAndRotate(RealContainer data,
int index1,
int step1,
int index2,
int step2,
int count)
Calculates rotation coefficients to annigilate the beginning entry of the second vector, does the rotation on entries of both vectors with the rotate(RealContainer,int,int,int,int,int) method,
and writes the tan(a/2) value to the
beginning entry of the second vector. |
double |
cos()
Returns the cos(a). |
void |
prepare(double tan)
Prepares rotation coefficients using tan(a/2) value. |
void |
prepare(double sin,
double cos)
Prepares the instance by already calculated sine and cosine values. |
void |
rotate(RealContainer data,
int index1,
int step1,
int index2,
int step2,
int count)
Rotates entries of two vectors by the formulas x'i = xi*cos(a) + yi*sin(a), y'i = -xi*sin(a) + yi*cos(a), i=0,...,count-1. |
void |
rotate(RealPointer px,
RealPointer py)
Processes a rotation upon x and y entries and stores x' and y' values in places of them. |
double |
sin()
Returns the sin(a). |
double |
tan()
Returns the tan(a/2) value. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Rotation()
Method Detail |
public double construct(double x, double y)
x
- a leading valuey
- an annullable valuepublic void construct(RealPointer px, RealPointer py)
px
- a pointer to the leading entrypy
- a pointer to the annullable entrypublic void constructAndRotate(RealContainer data, int index1, int step1, int index2, int step2, int count)
rotate(RealContainer,int,int,int,int,int)
method,
and writes the tan(a/2) value to the
beginning entry of the second vector.data
- a container where the vectors are storedindex1
- 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 (should be positive)public final void rotate(RealContainer data, int index1, int step1, int index2, int step2, int count)
data
- a container where the vectors are storedindex1
- 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' lengthpublic void rotate(RealPointer px, RealPointer py)
px
- a pointer to xpy
- a pointer to ypublic final double tan()
public void prepare(double tan)
public final double sin()
public final double cos()
public final void prepare(double sin, double cos)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |