.. _program_listing_file_src_sparsebase_feature_jaccard_weights.cc: Program Listing for File jaccard_weights.cc =========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``src/sparsebase/feature/jaccard_weights.cc``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #include "sparsebase/feature/jaccard_weights.h" #include "sparsebase/format/csr.h" #ifdef USE_CUDA #include "sparsebase/format/cuda_csr_cuda.cuh" #endif #include namespace sparsebase::feature { template JaccardWeights::JaccardWeights( ParamsType) {} #ifdef USE_CUDA template format::Format *JaccardWeights:: GetJaccardWeightCUDACSR(std::vector formats, utils::Parameters *params) { auto cuda_csr = formats[0]->AsAbsolute>(); return RunJaccardKernel(cuda_csr); } #endif template JaccardWeights::JaccardWeights() { #ifdef USE_CUDA std::vector formats = { format::CUDACSR::get_id_static()}; this->RegisterFunction(formats, GetJaccardWeightCUDACSR); #endif } template JaccardWeights::~JaccardWeights(){}; template format::Format * JaccardWeights::GetJaccardWeights( format::Format *format, std::vector contexts, bool convert_input) { return this->Execute(nullptr, contexts, convert_input, format); // func(sfs, this->params_.get()); } #if !defined(_HEADER_ONLY) #include "init/jaccard_weights.inc" #endif } // namespace sparsebase::feature