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: sara Samadi <>
  • To:
  • Subject: Re: [cgal-discuss] CGAL::Random
  • Date: Tue, 21 Jun 2011 21:50:38 -0700 (PDT)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=hFXK2R+ZIvmi4NTjqKJePi3PTMMakFiv78QqswdEYN/tm0tQxdVHc3tKOVeLsM3iXIsAMoeW6pqInKfbjT8/x7lonSEELUR/GOEEM3piqqsgwGOkMEsqQqg8s8PxP/asl651XEknas5VMsLFfBPuEI8SkuMbzSD+BwyCi5ZTREw=;

I need that my random values produce in body of for loop!

--- On Tue, 6/21/11, Sylvain Pion <> wrote:

From: Sylvain Pion <>
Subject: Re: [cgal-discuss] CGAL::Random
To:
Date: Tuesday, June 21, 2011, 10:33 PM

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

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss




Archive powered by MHonArc 2.6.16.

Top of Page