slepc-3.20.1 2023-11-27
Report Typos and Errors

# BVSetRandomSign

Set the entries of a BV to values 1 or -1 with equal probability.

### Synopsis

    #include "slepcbv.h"
    PetscErrorCode BVSetRandomSign(BV bv)

Logically Collective

### Input Parameter

| bv | - basis vectors

### Notes

All active columns (except the leading ones) are modified.

This function is used, e.g., in contour integral methods when estimating the number of eigenvalues enclosed by the contour via an unbiased estimator of tr(f(A)) [Bai et al., JCAM 1996].

### Developer Notes

The current implementation obtains random numbers and then replaces them with -1 or 1 depending on the value being less than 0.5 or not.

### See Also

BVSetRandomContext(), BVSetRandom(), BVSetRandomColumn(), BVSetActiveColumns()

### Level

advanced

### Location

src/sys/classes/bv/interface/bvops.c
Index of all BV routines
Table of Contents for all manual pages
Index of all manual pages