MCPcopy Create free account
hub / github.com/dmlc/xgboost / MakeArrayInterface

Function MakeArrayInterface

demo/c-api/basic/c-api-demo.c:25–31  ·  view source on GitHub ↗

Make Json encoded array interface. */

Source from the content-addressed store, hash-verified

23
24/* Make Json encoded array interface. */
25static void MakeArrayInterface(size_t data, size_t n, char const* typestr, size_t length,
26 char* out) {
27 static char const kTemplate[] =
28 "{\"data\": [%lu, true], \"shape\": [%lu, %lu], \"typestr\": \"%s\", \"version\": 3}";
29 memset(out, '\0', length);
30 sprintf(out, kTemplate, data, n, 1ul, typestr);
31}
32/* Make Json encoded DMatrix configuration. */
33static void MakeConfig(int n_threads, size_t length, char* out) {
34 static char const kTemplate[] = "{\"missing\": NaN, \"nthread\": %d}";

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected