tuple_comparator

class tuple_comparator#(type T =  tuple) extends comparator#(T)

singleton Provides strategies to compare tuples.

Parameter

Toptional The type of a tuple object to be compared.  The default is tuple (with its default parameters).
Summary
tuple_comparatorsingleton Provides strategies to compare tuples.
Types
this_typeThe shorthand of pair_comparator #(T).
Functions
newprotected Creates a new comparator.
get_instancestatic Returns the singleton instance of this comparator.
eqvirtual Returns 1 if two tuples are equal.
ltvirtual Returns 1 if x is less than y.

Types

this_type

typedef tuple_comparator#(T) this_type

The shorthand of pair_comparator #(T).

Functions

new

protected function new()

protected Creates a new comparator.

get_instance

static function this_type get_instance()

static Returns the singleton instance of this comparator.

Returns

The singleton instance.

eq

virtual function bit eq(x,
y)

virtual Returns 1 if two tuples are equal.

Arguments

xA tuple.
yAnother tuple.

Returns

If x.first to x.tenth are equal to y.first to y.tenth respectively, then returns 1.  Otherwise, returns 0.

lt

virtual function bit lt(x,
y)

virtual Returns 1 if x is less than y.  Compares x.first and y.first.  If equal, then compares x.second and y.second, and so on.

Arguments

xA tuple.
yAnother tuple.

Returns

Returns 1 if x is less than y.  Otherwise, returns 0.

class tuple_comparator#(type T =  tuple) extends comparator#(T)
singleton Provides strategies to compare tuples.
class tuple#(type T1 =  int,
type T2 =  int,
type T3 =  int,
type T4 =  int,
type T5 =  int,
type T6 =  int,
type T7 =  int,
type T8 =  int,
type T9 =  int,
type T10 =  int)
Provides a tuple that carries up to ten values, which can be different types.
typedef tuple_comparator#(T) this_type
The shorthand of pair_comparator #(T).
class pair_comparator#(type T =  pair) extends comparator#(T)
singleton Provides strategies to compare pairs.
protected function new()
protected Creates a new comparator.
static function this_type get_instance()
static Returns the singleton instance of this comparator.
virtual function bit eq(x,
y)
virtual Returns 1 if two tuples are equal.
virtual function bit lt(x,
y)
virtual Returns 1 if x is less than y.