Revision 1526,
1.2 KB
checked in by gumbau, 18 years ago
(diff) |
Updated modules to the new interface and the new simplification algorithm improvements.
|
Rev | Line | |
---|
[1526] | 1 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 2 | // NTL Nonstandard Template Library for C++
|
---|
| 3 | // Copyright (c) 2003 by Miroslav Fidler, Tomas Rylek
|
---|
| 4 | //
|
---|
| 5 | // Created by Miroslav Fidler, Tomas Rylek, cxl@volny.cz
|
---|
| 6 | //
|
---|
| 7 | // Permission to use, copy, modify, distribute and sell this software for any
|
---|
| 8 | // purpose is hereby granted without fee, provided that the above copyright
|
---|
| 9 | // notice appear in all copies and that both that copyright notice and this
|
---|
| 10 | // permission notice appear in supporting documentation.
|
---|
| 11 | // The author makes no representations about the suitability of this software
|
---|
| 12 | // for any purpose. It is provided "as is"
|
---|
| 13 | // without express or implied warranty.
|
---|
| 14 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 15 |
|
---|
| 16 | #ifndef NTLS_H
|
---|
| 17 | #define NTLS_H
|
---|
| 18 |
|
---|
| 19 | #include <string>
|
---|
| 20 | #include <ntl.h>
|
---|
| 21 |
|
---|
| 22 | NTL_MOVEABLE(std::string)
|
---|
| 23 |
|
---|
| 24 | template<>
|
---|
| 25 | inline unsigned GetHashValue(const std::string& x)
|
---|
| 26 | {
|
---|
| 27 | return memhash(x.c_str(), x.size());
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | #ifndef NOWSTRING
|
---|
| 31 |
|
---|
| 32 | NTL_MOVEABLE(std::wstring)
|
---|
| 33 |
|
---|
| 34 | template<>
|
---|
| 35 | inline unsigned GetHashValue(const std::wstring& x)
|
---|
| 36 | {
|
---|
| 37 | CombineHash hash;
|
---|
| 38 | for(size_t i = 0; i != x.size(); ++i)
|
---|
| 39 | hash = hash.Put(x[i]);
|
---|
| 40 | return hash;
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | #endif
|
---|
| 44 |
|
---|
| 45 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.