[Bug libstdc++/32819] New: Hash Document Errors

2007-07-19 Thread chalathip at gmail dot com
from libstdc++-v3/docs/html/ext/pb_ds/hash_based_containers.html
There might be 2 errors in the "Hash Table Design" document as follows:

==
1st Error:
Section : Hash Table Design - Implementation - Probing Tables

Original text :
gp_hash_table is parametrized by Hash_Fn, Probe_Fn, and Comb_Probe_Fn. As
before, if Probe_Fn and Comb_Probe_Fn are, respectively, null_hash_fn and
null_probe_fn, then Comb_Probe_Fn is a ranged-probe functor. ...

Suggestion text:
gp_hash_table is parametrized by Hash_Fn, Probe_Fn, and Comb_Probe_Fn. As
before, if Hash_Fn and Probe_Fn are, respectively, null_hash_fn and
null_probe_fn, then Comb_Probe_Fn is a ranged-probe functor. ...
==
2nd Error:
Figure: Hash policy class diagram.
Suggestion: null_probe_fn class is missing.
==

I have to apologize if they are not errors. 
I am quite new to this forum and my english is very poor.
Chalathip Thumkanon.


-- 
   Summary: Hash Document Errors
   Product: gcc
   Version: 4.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: chalathip at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32819



[Bug libstdc++/32822] New: More Hash Document Errors

2007-07-19 Thread chalathip at gmail dot com
+++ This bug was initially created as a clone of Bug #32819 +++

from libstdc++-v3/docs/html/ext/pb_ds/hash_based_containers.html
In the Bug #32819, I report 2 errors. But I found one more bug.

Section : Hash Table Design - Hash Policies - Ranged-Hash Functions

Original text :
Now assume that s is the string representation of a of a long DNA sequence (and
so S = {'A', 'C', 'G', 'T'}). In this case, scanning the entire string might be
prohibitively expensive. A possible alternative might be to use only the first
k characters of the string, where
k^|S| ≥ m   -- (1)
...
requiring scanning over only 
k = log4( m )   -- (2)
characters.

My suggestion:
In my humble opinion, I think that the first equation should be changed to
|S|^k ≥ m
Otherwise, the second equation should be changed to
k=m^(1/4)

Anyway if the form of the second equation is changed from
k = xxx
to
k = integral_ceiling (xxx)
or something looks like
k= [xxx] ,(but the brackets should have only their upper halves ),
it might be a little more accurate. 

Best regards,
Chalathip Thumkanon.


-- 
   Summary: More Hash Document Errors
   Product: gcc
   Version: 4.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: chalathip at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32822



[Bug libstdc++/36612] New: __throw_* functions in ext/pb_ds/exception.hpp cause multiple definition errors

2008-06-23 Thread chalathip at gmail dot com
If the "ext/pb_ds/exception.hpp" is included (directly or indirectly) in more
than one separate compilation units, all of its __throw_... functions are
redefinition.

Fox example:
=== main.cc ===
#include"someclass.h"

int main(int argc,char *argv[])
{
   return(0);
}

=== someclass.h === 
#include // in gcc 4.2
/*
#include // in gcc 4.3.0
#include
#include
*/
class someclass
{
   // I want to use pat_trie here.
};

=== someclass.cc === 
#include"someclass.h"


$ g++ main.cc someclass.cc
someclass.cc:(.text+0x0): multiple definition of
`pb_ds::__throw_resize_error()'
/tmp/cc8LPB2N.o:main.cc:(.text+0x12): first defined here
/tmp/ccl19hyr.o: In function `pb_ds::__throw_join_error()':
someclass.cc:(.text+0x52): multiple definition of `pb_ds::__throw_join_error()'
/tmp/cc8LPB2N.o:main.cc:(.text+0x64): first defined here
/tmp/ccl19hyr.o: In function `pb_ds::__throw_insert_error()':
someclass.cc:(.text+0xa4): multiple definition of
`pb_ds::__throw_insert_error()'
/tmp/cc8LPB2N.o:main.cc:(.text+0xb6): first defined here
/tmp/ccl19hyr.o: In function `pb_ds::__throw_container_error()':
someclass.cc:(.text+0xf6): multiple definition of
`pb_ds::__throw_container_error()'
/tmp/cc8LPB2N.o:main.cc:(.text+0x108): first defined here
collect2: ld returned 1 exit status

===
My solution is to change all of _throw__... functions into inline ones.


-- 
   Summary: __throw_* functions in ext/pb_ds/exception.hpp cause
multiple definition errors
   Product: gcc
   Version: 4.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: chalathip at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36612