MCPcopy Create free account
hub / github.com/alibaba/zvec / create_test_vector

Function create_test_vector

examples/c/optimized_example.c:39–50  ·  view source on GitHub ↗

* @brief Create test vector data */

Source from the content-addressed store, hash-verified

37 * @brief Create test vector data
38 */
39static float *create_test_vector(size_t dimension) {
40 float *vector = malloc(dimension * sizeof(float));
41 if (!vector) {
42 return NULL;
43 }
44
45 for (size_t i = 0; i < dimension; i++) {
46 vector[i] = (float)rand() / (float)RAND_MAX;
47 }
48
49 return vector;
50}
51
52/**
53 * @brief Optimized C API usage example with performance considerations

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected