View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000330 | OpenFOAM | Bug | public | 2011-10-31 09:42 | 2011-11-03 17:06 |
Reporter | Assigned To | ||||
Priority | normal | Severity | major | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Summary | 0000330: uniqueOrder() drops largest item | ||||
Description | The uniqueOrder() function in src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C is broken because it always drops the item with the largest value. | ||||
Steps To Reproduce | Compile the test program in applications/test/sort and run Test-sortList. Observe the results. The first "unique:" output should return a list that is 6 elements long, however, it only returns an ordering that has 5 elements. It is missing the entry "1" which corresponds to the item with the highest value (9) in the unsorted list. | ||||
Tags | No tags attached. | ||||
|
Attached patch fixes the issue. |
2011-10-31 09:45
|
0001-BUG-Fix-uniqueOrder-to-not-drop-largest-item.patch (948 bytes)
From 1595f900feb4f9fce4c6b7278dd399c8c96a56f6 Mon Sep 17 00:00:00 2001 From: Michael Wild <themiwi@users.sourceforge.net> Date: Mon, 31 Oct 2011 10:42:35 +0100 Subject: [PATCH] BUG: Fix uniqueOrder() to not drop largest item Fixes http://www.openfoam.com/mantisbt/view.php?id=330. Signed-off-by: Michael Wild <themiwi@users.sourceforge.net> --- .../containers/Lists/ListOps/ListOpsTemplates.C | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C b/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C index 1f308ed..41e28c3 100644 --- a/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C +++ b/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C @@ -243,6 +243,7 @@ void Foam::uniqueOrder order[n++] = order[i]; } } + order[n++] = order[order.size()-1]; order.setSize(n); } } -- 1.7.5.4 |
|
Thanks. Pushed in 7b86d6b513c81009a78070796bf87c794ad791b5 |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-10-31 09:42 |
|
New Issue | |
2011-10-31 09:44 |
|
Note Added: 0000779 | |
2011-10-31 09:45 |
|
File Added: 0001-BUG-Fix-uniqueOrder-to-not-drop-largest-item.patch | |
2011-11-03 17:06 |
|
Note Added: 0000782 | |
2011-11-03 17:06 |
|
Status | new => resolved |
2011-11-03 17:06 |
|
Fixed in Version | => 2.0.x |
2011-11-03 17:06 |
|
Resolution | open => fixed |
2011-11-03 17:06 |
|
Assigned To | => user4 |