diff options
| author | michael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2011-04-03 09:22:27 +0000 |
|---|---|---|
| committer | michael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2011-04-03 09:22:27 +0000 |
| commit | 8ff2d5f0357e5722a2da578e356778630896ee65 (patch) | |
| tree | cb07dad6daece4f958d0ee5e2ec53afd0f54cc0e /packages/fcl-stl | |
| parent | d701d26e700344378958eb27c45723d9aa6da224 (diff) | |
| download | fpc-8ff2d5f0357e5722a2da578e356778630896ee65.tar.gz | |
* Added license
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@17234 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/fcl-stl')
| -rw-r--r-- | packages/fcl-stl/src/garrayutils.pp | 12 | ||||
| -rw-r--r-- | packages/fcl-stl/src/gdeque.pp | 12 | ||||
| -rw-r--r-- | packages/fcl-stl/src/ghashset.pp | 72 | ||||
| -rw-r--r-- | packages/fcl-stl/src/gmap.pp | 12 | ||||
| -rw-r--r-- | packages/fcl-stl/src/gpriorityqueue.pp | 12 | ||||
| -rw-r--r-- | packages/fcl-stl/src/gqueue.pp | 12 | ||||
| -rw-r--r-- | packages/fcl-stl/src/gset.pp | 12 | ||||
| -rw-r--r-- | packages/fcl-stl/src/gstack.pp | 12 | ||||
| -rw-r--r-- | packages/fcl-stl/src/gutil.pp | 12 | ||||
| -rw-r--r-- | packages/fcl-stl/src/gvector.pp | 12 |
10 files changed, 108 insertions, 72 deletions
diff --git a/packages/fcl-stl/src/garrayutils.pp b/packages/fcl-stl/src/garrayutils.pp index 2f5f9d66a9..75e3c3fc1a 100644 --- a/packages/fcl-stl/src/garrayutils.pp +++ b/packages/fcl-stl/src/garrayutils.pp @@ -1,3 +1,15 @@ +{ + This file is part of the Free Pascal FCL library. + BSD parts (c) 2011 Vlado Boza + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY;without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +**********************************************************************} {$mode objfpc} unit garrayutils; diff --git a/packages/fcl-stl/src/gdeque.pp b/packages/fcl-stl/src/gdeque.pp index d6f06e3696..f83956f3c5 100644 --- a/packages/fcl-stl/src/gdeque.pp +++ b/packages/fcl-stl/src/gdeque.pp @@ -1,3 +1,15 @@ +{ + This file is part of the Free Pascal FCL library. + BSD parts (c) 2011 Vlado Boza + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY;without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +**********************************************************************} {$mode objfpc} unit gdeque; diff --git a/packages/fcl-stl/src/ghashset.pp b/packages/fcl-stl/src/ghashset.pp deleted file mode 100644 index ad45dce165..0000000000 --- a/packages/fcl-stl/src/ghashset.pp +++ /dev/null @@ -1,72 +0,0 @@ -{$mode objfpc} - -{unit ghashset; - -interface} -uses gvector; - -const baseSize = 8; - - - -{Thash should have one class function hash(a:T, n:longint):longint which return uniformly distributed -value in range <0,n-1> base only on arguments} - -type - generic hashset<T, Thash>=class - private type TContainer = specialize vector<T>; - type TTable = specialize vector<TContainer>; - var data:TTable; - public constructor create; - procedure insert(value:T);inline; - function find(value:T):boolean;inline; - end; - -{implementation} - -constructor hashset.create; -var i:longint; -begin - data:=TTable.create; - data.resize(8); - for i:=0 to 7 do - data[i]:=TContainer.create; -end; - -function hashset.find(value:T):boolean;inline; -var i,h,bs:longint; -begin - h:=Thash.hash(value,data.size); - bs:=data.getValue(h).size; - for i:=0 to bs-1 do begin - if (data.getvalue(h).getvalue(i)=value) then exit(true); - end; - exit(false); -end; - -procedure hashset.insert(value:T);inline; -begin - if (find(value)) then exit; - (data[Thash.hash(value,data.size)]).pushback(value); -end; - -type hint=class - class function hash(a,n:longint):longint; -end; - -class function hint.hash(a,n:longint):longint; -begin - hash:= a mod n; -end; - -type hsli = specialize hashset<longint, hint>; - -var data:hsli; i,n:longint; - -begin - data:=hsli.create; - for i:=0 to 10 do - data.insert(i); - for i:=0 to 13 do - writeln(data.find(i)); -end. diff --git a/packages/fcl-stl/src/gmap.pp b/packages/fcl-stl/src/gmap.pp index 7234433435..6bf839b5c0 100644 --- a/packages/fcl-stl/src/gmap.pp +++ b/packages/fcl-stl/src/gmap.pp @@ -1,3 +1,15 @@ +{ + This file is part of the Free Pascal FCL library. + BSD parts (c) 2011 Vlado Boza + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY;without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +**********************************************************************} {$mode objfpc} unit gmap; diff --git a/packages/fcl-stl/src/gpriorityqueue.pp b/packages/fcl-stl/src/gpriorityqueue.pp index 3946dd718a..7aa3d32cbc 100644 --- a/packages/fcl-stl/src/gpriorityqueue.pp +++ b/packages/fcl-stl/src/gpriorityqueue.pp @@ -1,3 +1,15 @@ +{ + This file is part of the Free Pascal FCL library. + BSD parts (c) 2011 Vlado Boza + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY;without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +**********************************************************************} {$mode objfpc} unit gpriorityqueue; diff --git a/packages/fcl-stl/src/gqueue.pp b/packages/fcl-stl/src/gqueue.pp index e638c7c110..a56aef4e47 100644 --- a/packages/fcl-stl/src/gqueue.pp +++ b/packages/fcl-stl/src/gqueue.pp @@ -1,3 +1,15 @@ +{ + This file is part of the Free Pascal FCL library. + BSD parts (c) 2011 Vlado Boza + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY;without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +**********************************************************************} {$mode objfpc} unit gqueue; diff --git a/packages/fcl-stl/src/gset.pp b/packages/fcl-stl/src/gset.pp index 425fb55cfd..01f2937644 100644 --- a/packages/fcl-stl/src/gset.pp +++ b/packages/fcl-stl/src/gset.pp @@ -1,3 +1,15 @@ +{ + This file is part of the Free Pascal FCL library. + BSD parts (c) 2011 Vlado Boza + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY;without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +**********************************************************************} {$mode objfpc} unit gset; diff --git a/packages/fcl-stl/src/gstack.pp b/packages/fcl-stl/src/gstack.pp index 91567c6fe6..2d5cfe4020 100644 --- a/packages/fcl-stl/src/gstack.pp +++ b/packages/fcl-stl/src/gstack.pp @@ -1,3 +1,15 @@ +{ + This file is part of the Free Pascal FCL library. + BSD parts (c) 2011 Vlado Boza + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY;without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +**********************************************************************} {$mode objfpc} unit gstack; diff --git a/packages/fcl-stl/src/gutil.pp b/packages/fcl-stl/src/gutil.pp index d1a44b1901..f653940f2b 100644 --- a/packages/fcl-stl/src/gutil.pp +++ b/packages/fcl-stl/src/gutil.pp @@ -1,3 +1,15 @@ +{ + This file is part of the Free Pascal FCL library. + BSD parts (c) 2011 Vlado Boza + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY;without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +**********************************************************************} {$mode objfpc} unit gutil; diff --git a/packages/fcl-stl/src/gvector.pp b/packages/fcl-stl/src/gvector.pp index c1fbc27d96..96fb6bce76 100644 --- a/packages/fcl-stl/src/gvector.pp +++ b/packages/fcl-stl/src/gvector.pp @@ -1,3 +1,15 @@ +{ + This file is part of the Free Pascal FCL library. + BSD parts (c) 2011 Vlado Boza + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY;without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +**********************************************************************} {$mode objfpc} unit gvector; |
