slepc-3.18.0 2022-10-01
Report Typos and Errors

# VecSetRandomNormal

Sets all components of a vector to normally distributed random values.

### Synopsis

    #include "slepcvec.h"
    PetscErrorCode VecSetRandomNormal(Vec v,PetscRandom rctx,Vec w1,Vec w2)

Logically Collective on v

### Input Parameters

| v | - the vector to be filled with random values
| rctx | - the random number context (can be NULL)
| w1 | - first work vector (can be NULL)
| w2 | - second work vector (can be NULL)

### Output Parameter

| v | - the vector

### Notes

Fills the two work vectors with uniformly distributed random values (VecSetRandom) and then applies the Box-Muller transform to get normally distributed values on v.

### See Also

VecSetRandom()

### Level

developer

### Location

src/sys/vec/vecutil.c
Index of all sys routines
Table of Contents for all manual pages
Index of all manual pages