| 40 | const Options Options::def; |
| 41 | |
| 42 | Options |
| 43 | Options::expand(void) const { |
| 44 | #ifdef GECODE_HAS_THREADS |
| 45 | double t = threads; |
| 46 | if (t <= -1.0) { |
| 47 | t = Support::Thread::npu() + t; |
| 48 | } else if (t < 0.0) { |
| 49 | t = (1.0 + t) * Support::Thread::npu(); |
| 50 | } else if (t == 0.0) { |
| 51 | t = Support::Thread::npu(); |
| 52 | } else if (t < 1.0) { |
| 53 | t = t * Support::Thread::npu(); |
| 54 | } |
| 55 | t = floor(t+0.5); |
| 56 | if (t < 1.0) |
| 57 | t = 1.0; |
| 58 | Options o(*this); |
| 59 | o.threads = t; |
| 60 | return o; |
| 61 | #else |
| 62 | return *this; |
| 63 | #endif |
| 64 | } |
| 65 | |
| 66 | }} |
| 67 |