# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.algebra.linear.matrix.doubles.operation.householder

## Class HouseholderContext

• java.lang.Object
• com.numericalmethod.suanshu.algebra.linear.matrix.doubles.operation.householder.HouseholderContext

• public class HouseholderContext
extends Object
This is the context information about a Householder transformation. It tells
1. v, the defining vector which is perpendicular to the Householder hyperplane;
2. generator, the vector used to generate the Householder defining vector;
3. λ, the norm of the generator with the sign chosen to be the opposite of the first coordinate of generator.
• ### Field Summary

Fields
Modifier and Type Field and Description
double beta
β = 2 / v'v.
Vector generator
The vector which is used to generate the Householder vector.
double lambda
The norm of the generator with the sign chosen to be the opposite of the first coordinate of the generator.
Vector v
The defining vector which is perpendicular to the Householder hyperplane.
• ### Constructor Summary

Constructors
Constructor and Description
HouseholderContext(Vector v, double beta, Vector generator, double lambda)
Constructs a Householder context information.
• ### Method Summary

All Methods
Modifier and Type Method and Description
static HouseholderContext getContext(Vector x)
Generates the context information from a generating vector x.
String toString()
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
• ### Field Detail

• #### v

public final Vector v
The defining vector which is perpendicular to the Householder hyperplane.
• #### beta

public final double beta
β = 2 / v'v.
• #### generator

public final Vector generator
The vector which is used to generate the Householder vector.
• #### lambda

public final double lambda
The norm of the generator with the sign chosen to be the opposite of the first coordinate of the generator.
• ### Constructor Detail

• #### HouseholderContext

public HouseholderContext(Vector v,
double beta,
Vector generator,
double lambda)
Constructs a Householder context information.
Parameters:
v - the defining vector which is perpendicular to the Householder hyperplane
beta - β
generator - the vector that generates the Householder reflection
lambda - λ, the negative norm of the generator
• ### Method Detail

• #### getContext

public static HouseholderContext getContext(Vector x)
Generates the context information from a generating vector x. Given a vector x, return a vector v, such that

Hx = ±||x|| * e1

That is,

H.reflect(x) == new DenseVector(new double[]{±x.norm(), 0, ...})

Parameters:
x - a vector
Returns:
the context information for a Householder transformation
public String toString()
toString in class Object