COIN-OR::LEMON - Graph Library

Opened 9 years ago

Closed 9 years ago

#229 closed defect (fixed)

Default implemention of Tolerace<> is faulty

Reported by: alpar Owned by: alpar
Priority: major Milestone: LEMON 1.1 release
Component: core Version: release branch 1.0
Keywords: Cc:
Revision id:

Description

The default implementation of Tolerance<> is faulty (it answers false to everything). Probably, it should not exist at all except the documentation.

Attachments (1)

tolerance-int.patch (8.3 KB) - added by alpar 9 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 in reply to: ↑ description Changed 9 years ago by alpar

  • Status changed from new to assigned

Replying to alpar:

The default implementation of Tolerance<> is faulty (it answers false to everything). Probably, it should not exist at all except the documentation.

So, we have two choices here:

  1. Enable the non-specialized version only in the documentation. Then using tolerance with a non-specialized type will result in a compile time error.
  2. Implement meaningful return values (for exact computation) in generic version. Then tolerance doesn't have to be specialized for integral types (all non-specialized type will be treated as an integral type).

Which one do you prefer?

Changed 9 years ago by alpar

comment:2 Changed 9 years ago by alpar

The attached tolerance-int.patch implements the second approach. You can apply it on the top of deba's patch at ticket:230 without the --exact hg option.

comment:3 follow-up: Changed 9 years ago by kpeter

It seems much better than the former code.

I only found a small mistake in the doc. You wrote "otherwise it a specialized version must be ...", here "it" should be removed.

comment:4 in reply to: ↑ 3 Changed 9 years ago by alpar

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

Replying to kpeter:

It seems much better than the former code.

I only found a small mistake in the doc. You wrote "otherwise it a specialized version must be ...", here "it" should be removed.

It's fixed and went to both the 1.0 and the main branches, see [7d7d9debb29a].

Note: See TracTickets for help on using tickets.