1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
// Copyright (C) 1994 The New York Group Theory Cooperative
// See magnus/doc/COPYRIGHT for the full notice.
// Contents: The deterministic finite state automaton class
//
// Principal Author: Paul Wakefield
//
// Status: in progress
//
// Revision History:
//
#ifndef _StatePair_H_
#define _StatePair_H_
/*
For the time being this file cannot be dependent on other FSA stuff,
since this file is #included by ..../general/src/Set.C
#include "DFSAData.h"
typedef DFSAData::State State ;
*/
typedef int State ;
class StatePair {
public:
//constructor
StatePair(): first(0),second(0){};
//copy constructor
StatePair( const StatePair& s )
{ first = s.getFirstElt() ; second = s.getSecondElt() ; };
//destructor
~StatePair() {};
//member functions
State getFirstElt() const { return first ;}
State getSecondElt() const { return second ;}
void setFirstElt(State f) { first=f;}
void setSecondElt(State s) { second=s;}
int hash() const {
int k = 1; int l = 1;
return (1 << k)*l;
}
//operators
int operator== ( const StatePair& s ) const
{
if( first == s.first && second == s.second ) return 1 ;
else return 0 ;
}
StatePair& operator= ( const StatePair& s )
{
first = s.first ;
second = s.second ;
return *this ;
}
private:
//data
State first;
State second;
};
#endif
|