COIN-OR::LEMON - Graph Library

Opened 17 years ago

Closed 17 years ago

#42 closed defect (fixed)

The include files in random.h should be fixed

Reported by: Balazs Dezso Owned by: Alpar Juttner
Priority: minor Milestone: LEMON 1.0 release
Component: core Version: hg main
Keywords: Cc:
Revision id:

Description

The <limits> file should be directly included and <ctime> is not required.

Attachments (1)

random_include_fix.patch (544 bytes) - added by Balazs Dezso 17 years ago.
Patch for include files

Download all attachments as: .zip

Change History (5)

Changed 17 years ago by Balazs Dezso

Attachment: random_include_fix.patch added

Patch for include files

comment:1 Changed 17 years ago by Balazs Dezso

The patch fixes the include files in random.h

comment:2 Changed 17 years ago by Alpar Juttner

What about klao's suggestion in ticket #19 about the possibility of seeding based on pid and/or timeofday etc? It might be a good idea, and it might require <ctime>. What is your opinion?

comment:3 Changed 17 years ago by Balazs Dezso

The randomize feature is a good idea and I would welcome it in the LEMON. However the solution is not obvious. In the c++ standard I have found just two functions which could be the source of the randomness(the clock() and the time() functions), but both of them have strict limitations. The good randomize function should work whenever we use more threads with own generators approximately started in the same time. Therefore, I suggest that it should be implemented different way for each compiler(for example MSVC does not supports getpid() function just _getpid()).

comment:4 in reply to:  1 Changed 17 years ago by Alpar Juttner

Resolution: fixed
Status: newclosed

Replying to deba:

The patch fixes the include files in random.h

It gets into the main branch [f2d66d810c88].

Note: See TracTickets for help on using tickets.