Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
Static Public Member Functions
mty::lha::Comparator Struct Reference

Helper class to define a comparison function for positions. More...

#include <lhaData.h>

Static Public Member Functions

static bool compare (std::vector< size_t > const &pos1, std::vector< size_t > const &pos2)
 Compares two vectors of positions. More...
 
static bool compare (LHAElement const &A, LHAElement const &B)
 Compares two LHAElement. More...
 

Detailed Description

Helper class to define a comparison function for positions.

Member Function Documentation

◆ compare() [1/2]

static bool mty::lha::Comparator::compare ( std::vector< size_t > const &  pos1,
std::vector< size_t > const &  pos2 
)
inlinestatic

Compares two vectors of positions.

If pos1 and pos2 have different sizes, this function returns

pos1.size() < pos2.size();

Otherwise, the alphabetical order is used. This allows to sort matrix elements row by row, column by column (00 - 01 - 10 - 11 for example).

Parameters
pos1First position.
pos2Second position.
Returns
True if pos1 < pos2.
False else.

◆ compare() [2/2]

static bool mty::lha::Comparator::compare ( LHAElement const &  A,
LHAElement const &  B 
)
inlinestatic

Compares two LHAElement.

First compares the id. Returns the simpler if they are different and compares the positions else.

Parameters
AFirst LHAElement.
BSecond LHAElement.
Returns
True if A < B.
False else.

The documentation for this struct was generated from the following file: