COIN-OR::LEMON - Graph Library

Opened 10 years ago

Closed 10 years ago

#229 closed defect (fixed)

Default implemention of Tolerace<> is faulty

Reported by: Alpar Juttner Owned by: Alpar Juttner
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 Juttner 10 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 in reply to:  description Changed 10 years ago by Alpar Juttner

Status: newassigned

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

Attachment: tolerance-int.patch added

comment:2 Changed 10 years ago by Alpar Juttner

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 Changed 10 years ago by Peter Kovacs

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

Resolution: fixed
Status: assignedclosed

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.