Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpp/include/cuvs/cluster/agglomerative.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ struct distance_params {
/** Specialized parameters to build the Mutual Reachability graph */
struct mutual_reachability_params {
/** this neighborhood will be selected for core distances. */
int min_samples;
int min_samples = 5;

/** weight applied when internal distance is chosen for mutual reachability (value of 1.0 disables
* the weighting) */
Expand Down
8 changes: 4 additions & 4 deletions cpp/include/cuvs/distance/distance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ enum KernelType { LINEAR, POLYNOMIAL, RBF, TANH };
*/
struct KernelParams {
// Kernel function parameters
KernelType kernel; //!< Type of the kernel function
int degree; //!< Degree of polynomial kernel (ignored by others)
double gamma; //!< multiplier in the
double coef0; //!< additive constant in poly and tanh kernels
KernelType kernel = KernelType::LINEAR; //!< Type of the kernel function
int degree = 3; //!< Degree of polynomial kernel (ignored by others)
double gamma = 1.0; //!< multiplier in the
double coef0 = 0.0; //!< additive constant in poly and tanh kernels
};
} // end namespace kernels

Expand Down
18 changes: 9 additions & 9 deletions cpp/include/cuvs/distance/grammian.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ using csr_input_matrix_view_t = raft::device_csr_matrix_view<const math_t, int,
template <typename math_t>
class GramMatrixBase {
protected:
cublasHandle_t cublas_handle;
cublasHandle_t cublas_handle = nullptr;
bool legacy_interface;

public:
GramMatrixBase() : legacy_interface(false) {};
GramMatrixBase() : legacy_interface(false) {}
[[deprecated]] GramMatrixBase(cublasHandle_t cublas_handle)
: cublas_handle(cublas_handle), legacy_interface(true) {};
: cublas_handle(cublas_handle), legacy_interface(true) {}

virtual ~GramMatrixBase() {};
virtual ~GramMatrixBase() = default;

/** Convenience function to evaluate the Gram matrix for two vector sets.
* Vector sets are provided in Matrix format
Expand Down Expand Up @@ -320,10 +320,10 @@ class PolynomialKernel : public GramMatrixBase<math_t> {
* @param offset
*/
PolynomialKernel(exp_t exponent, math_t gain, math_t offset)
: GramMatrixBase<math_t>(), exponent(exponent), gain(gain), offset(offset) {};
: GramMatrixBase<math_t>(), exponent(exponent), gain(gain), offset(offset) {}

[[deprecated]] PolynomialKernel(exp_t exponent, math_t gain, math_t offset, cublasHandle_t handle)
: GramMatrixBase<math_t>(handle), exponent(exponent), gain(gain), offset(offset) {};
: GramMatrixBase<math_t>(handle), exponent(exponent), gain(gain), offset(offset) {}

/** Evaluate kernel matrix using polynomial kernel.
*
Expand Down Expand Up @@ -436,7 +436,7 @@ class TanhKernel : public GramMatrixBase<math_t> {
TanhKernel(math_t gain, math_t offset) : GramMatrixBase<math_t>(), gain(gain), offset(offset) {}

[[deprecated]] TanhKernel(math_t gain, math_t offset, cublasHandle_t handle)
: GramMatrixBase<math_t>(handle), gain(gain), offset(offset) {};
: GramMatrixBase<math_t>(handle), gain(gain), offset(offset) {}

/** Evaluate kernel matrix using tanh kernel.
*
Expand Down Expand Up @@ -551,10 +551,10 @@ class RBFKernel : public GramMatrixBase<math_t> {
* @tparam math_t floating point type
* @param gain
*/
RBFKernel(math_t gain) : GramMatrixBase<math_t>(), gain(gain) {};
RBFKernel(math_t gain) : GramMatrixBase<math_t>(), gain(gain) {}

[[deprecated]] RBFKernel(math_t gain, cublasHandle_t handle)
: GramMatrixBase<math_t>(handle), gain(gain) {};
: GramMatrixBase<math_t>(handle), gain(gain) {}

void matrixRowNormL2(raft::resources const& handle,
dense_input_matrix_view_t<math_t> matrix,
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/cuvs/neighbors/ball_cover.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ struct index : cuvs::neighbors::index {
raft::device_matrix<float, int64_t, raft::row_major> X_reordered;

protected:
bool index_trained;
bool index_trained = false;
};

/** @} */
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cuvs/neighbors/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ namespace filtering {
enum class FilterType { None, Bitmap, Bitset };

struct base_filter {
~base_filter() = default;
virtual ~base_filter() = default;
virtual FilterType get_filter_type() const = 0;
};

Expand Down Expand Up @@ -975,7 +975,7 @@ struct mg_index {
auto operator=(mg_index&&) -> mg_index& = default;

distribution_mode mode_;
int num_ranks_;
int num_ranks_ = 0;
std::vector<iface<AnnIndexType, T, IdxT>> ann_interfaces_;

// for load balancing mechanism
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/cuvs/neighbors/hnsw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ void extend(raft::resources const& res,
*/

struct search_params : cuvs::neighbors::search_params {
int ef; // size of the candidate list
int ef = 200; // size of the candidate list
int num_threads = 0; // number of host threads to use for concurrent searches. Value of 0
// automatically maximizes parallelism
};
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cuvs/neighbors/vamana.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ namespace cuvs::neighbors::vamana {
*/
template <typename T = float>
struct codebook_params {
int pq_codebook_size;
int pq_dim;
int pq_codebook_size = 0;
int pq_dim = 0;
std::vector<T> pq_encoding_table;
std::vector<T> rotation_matrix;
};
Expand Down
8 changes: 4 additions & 4 deletions cpp/include/cuvs/preprocessing/spectral_embedding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ namespace cuvs::preprocessing::spectral_embedding {
*/
struct params {
/** @brief The number of components to reduce the data to. */
int n_components;
int n_components = 2;

/** @brief The number of neighbors to use for the nearest neighbors graph. */
int n_neighbors;
int n_neighbors = 15;

/**
* @brief Whether to normalize the Laplacian matrix.
Expand All @@ -36,7 +36,7 @@ struct params {
* If false, uses the unnormalized graph Laplacian (L = D - W).
* Normalized Laplacian often leads to better results for clustering tasks.
*/
bool norm_laplacian;
bool norm_laplacian = true;

/**
* @brief Whether to drop the first eigenvector.
Expand All @@ -45,7 +45,7 @@ struct params {
* uninformative. Setting this to true drops it from the embedding.
* This is typically set to true when norm_laplacian is true.
*/
bool drop_first;
bool drop_first = true;

/**
* @brief Tolerance for the eigenvalue solver.
Expand Down