Loading .clang-format +2 −0 Original line number Diff line number Diff line Loading @@ -23,3 +23,5 @@ AccessModifierOffset: -3 AlwaysBreakAfterReturnType: All AllowShortBlocksOnASingleLine: false AllowShortFunctionsOnASingleLine: false AllowShortIfStatementsOnASingleLine: false AlignTrailingComments: true cpp/src/config/YamlConfigMgr.h +1 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ class YamlConfigMgr : public ConfigMgr { SetConfigValue(const YAML::Node& node, const std::string& key, ConfigNode& config); bool SetChildConfig(const YAML::Node& node, const std::string& name, ConfigNode& config); SetChildConfig(const YAML::Node& node, const std::string& child_name, ConfigNode& config); bool SetSequence(const YAML::Node& node, const std::string& child_name, ConfigNode& config); Loading cpp/src/core/knowhere/knowhere/common/Config.h +4 −2 Original line number Diff line number Diff line Loading @@ -46,12 +46,14 @@ struct Cfg { const int64_t &k, const int64_t &gpu_id, METRICTYPE type) : d(dim), k(k), gpu_id(gpu_id), metric_type(type) {} : metric_type(type), k(k), gpu_id(gpu_id), d(dim) {} Cfg() = default; virtual bool CheckValid(){}; CheckValid(){ return true; }; }; using Config = std::shared_ptr<Cfg>; Loading cpp/src/core/knowhere/knowhere/common/Dataset.h +2 −2 Original line number Diff line number Diff line Loading @@ -127,10 +127,10 @@ class Dataset { //} private: SchemaPtr array_schema_; SchemaPtr tensor_schema_; std::vector<ArrayPtr> array_; SchemaPtr array_schema_; std::vector<TensorPtr> tensor_; SchemaPtr tensor_schema_; //Config meta_; }; Loading cpp/src/core/knowhere/knowhere/index/vector_index/helpers/IndexParameter.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -25,9 +25,14 @@ namespace zilliz { namespace knowhere { faiss::MetricType GetMetricType(METRICTYPE &type) { if (type == METRICTYPE::L2) return faiss::METRIC_L2; if (type == METRICTYPE::IP) return faiss::METRIC_INNER_PRODUCT; if (type == METRICTYPE::INVALID) KNOWHERE_THROW_MSG("Metric type is invalid"); if (type == METRICTYPE::L2) { return faiss::METRIC_L2; } if (type == METRICTYPE::IP) { return faiss::METRIC_INNER_PRODUCT; } KNOWHERE_THROW_MSG("Metric type is invalid"); } Loading Loading
.clang-format +2 −0 Original line number Diff line number Diff line Loading @@ -23,3 +23,5 @@ AccessModifierOffset: -3 AlwaysBreakAfterReturnType: All AllowShortBlocksOnASingleLine: false AllowShortFunctionsOnASingleLine: false AllowShortIfStatementsOnASingleLine: false AlignTrailingComments: true
cpp/src/config/YamlConfigMgr.h +1 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ class YamlConfigMgr : public ConfigMgr { SetConfigValue(const YAML::Node& node, const std::string& key, ConfigNode& config); bool SetChildConfig(const YAML::Node& node, const std::string& name, ConfigNode& config); SetChildConfig(const YAML::Node& node, const std::string& child_name, ConfigNode& config); bool SetSequence(const YAML::Node& node, const std::string& child_name, ConfigNode& config); Loading
cpp/src/core/knowhere/knowhere/common/Config.h +4 −2 Original line number Diff line number Diff line Loading @@ -46,12 +46,14 @@ struct Cfg { const int64_t &k, const int64_t &gpu_id, METRICTYPE type) : d(dim), k(k), gpu_id(gpu_id), metric_type(type) {} : metric_type(type), k(k), gpu_id(gpu_id), d(dim) {} Cfg() = default; virtual bool CheckValid(){}; CheckValid(){ return true; }; }; using Config = std::shared_ptr<Cfg>; Loading
cpp/src/core/knowhere/knowhere/common/Dataset.h +2 −2 Original line number Diff line number Diff line Loading @@ -127,10 +127,10 @@ class Dataset { //} private: SchemaPtr array_schema_; SchemaPtr tensor_schema_; std::vector<ArrayPtr> array_; SchemaPtr array_schema_; std::vector<TensorPtr> tensor_; SchemaPtr tensor_schema_; //Config meta_; }; Loading
cpp/src/core/knowhere/knowhere/index/vector_index/helpers/IndexParameter.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -25,9 +25,14 @@ namespace zilliz { namespace knowhere { faiss::MetricType GetMetricType(METRICTYPE &type) { if (type == METRICTYPE::L2) return faiss::METRIC_L2; if (type == METRICTYPE::IP) return faiss::METRIC_INNER_PRODUCT; if (type == METRICTYPE::INVALID) KNOWHERE_THROW_MSG("Metric type is invalid"); if (type == METRICTYPE::L2) { return faiss::METRIC_L2; } if (type == METRICTYPE::IP) { return faiss::METRIC_INNER_PRODUCT; } KNOWHERE_THROW_MSG("Metric type is invalid"); } Loading