9 #ifndef TREELITE_C_API_COMMON_H_ 10 #define TREELITE_C_API_COMMON_H_ 13 #define TREELITE_EXTERN_C extern "C" 17 #define TREELITE_EXTERN_C 23 #if defined(_MSC_VER) || defined(_WIN32) 24 #define TREELITE_DLL TREELITE_EXTERN_C __declspec(dllexport) 26 #define TREELITE_DLL TREELITE_EXTERN_C 63 const char* path,
const char* format,
const char* data_type,
int nthread,
int verbose,
77 const void* data,
const char* data_type,
const uint32_t* col_ind,
const size_t* row_ptr,
90 const void* data,
const char* data_type,
size_t num_row,
size_t num_col,
113 #endif // TREELITE_C_API_COMMON_H_ int TreeliteRegisterLogCallback(void(*callback)(const char *))
register callback function for LOG(INFO) messages – helpful messages that are not errors...
int TreeliteDMatrixFree(DMatrixHandle handle)
delete DMatrix from memory
int TreeliteDMatrixCreateFromCSR(const void *data, const char *data_type, const uint32_t *col_ind, const size_t *row_ptr, size_t num_row, size_t num_col, DMatrixHandle *out)
create DMatrix from a (in-memory) CSR matrix
int TreeliteDMatrixCreateFromFile(const char *path, const char *format, const char *data_type, int nthread, int verbose, DMatrixHandle *out)
create a sparse DMatrix from a file
void * DMatrixHandle
handle to a data matrix
int TreeliteDMatrixGetDimension(DMatrixHandle handle, size_t *out_num_row, size_t *out_num_col, size_t *out_nelem)
get dimensions of a DMatrix
const char * TreeliteGetLastError(void)
display last error; can be called by multiple threads Note. Each thread will get the last error occur...
int TreeliteDMatrixCreateFromMat(const void *data, const char *data_type, size_t num_row, size_t num_col, const void *missing_value, DMatrixHandle *out)
create DMatrix from a (in-memory) dense matrix