src/Tools/Metis/src/Ordered.sml
author blanchet
Fri, 17 Sep 2010 01:58:21 +0200
changeset 39502 cffceed8e7fa
parent 39501 aaa7078fff55
child 72004 913162a47d9f
permissions -rw-r--r--
fix license
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
39348
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     1
(* ========================================================================= *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     2
(* ORDERED TYPES                                                             *)
39502
cffceed8e7fa fix license
blanchet
parents: 39501
diff changeset
     3
(* Copyright (c) 2004 Joe Hurd, distributed under the BSD License            *)
39348
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     4
(* ========================================================================= *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     5
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     6
structure IntOrdered =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     7
struct type t = int val compare = Int.compare end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     8
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     9
structure IntPairOrdered =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    10
struct
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    11
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    12
type t = int * int;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    13
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    14
fun compare ((i1,j1),(i2,j2)) =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    15
    case Int.compare (i1,i2) of
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    16
      LESS => LESS
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    17
    | EQUAL => Int.compare (j1,j2)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    18
    | GREATER => GREATER;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    19
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    20
end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    21
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    22
structure StringOrdered =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    23
struct type t = string val compare = String.compare end;