Treelite
gtil.h
Go to the documentation of this file.
1 
10 #ifndef TREELITE_GTIL_H_
11 #define TREELITE_GTIL_H_
12 
13 #include <cstddef>
14 
15 namespace treelite {
16 
17 class Model;
18 class DMatrix;
19 
20 namespace gtil {
21 
22 // Predict with a DMatrix (can be sparse or dense)
23 std::size_t Predict(const Model* model, const DMatrix* input, float* output,
24  bool pred_transform = true);
25 // Predict with 2D dense matrix
26 std::size_t Predict(const Model* model, const float* input, std::size_t num_row, float* output,
27  bool pred_transform = true);
28 
29 // Query functions to allocate correct amount of memory for the output
30 std::size_t GetPredictOutputSize(const Model* model, std::size_t num_row);
31 std::size_t GetPredictOutputSize(const Model* model, const DMatrix* input);
32 
33 } // namespace gtil
34 } // namespace treelite
35 
36 #endif // TREELITE_GTIL_H_