COIN-OR::LEMON - Graph Library

Opened 10 years ago

Closed 10 years ago

#42 closed defect (fixed)

The include files in random.h should be fixed

Reported by: deba Owned by: alpar
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 deba 10 years ago.
Patch for include files

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by deba

Patch for include files

comment:1 follow-up: Changed 10 years ago by deba

The patch fixes the include files in random.h

comment:2 Changed 10 years ago by alpar

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 10 years ago by deba

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 10 years ago by alpar

  • Resolution set to fixed
  • Status changed from new to closed

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.