Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/digraphs/extern/bliss-0.73/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 27.8.2025 mit Größe 1 kB image not shown  

Quelle  uintseqhash.hh   Sprache: C

 
#ifndef BLISS_UINTSEQHASH_HH
#define BLISS_UINTSEQHASH_HH

#include <cstdio>

/*
  Copyright (c) 2003-2015 Tommi Junttila
  Released under the GNU Lesser General Public License version 3.

  This file is part of bliss.

  bliss is free software: you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as published by
  the Free Software Foundation, version 3 of the License.

  bliss 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.  See the
  GNU Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public License
  along with bliss.  If not, see <http://www.gnu.org/licenses/>.
*/


namespace bliss_digraphs {

/** \internal
 * \brief A hash for sequences of unsigned ints.
 */

class UintSeqHash
{
protected:
  unsigned int h;
public:
  UintSeqHash() {h = 0; }
  UintSeqHash(const UintSeqHash &other) {h = other.h; }
  UintSeqHash& operator=(const UintSeqHash &other) {h = other.h; return *this; }

  /** Reset the hash value. */
  void reset() {h = 0; }

  /** Add the unsigned int \a n to the sequence. */
  void update(unsigned int n);

  /** Get the hash value of the sequence seen so far. */
  unsigned int get_value() const {return h; }

  /** Compare the hash values of this and \a other.
   * Return -1/0/1 if the value of this is smaller/equal/greater than
   * that of \a other. */

  int cmp(const UintSeqHash &other) const {
    return (h < other.h)?-1:((h == other.h)?0:1);
  }
  /** An abbreviation for cmp(other) < 0 */
  bool is_lt(const UintSeqHash &other) const {return(cmp(other) < 0); }
  /** An abbreviation for cmp(other) <= 0 */
  bool is_le(const UintSeqHash &other) const {return(cmp(other) <= 0); }
  /** An abbreviation for cmp(other) == 0 */
  bool is_equal(const UintSeqHash &other) const {return(cmp(other) == 0); }
};


// namespace bliss_digraphs

#endif

99%


¤ Dauer der Verarbeitung: 0.19 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.