Template Class Permuter

Inheritance Relationships

Base Type

Class Documentation

template<typename InputFormatType, typename ReturnFormatType>
class sparsebase::permute::Permuter : public sparsebase::utils::FunctionMatcherMixin<ReturnFormatType*>

Permutes a format according to an inverse permutation of its rows/columns.

Public Functions

inline Permuter()
ReturnFormatType *GetPermutation(format::Format *csr, std::vector<context::Context*>, bool convert_input)

Permute format to a new format according to an inverse permutation using one of the contexts in contexts

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

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

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

Returns

a transformed Format object

ReturnFormatType *GetPermutation(format::Format *csr, utils::Parameters *params, std::vector<context::Context*>, bool convert_input)

Permute format to a new format according to an inverse permutation using one of the contexts in contexts

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

  • params – a polymorphic pointer at a params object

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

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

Returns

a transformed Format object

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

Permute format to a new format according to an inverse permutation using one of the contexts in contexts

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

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

  • 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 a transformed Format object.

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

Permute format to a new format according to an inverse permutation using one of the contexts in contexts

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

  • params – a polymorphic pointer at a params object

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

  • 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 a transformed Format object.

virtual ~Permuter()