#include "slepcbv.h" PetscErrorCode BVOrthonormalizeColumn(BV bv,PetscInt j,PetscBool replace,PetscReal *norm,PetscBool *lindep)Collective
bv | - the basis vectors context | |
j | - index of column to be orthonormalized | |
replace | - whether it is allowed to set the vector randomly |
norm | - (optional) norm of the vector after orthogonalization and before normalization | |
lindep | - (optional) flag indicating that linear dependence was determined during orthogonalization |
This function first orthogonalizes vector V[j] with respect to V[0..j-1], where V[.] are the vectors of BV. A byproduct of this computation is norm, the norm of the vector after orthogonalization. Secondly, it scales the vector with 1/norm, so that the resulting vector has unit norm.
If after orthogonalization the vector V[j] is exactly zero, it cannot be normalized because norm=0. In that case, it could be left as zero or replaced by a random vector that is then orthonormalized. The latter is achieved by setting the argument replace to TRUE. The vector will be replaced by a random vector also if lindep was set to TRUE, even if the norm is not exactly zero.
If the vector has been replaced by a random vector, the output arguments norm and lindep will be set according to the orthogonalization of this new vector.