Class TridiagonalHelper_DDRB
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyReflectorsToRow
(int blockLength, DSubmatrixD1 A, DSubmatrixD1 V, int row) Applies the reflectors that have been computed previously to the specified row.static void
computeRowOfV
(int blockLength, DSubmatrixD1 A, DSubmatrixD1 V, int row, double gamma) Final computation for a single row of 'v':
v = y -(1/2)γ(y^T*u)*ustatic void
computeV_blockVector
(int blockLength, DSubmatrixD1 A, double[] gammas, DSubmatrixD1 V) Given an already computed tridiagonal decomposition, compute the V row block vector.
y(:) = A*u
v(i) = y - (1/2)*γ*(y^T*u)*ustatic void
computeW_row
(int blockLength, DSubmatrixD1 Y, DSubmatrixD1 W, double[] beta, int betaIndex) Computes W from the householder reflectors stored in the columns of the row block submatrix Y.static void
computeY
(int blockLength, DSubmatrixD1 A, DSubmatrixD1 V, int row, double gamma) Computes the 'y' vector and stores the result in 'v'
y = -γ(A + U*V^T + V*U^T)ustatic double
innerProdRowSymm
(int blockLength, DSubmatrixD1 A, int rowA, DSubmatrixD1 B, int rowB, int zeroOffset) static void
multA_u
(int blockLength, DSubmatrixD1 A, DSubmatrixD1 V, int row) Multiples the appropriate submatrix of A by the specified reflector and stores the result ('y') in V.
y = A*ustatic void
tridiagUpperRow
(int blockLength, DSubmatrixD1 A, double[] gammas, DSubmatrixD1 V) Performs a tridiagonal decomposition on the upper row only.
-
Constructor Details
-
TridiagonalHelper_DDRB
public TridiagonalHelper_DDRB()
-
-
Method Details
-
tridiagUpperRow
public static void tridiagUpperRow(int blockLength, DSubmatrixD1 A, double[] gammas, DSubmatrixD1 V) Performs a tridiagonal decomposition on the upper row only.
For each row 'a' in 'A':
Compute 'u' the householder reflector.
y(:) = A*u
v(i) = y - (1/2)*(y^T*u)*u
a(i+1) = a(i) - u*γ*v^T - v*u^t
- Parameters:
blockLength
- Size of a blockA
- is the row block being decomposed. Modified.gammas
- Householder gammas.V
- Where computed 'v' are stored in a row block. Modified.
-
computeW_row
public static void computeW_row(int blockLength, DSubmatrixD1 Y, DSubmatrixD1 W, double[] beta, int betaIndex) Computes W from the householder reflectors stored in the columns of the row block submatrix Y.
Y = v(1)
W = -β1v(1)
for j=2:r
z = -β(I +WYT)v(j)
W = [W z]
Y = [Y v(j)]
end
where v(.) are the house holder vectors, and r is the block length. Note that Y already contains the householder vectors so it does not need to be modified.Y and W are assumed to have the same number of rows and columns.
-
computeV_blockVector
public static void computeV_blockVector(int blockLength, DSubmatrixD1 A, double[] gammas, DSubmatrixD1 V) Given an already computed tridiagonal decomposition, compute the V row block vector.
y(:) = A*u
v(i) = y - (1/2)*γ*(y^T*u)*u -
applyReflectorsToRow
Applies the reflectors that have been computed previously to the specified row.
A = A + u*v^T + v*u^T only along the specified row in A.- Parameters:
A
- Contains the reflectors and the row being updated.V
- Contains previously computed 'v' vectors.row
- The row of 'A' that is to be updated.
-
computeY
Computes the 'y' vector and stores the result in 'v'
y = -γ(A + U*V^T + V*U^T)u- Parameters:
A
- Contains the reflectors and the row being updated.V
- Contains previously computed 'v' vectors.row
- The row of 'A' that is to be updated.
-
multA_u
Multiples the appropriate submatrix of A by the specified reflector and stores the result ('y') in V.
y = A*u
- Parameters:
A
- Contains the 'A' matrix and 'u' vector.V
- Where resulting 'y' row vectors are stored.row
- row in matrix 'A' that 'u' vector and the row in 'V' that 'y' is stored in.
-
innerProdRowSymm
public static double innerProdRowSymm(int blockLength, DSubmatrixD1 A, int rowA, DSubmatrixD1 B, int rowB, int zeroOffset) -
computeRowOfV
public static void computeRowOfV(int blockLength, DSubmatrixD1 A, DSubmatrixD1 V, int row, double gamma) Final computation for a single row of 'v':
v = y -(1/2)γ(y^T*u)*u
-