Bläddra i källkod

* Added license

git-svn-id: trunk@17234 -
michael 14 år sedan
förälder
incheckning
6a0bd01953

+ 0 - 1
.gitattributes

@@ -2318,7 +2318,6 @@ packages/fcl-stl/doc/vector.tex svneol=native#text/plain
 packages/fcl-stl/doc/vectorexample.pp svneol=native#text/plain
 packages/fcl-stl/src/garrayutils.pp svneol=native#text/plain
 packages/fcl-stl/src/gdeque.pp svneol=native#text/plain
-packages/fcl-stl/src/ghashset.pp svneol=native#text/plain
 packages/fcl-stl/src/gmap.pp svneol=native#text/plain
 packages/fcl-stl/src/gpriorityqueue.pp svneol=native#text/plain
 packages/fcl-stl/src/gqueue.pp svneol=native#text/plain

+ 12 - 0
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;

+ 12 - 0
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;

+ 0 - 72
packages/fcl-stl/src/ghashset.pp

@@ -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.

+ 12 - 0
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;

+ 12 - 0
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;

+ 12 - 0
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;

+ 12 - 0
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;

+ 12 - 0
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;

+ 12 - 0
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;

+ 12 - 0
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;