aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/tensor/random_level_generator.h
blob: dae94c7d9fe8a46332510a56d9b5b68f6e05d35f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <memory>

namespace search::tensor {

/**
 * Interface used to randomly draw the max level a new hnsw node should exist in.
 */
class RandomLevelGenerator {
public:
    using UP = std::unique_ptr<RandomLevelGenerator>;
    virtual ~RandomLevelGenerator() {}
    virtual uint32_t max_level() = 0;
};

}