Class 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 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