Program Listing for File permuter.h

Return to documentation for file (src/sparsebase/permute/permuter.h)

#include <any>
#include <cmath>
#include <iostream>
#include <memory>
#include <typeindex>
#include <typeinfo>
#include <unordered_map>
#include <vector>

#include "sparsebase/config.h"
#include "sparsebase/context/cpu_context.h"
#include "sparsebase/converter/converter.h"
#include "sparsebase/format/format.h"
#include "sparsebase/format/format_order_one.h"
#include "sparsebase/format/format_order_two.h"
#include "sparsebase/utils/extractable.h"
#include "sparsebase/utils/function_matcher_mixin.h"
#ifndef SPARSEBASE_PROJECT_PERMUTER_H
#define SPARSEBASE_PROJECT_PERMUTER_H

namespace sparsebase::permute {
template <typename InputFormatType, typename ReturnFormatType>
class Permuter : public utils::FunctionMatcherMixin<ReturnFormatType *> {
 public:
  Permuter() {
    static_assert(std::is_base_of<format::Format, InputFormatType>::value,
                  "Permuter must take as input a Format object");
    static_assert(std::is_base_of<format::Format, ReturnFormatType>::value,
                  "Permuter must return a Format object");
  }

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

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

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

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

}  // namespace sparsebase::permute
#ifdef _HEADER_ONLY
#include "sparsebase/permute/permuter.cc"
#endif

#endif  // SPARSEBASE_PROJECT_PERMUTER_H