Template Class Reorderer

Inheritance Relationships

Base Type

Derived Types

Class Documentation

template<typename IDType>
class sparsebase::reorder::Reorderer : public sparsebase::utils::FunctionMatcherMixin<IDType*>

An abstract class representing reordering algorithms.

Class that generalizes reordering algorithms. It defines the API used for reordering as well as the return type of reordering (IDType*).

tparam IDType

the data type of row and column numbers (vertex IDs in the case of graphs)

Subclassed by sparsebase::reorder::AMDReorder< IDType, NNZType, ValueType >, sparsebase::reorder::DegreeReorder< IDType, NNZType, ValueType >, sparsebase::reorder::GenericReorder< IDType, NNZType, ValueType >, sparsebase::reorder::GrayReorder< IDType, NNZType, ValueType >, sparsebase::reorder::MetisReorder< IDType, NNZType, ValueType >, sparsebase::reorder::RCMReorder< IDType, NNZType, ValueType >, sparsebase::reorder::RabbitReorder< IDType, NNZType, ValueType >

Public Functions

IDType *GetReorder(format::Format *format, std::vector<context::Context*> contexts, bool convert_input)

Generates a reordering inverse permutation of format using one of the contexts in contexts

Parameters
  • format – the Format object that will be reordered.

  • contexts – vector of contexts that can be used for generating the reordering.

  • convert_input – whether or not to convert the input format if that is needed.

Returns

the inverse permutation array inv_perm of the input format; an array of size format.get_dimensions()[0] where inv_per[i] is the new ID of row/column i.

IDType *GetReorder(format::Format *format, utils::Parameters *params, std::vector<context::Context*> contexts, bool convert_input)

Generates a reordering inverse permutation of format with the given Parameters object and using one of the contexts in contexts

Parameters
  • format – the Format object that will be reordered.

  • params – a polymorphic pointer at a Parameters object that will contain hyperparameters used for reordering.

  • contexts – vector of contexts that can be used for generating the reordering.

  • convert_input – whether or not to convert the input format if that is needed.

Returns

the inverse permutation array inv_perm of the input format; an array of size format.get_dimensions()[0] where inv_per[i] is the new ID of row/column i.

std::tuple<std::vector<std::vector<format::Format*>>, IDType*> GetReorderCached(format::Format *csr, std::vector<context::Context*> contexts, bool convert_input)

Generates a reordering using one of the contexts in contexts, and caches intermediate Format objects.

Parameters
  • format – the Format object that will be reordered.

  • contexts – vector of contexts that can be used for generating the reordering.

  • convert_input – whether or not to convert the input format if that is needed.

Returns

A tuple with the first element being a vector of Format*, where each pointer in the output points at the format that the corresponds Format object from the the input was converted to. If an input Format wasn’t converted, the output pointer will point at nullptr. The second element is the inverse permutation array inv_perm of the input format; an array of size format.get_dimensions()[0] where inv_per[i] is the new ID of row/column i.

std::tuple<std::vector<std::vector<format::Format*>>, IDType*> GetReorderCached(format::Format *csr, utils::Parameters *params, std::vector<context::Context*> contexts, bool convert_input)

Generates a reordering inverse permutation of format with the given Parameters object and using one of the contexts in contexts

Parameters
  • format – the Format object that will be reordered.

  • params – a polymorphic pointer at a Parameters object that will contain hyperparameters used for reordering.

  • contexts – vector of contexts that can be used for generating the reordering.

  • convert_input – whether or not to convert the input format if that is needed.

Returns

A tuple with the first element being a vector of Format*, where each pointer in the output points at the format that the corresponds Format object from the the input was converted to. If an input Format wasn’t converted, the output pointer will point at nullptr. The second element is the inverse permutation array inv_perm of the input format; an array of size format.get_dimensions()[0] where inv_per[i] is the new ID of row/column i.

virtual ~Reorderer()