|
From: SourceForge.net <no...@so...> - 2012-03-21 05:50:25
|
Bugs item #3509424, was opened at 2012-03-20 09:42 Message generated for change (Comment added) made by jparent You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=424682&aid=3509424&group_id=39235 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed Resolution: None Priority: 5 Private: No Submitted By: Fabrizio Pastore (fpastore) >Assigned to: Johan Parent (jparent) Summary: TIntObjectHashMap initial capacity wrong Initial Comment: Hi, I noticed that the value passed to the initialCapacity attribute of TIntObjectHashMap constructor seems to not have any relationship with the value returned by method capacity(). Is this a bug or a feature? Following lines show a failing test case: TIntObjectHashMap tIntObjectHashMap0 = new TIntObjectHashMap(200, 2F, 300); assertEquals(200, tIntObjectHashMap0.capacity()); //this test fails, 137 is returned instead of 200 ---------------------------------------------------------------------- >Comment By: Johan Parent (jparent) Date: 2012-03-20 22:50 Message: Hi Fabrizio, This does not appear to be a bug in this case. The capacity (~size of the hash table) is always a prime in the trove implementation. The only garuantee is that capacity >= initial_capacity/load_factor. But this is not an obvious thing. Regards, Johan ---------------------------------------------------------------------- Comment By: Fabrizio Pastore (fpastore) Date: 2012-03-20 09:46 Message: I did not mention that I am using Trove as case study for a research purposes on automatic test cases generation. So thanks in advance for your reply. Fabrizio ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=424682&aid=3509424&group_id=39235 |