1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>VecSetRandom</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<A NAME="VecSetRandom"><H1>VecSetRandom</H1></A>
Sets all components of a vector to random numbers.
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscvec.h"
int VecSetRandom(PetscRandom rctx,Vec x)
</PRE>
Collective on <A HREF="../Vec/Vec.html#Vec">Vec</A>
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>rctx </B></TD><TD>- the random number context, formed by <A HREF="../Sys/PetscRandomCreate.html#PetscRandomCreate">PetscRandomCreate</A>(), or PETSC_NULL and
it will create one internally.
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>x </B></TD><TD>- the vector
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Output Parameter</FONT></H3>
<DT><B>x </B> -the vector
<br>
<P>
<H3><FONT COLOR="#CC3333">Example of Usage</FONT></H3>
<PRE>
<A HREF="../Sys/PetscRandomCreate.html#PetscRandomCreate">PetscRandomCreate</A>(PETSC_COMM_WORLD,RANDOM_DEFAULT,&rctx);
<A HREF="../Vec/VecSetRandom.html#VecSetRandom">VecSetRandom</A>(rctx,x);
<A HREF="../Sys/PetscRandomDestroy.html#PetscRandomDestroy">PetscRandomDestroy</A>(rctx);
</PRE>
<P>
<P>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
<A HREF="../Vec/VecSet.html#VecSet">VecSet</A>(), <A HREF="../Vec/VecSetValues.html#VecSetValues">VecSetValues</A>(), <A HREF="../Sys/PetscRandomCreate.html#PetscRandomCreate">PetscRandomCreate</A>(), <A HREF="../Sys/PetscRandomDestroy.html#PetscRandomDestroy">PetscRandomDestroy</A>()
<BR><P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>intermediate
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/vec/interface/vector.c.html#VecSetRandom">src/vec/interface/vector.c</A>
<BR><A HREF="./index.html">Index of all Vec routines</A>
<BR><A HREF="../../index.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
<P><H3><FONT COLOR="#CC3333">Examples</FONT></H3>
<A HREF="../../../src/sles/examples/tutorials/ex2.c.html">src/sles/examples/tutorials/ex2.c.html</A><BR>
<A HREF="../../../src/sles/examples/tutorials/ex4.c.html">src/sles/examples/tutorials/ex4.c.html</A><BR>
<A HREF="../../../src/sles/examples/tutorials/ex11.c.html">src/sles/examples/tutorials/ex11.c.html</A><BR>
<A HREF="../../../src/sles/examples/tutorials/ex2f.F.html">src/sles/examples/tutorials/ex2f.F.html</A><BR>
<A HREF="../../../src/sles/examples/tutorials/ex11f.F.html">src/sles/examples/tutorials/ex11f.F.html</A><BR>
</BODY></HTML>
|