Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] CGAL::Random

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] CGAL::Random


Chronological Thread 
  • From: Sylvain Pion <>
  • To:
  • Subject: Re: [cgal-discuss] CGAL::Random
  • Date: Tue, 21 Jun 2011 15:33:37 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=o+hFa4t70B5mfUk+dAhxoR3zxfqa5GQTd+STz94lCgeTcvdPM9Hjc6oGSO2NtjUmwl rGnxnJLIVVcLABP4DViSIRBTaxusf2KLjA8EbPQXd3z3rFhfrrfpjdBHWymeAP9bUyIc CNBVTxQ6LiL40faMr9A1jXC+QTAvMLh1NPEkU=

What about moving the initialization of the random variable out of the loop ?

On Tue, Jun 21, 2011 at 2:54 PM, sara123
<>
wrote:
> Hi, i wrote this simple code and executed it under a cpp file:
>
> for (int t=1; t<4; t++)
> {
> CGAL::Random random;
> double randi=random.get_double (0.0, 1);
> double mandi=random.get_double (0.0, 1);
> std::cout<<"randi="<<randi<<std::endl;
> std::cout<<"mandi="<<mandi<<std::endl;
> }
>
> after executation i received the same answer for randi and mandi in four
> execution of for loop:
>
> randi=0.969421
> mandi=0.659637
> randi=0.969421
> mandi=0.659637
> randi=0.969421
> mandi=0.659637
>
> now i want to receive different answers for each of variables in each of
> executation of for loop?
>
> --
> View this message in context:
> http://cgal-discuss.949826.n4.nabble.com/CGAL-Random-tp3615460p3615460.html
> Sent from the cgal-discuss mailing list archive at Nabble.com.
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
>
>



--
Sylvain



Archive powered by MHonArc 2.6.16.

Top of Page