double_gram_schmidt¶
- probnum.utils.linalg.double_gram_schmidt(v, orthogonal_basis, inner_product=None, normalize=False, gram_schmidt_fn=<function modified_gram_schmidt>)[source]¶
Perform the (modified) Gram-Schmidt process twice.
Computes a vector \(v'\) such that \(\langle v', b_i \rangle = 0\) for all basis vectors \(b_i \in B\) in the orthogonal basis. This performs the (modified) Gram-Schmidt orthogonalization process twice, which is generally more stable than just reorthogonalizing once. 1 2
- Parameters
v (ndarray) – Vector (or stack of vectors) to orthogonalize against
orthogonal_basis
.inner_product (Optional[Union[ndarray, LinearOperator, Callable[[ndarray, ndarray], ndarray]]]) – Inner product defining orthogonality. Can be either a
numpy.ndarray
or aCallable
defining the inner product. Defaults to the euclidean inner product.normalize (bool) – Normalize the output vector, s.t. \(\langle v', v' \rangle = 1\).
gram_schmidt_fn (Callable) – Gram-Schmidt process to use. One of
gram_schmidt()
ormodified_gram_schmidt()
.
- Returns
Orthogonalized vector.
- Return type
v_orth
References
- 1
L. Giraud, J. Langou, M. Rozloznik, and J. van den Eshof, Rounding error analysis of the classical Gram-Schmidt orthogonalization process, Numer. Math., 101 (2005), pp. 87–100
- 2
L. Giraud, J. Langou, and M. Rozloznik, The loss of orthogonality in the Gram-Schmidt orthogonalization process, Comput. Math. Appl., 50 (2005)