.. _program_listing_file_src_sparsebase_partition_patoh_partition.h: Program Listing for File patoh_partition.h ========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``src/sparsebase/partition/patoh_partition.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #include #include "sparsebase/config.h" #include "sparsebase/format/csr.h" #include "sparsebase/partition/partitioner.h" #include "sparsebase/utils/parameterizable.h" #ifndef SPARSEBASE_PROJECT_PATOH_PARTITION_H #define SPARSEBASE_PROJECT_PATOH_PARTITION_H namespace sparsebase::partition { #ifdef USE_PATOH namespace patoh { enum Objective { CON = 1, CUT = 2 }; enum ParameterInit { DEFAULT = 0, SPEED = 1, QUALITY = 2 }; } // namespace patoh struct PatohPartitionParams : utils::Parameters { patoh::Objective objective = patoh::CON; patoh::ParameterInit param_init = patoh::DEFAULT; int num_partitions = 2; int final_imbalance = -1; int seed = 42; }; /* ! * Wraps the Patoh partitioner available here: * https://faculty.cc.gatech.edu/~umit/software.html. * The library must be compiled with the * USE_PATOH option turned on and the pre-built PATOH library should be * available. See the Optional Dependencies page (under Getting Started) in our * documentation for more info. */ template class PatohPartition : public Partitioner { private: static IDType *PartitionCSR(std::vector formats, utils::Parameters *params); public: typedef PatohPartitionParams ParamsType; PatohPartition(); PatohPartition(ParamsType params); }; #endif } // namespace sparsebase::partition #ifdef _HEADER_ONLY #include "sparsebase/partition/patoh_partition.cc" #endif #endif // SPARSEBASE_PROJECT_PATOH_PARTITION_H