Class HouseholderReflection
The Householder reflection onto a unit vector e: the transformation that maps a vector a to |a|e.
public sealed class HouseholderReflection
- Inheritance
-
HouseholderReflection
- Inherited Members
Remarks
Immutable and safe to share across threads: the vector is copied.
Where a·e is negative, the reflection vector is (a − |a|e)/|a − |a|e|, QuantLib's general form, so a vector
opposite e maps to |a|e; QuantLib's near-parallel branches assume a·e positive, so its zero vector for a ∥ −e maps a
to −|a|e and its series branch near −e to neither (Divergences/HouseholderOppositeTests.cs).
Constructors
HouseholderReflection(Vector)
Initializes a new instance of the HouseholderReflection class.
public HouseholderReflection(Vector e)
Parameters
eVectorThe unit vector reflected onto, copied.
Exceptions
- ArgumentNullException
eis null.
Methods
Evaluate(Vector)
The reflected vector, |a|e.
public Vector Evaluate(Vector a)
Parameters
aVectorThe vector.
Returns
- Vector
A new vector.
Exceptions
- ArgumentNullException
ais null.- ArgumentException
ais the zero vector, or its size isn't e's.
ReflectionVector(Vector)
The vector v whose Householder transformation maps a to |a|e.
public Vector ReflectionVector(Vector a)
Parameters
aVectorThe vector.
Returns
- Vector
A new vector: the zero vector where a is already |a|e to machine precision.
Exceptions
- ArgumentNullException
ais null.- ArgumentException
ais the zero vector, or its size isn't e's.