Template Class Reorderer
Defined in File reorderer.h
Inheritance Relationships
Base Type
public sparsebase::utils::FunctionMatcherMixin< IDType * >
(Template Class FunctionMatcherMixin)
Derived Types
public sparsebase::reorder::AMDReorder< IDType, NNZType, ValueType >
(Template Class AMDReorder)public sparsebase::reorder::DegreeReorder< IDType, NNZType, ValueType >
(Template Class DegreeReorder)public sparsebase::reorder::GenericReorder< IDType, NNZType, ValueType >
(Template Class GenericReorder)public sparsebase::reorder::GrayReorder< IDType, NNZType, ValueType >
(Template Class GrayReorder)public sparsebase::reorder::MetisReorder< IDType, NNZType, ValueType >
(Template Class MetisReorder)public sparsebase::reorder::RCMReorder< IDType, NNZType, ValueType >
(Template Class RCMReorder)public sparsebase::reorder::RabbitReorder< IDType, NNZType, ValueType >
(Template Class RabbitReorder)
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 incontexts
- 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 sizeformat.get_dimensions()[0]
whereinv_per[i]
is the new ID of row/columni
.
-
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 incontexts
- 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 sizeformat.get_dimensions()[0]
whereinv_per[i]
is the new ID of row/columni
.
-
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 intermediateFormat
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 sizeformat.get_dimensions()[0]
whereinv_per[i]
is the new ID of row/columni
.
-
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 incontexts
- 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 sizeformat.get_dimensions()[0]
whereinv_per[i]
is the new ID of row/columni
.
-
virtual ~Reorderer()