您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vector_destroy函数代码示例

51自学网 2021-06-03 09:37:11
  C++
这篇教程C++ vector_destroy函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中vector_destroy函数的典型用法代码示例。如果您正苦于以下问题:C++ vector_destroy函数的具体用法?C++ vector_destroy怎么用?C++ vector_destroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了vector_destroy函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: list_devices

static int list_devices(void){	struct vector v;	vector_init(&v, sizeof(const char *));	if (fet_db_enum(add_fet_device, &v) < 0) {		pr_error("couldn't allocate memory");		vector_destroy(&v);		return -1;	}	printc("Devices supported by FET driver:/n");	namelist_print(&v);	vector_destroy(&v);	vector_init(&v, sizeof(const char *));	if (fet_olimex_db_enum(add_fet_olimex_device, &v) < 0) {		pr_error("couldn't allocate memory");		vector_destroy(&v);		return -1;	}	printc("/n");	printc("Devices supported by Olimex FET driver:/n");	namelist_print(&v);	vector_destroy(&v);	return 0;}
开发者ID:zcsahok,项目名称:mspdebug,代码行数:29,


示例2: cvector_read_moments

int cvector_read_moments(complex_t *scnd, complex_t *thrd, complex_t *frth, vector_t *vec, complex_t org){  int n;  vector_t *moment, *diff;  assert(scnd);  assert(thrd);  assert(frth);  assert(vec);  moment = vector_new_and_copy(vec);  diff = vector_new_and_copy(vec);  cvector_copy_cvector_subtract_scalar(diff, vec, org);  cvector_copy_cvector_multiply_cvector(moment, diff, diff);  n = vector_get_dimension(vec);  *scnd = cvector_get_sum(moment);  scnd->real /= (real_t)n, scnd->imag /= (real_t)n;  cvector_multiply_cvector(moment, diff);  *thrd = cvector_get_sum(moment);  thrd->real /= (real_t)n, thrd->imag /= (real_t)n;  cvector_multiply_cvector(moment, diff);  *frth = cvector_get_sum(moment);  frth->real /= (real_t)n, frth->imag /= (real_t)n;  vector_destroy(diff);  vector_destroy(moment);  return n;}
开发者ID:fadhinata,项目名称:imagetool,代码行数:30,


示例3: ivector_read_moments

int ivector_read_moments(real_t *scnd, real_t *thrd, real_t *frth, vector_t *vec, real_t org){  vector_t *moment, *diff;  assert(scnd);  assert(thrd);  assert(frth);  assert(vec);  moment = vector_new_and_copy(vec);  diff = vector_new_and_copy(vec);  ivector_copy_ivector_subtract_scalar(diff, vec, org);  ivector_copy_ivector_multiply_ivector(moment, diff, diff);  *scnd = ivector_get_sum(moment) / vector_get_dimension(moment);  ivector_multiply_ivector(moment, diff);  *thrd = ivector_get_sum(moment) / vector_get_dimension(moment);  ivector_multiply_ivector(moment, diff);  *frth = ivector_get_sum(moment) / vector_get_dimension(moment);  vector_destroy(diff);  vector_destroy(moment);  return vector_get_dimension(vec);}
开发者ID:fadhinata,项目名称:imagetool,代码行数:25,


示例4: main

intmain(int argc, char **argv){  const int n = 3;  // init our vectors of size n  struct vector *x = vector_create(n);  struct vector *y = vector_create(n);  struct vector *z = vector_create(n);  struct vector *z_ref = vector_create(n);  // initialize values for testing  for (int i = 0; i < n; i++) {    VEC(x, i) = i + 1.f;    VEC(y, i) = i + 2.f;    VEC(z_ref, i) = 2*i + 3.f;  }  // test the vector_add()  vector_add(x, y, z);  // and make sure it equals the reference result  assert(vector_is_equal(z, z_ref));  // clean up  vector_destroy(x);  vector_destroy(y);  vector_destroy(z);  vector_destroy(z_ref);  return 0;}
开发者ID:hitchiker42,项目名称:my-code,代码行数:32,


示例5: mtsFreeWork

/* free the memory used by the vetting structure */voidmtsFreeWork (vetting_t ** w){  vetting_t *work = (*w);  if (work->desired.X != -SPECIAL || work->desired.Y != -SPECIAL)    {       heap_free (work->untested.h, free);       heap_destroy (&work->untested.h);       heap_free (work->no_fix.h, free);       heap_destroy (&work->no_fix.h);       heap_free (work->no_hi.h, free);       heap_destroy (&work->no_hi.h);       heap_free (work->hi_candidate.h, free);       heap_destroy (&work->hi_candidate.h);    }  else    {       while (!vector_is_empty (work->untested.v))         free (vector_remove_last (work->untested.v));       vector_destroy (&work->untested.v);       while (!vector_is_empty (work->no_fix.v))         free (vector_remove_last (work->no_fix.v));       vector_destroy (&work->no_fix.v);       while (!vector_is_empty (work->no_hi.v))         free (vector_remove_last (work->no_hi.v));       vector_destroy (&work->no_hi.v);       while (!vector_is_empty (work->hi_candidate.v))         free (vector_remove_last (work->hi_candidate.v));       vector_destroy (&work->hi_candidate.v);    }  free (work);  (*w) = NULL;}
开发者ID:bert,项目名称:pcb-rnd,代码行数:34,


示例6: test_prepend

/* * Unit test for the vector_prepend function. Runs some example * operations and checks that results are as expected, writing * messages to the terminal so that errors can be detected and * pinpointed. * * /return zero on success. */int test_prepend (void){  Vector vec;  int ii;    printf ("/nrunning test_prepend.../n");    vector_init (&vec);  printf ("initialized: ");  vector_dump (&vec);    for (ii = -3; ii < 10; ++ii) {    if (0 != vector_prepend (&vec, ii)) {      printf ("test_prepend ERROR: could not prepend %d/n", ii);      vector_destroy (&vec);      return -1;    }    printf ("prepended %2d: ", ii);    vector_dump (&vec);  }    for (ii = 0; ii < 13; ++ii)    if (vec.arr[ii] != 9-ii) {      printf ("test_prepend ERROR: arr[%d] should be %d but is %d/n", ii, 9-ii, vec.arr[ii]);      vector_destroy (&vec);      return -1;    }    printf ("test_prepend SUCCESS/n");    vector_destroy (&vec);  return 0;}
开发者ID:poftwaresatent,项目名称:da4002,代码行数:41,


示例7: torrent_cleanup

/** * Clean up torrent context by freeing all dynamically  * allocated memory. */void torrent_cleanup(torrent_ctx *ctx){  assert(ctx);  vector_destroy(&ctx->blocks_hashes.blocks);  vector_destroy(&ctx->files);  free(ctx->program_name);  free(ctx->announce);  ctx->announce = ctx->program_name = 0;  str_free(ctx->torrent);}
开发者ID:StevenSunzh,项目名称:sheshouyingyin,代码行数:14,


示例8: call_destroy

voidcall_destroy(sip_call_t *call){    // Remove all call messages    vector_destroy(call->msgs);    // Remove all call streams    vector_destroy(call->streams);    // Remove all call attributes    vector_destroy(call->attrs);    // Remove all call rtp packets    vector_destroy(call->rtp_packets);    // Deallocate call memory    sng_free(call);}
开发者ID:jungle-boogie,项目名称:sngrep,代码行数:14,


示例9: vector_resize

void vector_resize(struct Vector * vector) {  void * new_storage;  int new_length;  if (vector->population == vector->length) {    new_length = vector->length * 2;    new_storage = realloc(vector->storage, sizeof(void *) * vector->length * 2);  } else if ((float)vector->population/(float)vector->length < 0.25) {    new_length = vector->length / 2;    new_storage = realloc(vector->storage, sizeof(void *) * vector->length / 2);  } else {    return;  }  /* not sure if this is morally correct. On one hand, the system has no more     memory to give. On the other, such a trivial error should not bring down     the program. Comments? */  if (new_storage == NULL) {    vector_destroy(vector);    fprintf(stderr, "could not allocate more memory for vector. Sorry/n");    exit (1);  }  vector->storage = new_storage;  vector->length = new_length;}
开发者ID:ox,项目名称:vector,代码行数:26,


示例10: main

intmain(int argc, char **argv){  MPI_Init(&argc, &argv);  libmrc_params_init(argc, argv);  struct vector *vec = vector_create(MPI_COMM_WORLD);  vector_set_from_options(vec);  vector_setup(vec);  vector_view(vec);  int nr_elements;  vector_get_param_int(vec, "nr_elements", &nr_elements);  for (int i = 0; i < nr_elements; i++) {    vector_set_element(vec, i, 2. * i);  }  for (int i = 0; i < nr_elements; i++) {    assert(vector_get_element(vec, i) == 2. * i);  }  vector_destroy(vec);  MPI_Finalize();}
开发者ID:ALaDyn,项目名称:psc,代码行数:26,


示例11: main

int main() {    struct vector_t myVector, secondVector;    vector_init(&myVector);    vector_push_back(&myVector,3);    vector_push_back(&myVector,1);    vector_push_back(&myVector,4);    vector_push_back(&myVector,1);    vector_push_back(&myVector,5);    vector_push_back(&myVector,9);    vector_push_back(&myVector,2);    vector_push_back(&myVector,6);    vector_copy(&myVector, &secondVector);    printf("Size of copied vector: %d/n", vector_get_size(secondVector));    printf("Size: %d/n", vector_get_size(myVector));    printf("Pop: %d/n", vector_pop_back(&myVector));    printf("Pop: %d/n", vector_pop_back(&myVector));    printf("Pop: %d/n", vector_pop_back(&myVector));    printf("Pop: %d/n", vector_pop_back(&myVector));    printf("Pop: %d/n", vector_pop_back(&myVector));    printf("Size: %d/n", vector_get_size(myVector));    printf("Pop: %d/n", vector_pop_back(&myVector));    printf("Pop: %d/n", vector_pop_back(&myVector));    printf("Pop: %d/n", vector_pop_back(&myVector));    printf("Size: %d/n", vector_get_size(myVector));    vector_destroy(&myVector);    return 0;}
开发者ID:EvtimPavlov,项目名称:c-programming-2014-2015-homework,代码行数:32,


示例12: main

int main(int argc, char **argv){	vector *c = NULL;	int v1 = 4;	int v2 = 1;	int v3 = 3;	int v4 = 2;	int v5 = 16;	int v6 = 9;	int v7 = 10;	int v8 = 14;	int v9 = 8;	int v10 = 7;	c = vector_create();		c->push(c, (void *)(&v1 ));	c->push(c, (void *)(&v2 ));	c->push(c, (void *)(&v3 ));	c->push(c, (void *)(&v4 ));	c->push(c, (void *)(&v5 ));	c->push(c, (void *)(&v6 ));	c->push(c, (void *)(&v7 ));	c->push(c, (void *)(&v8 ));	c->push(c, (void *)(&v9 ));	c->push(c, (void *)(&v10));	Print(c, visit);	make_heap(c, compare);	Print(c, visit);	printf("/n===============================/n");	heap_sort(c, compare);	Print(c, visit);	vector_destroy(&c, NULL);	return 0;}
开发者ID:zhangzewen,项目名称:Algorithms,代码行数:34,


示例13: cmd_help

int cmd_help(char **arg){	const char *topic = get_arg(arg);	if (topic) {		struct cmddb_record cmd;		struct opdb_key key;		if (!cmddb_get(topic, &cmd)) {			printc("/x1b[1mCOMMAND: %s/x1b[0m/n/n%s/n",			       cmd.name, cmd.help);			return 0;		}		if (!opdb_get(topic, &key, NULL)) {			printc("/x1b[1mOPTION: %s (%s)/x1b[0m/n/n%s/n",			       key.name, type_text(key.type), key.help);			return 0;		}		printc_err("help: unknown command: %s/n", topic);		return -1;	} else {		struct vector v;		vector_init(&v, sizeof(const char *));		if (!cmddb_enum(push_command_name, &v)) {			printc("Available commands:/n");			namelist_print(&v);			printc("/n");		} else {			pr_error("help: can't allocate memory for command list");		}		vector_realloc(&v, 0);		if (!opdb_enum(push_option_name, &v)) {			printc("Available options:/n");			namelist_print(&v);			printc("/n");		} else {			pr_error("help: can't allocate memory for option list");		}		vector_destroy(&v);		printc("Type /"help <topic>/" for more information./n");		printc("Use the /"opt/" command (/"help opt/") to set "			"options./n");#if defined(__Windows__) && !defined(USE_READLINE)		printc("Press Ctrl+Z, Enter to quit./n");#else		printc("Press Ctrl+D to quit./n");#endif	}	return 0;}
开发者ID:noccy80,项目名称:mspdebug,代码行数:59,


示例14: mnist_images_destroy

void mnist_images_destroy(mnist_images_t images) {    assert(images);    for (size_t i = 0; i < images->size; i++) {        vector_destroy(images->imgs[i]);    }    Free(images);}
开发者ID:kkudrolli,项目名称:Team-SDK-545,代码行数:8,


示例15: tcas_renderer_fin

static void tcas_renderer_fin(TcasStPtr pTcas) {    if (pTcas->indexStreams)        vector_destroy(pTcas->indexStreams);    pTcas->indexStreams = NULL;    if (pTcas->chunksCache.streamCount > 0)        libtcas_free_chunks_cache(&pTcas->chunksCache);    libtcas_close_file(&pTcas->file);}
开发者ID:Lichtavat,项目名称:TCAX,代码行数:8,


示例16: test4

void test4(void){    vector_t vec = vector_from_string_list(NULL_VECTOR, "1920x1080,1280x720,720x576,720x480,704x576", NULL);    vector_foreach(vec, test4_walker, NULL);    printf("size: %d, capacity: %d/n", vector_size(vec), vector_capacity(vec));    vector_clear(vec);    vector_destroy(vec);}
开发者ID:varphone,项目名称:libgcontainers,代码行数:8,


示例17: main

int main() {	struct vector_t vec;	struct vector_t vec2;	int i;	printf("Original vector test/n");	vector_init(&vec);	printf("Pushing into vector/n");	for(i=0; i<10; i++)	{		vector_push_back(&vec, i);		printf("Index: %d/n", vector_get_size(vec));	}	printf("Popping out of vector/n");	for(i=0; i<10; i++)	{		vector_pop_back(&vec);		printf("Index: %d/n", vector_get_size(vec));	}	vector_copy(&vec, &vec2);	vector_destroy(&vec);	printf("Copied vector test/n");	printf("Pushing in vector/n");	for(i=0; i<10; i++)	{		vector_push_back(&vec2, i);		printf("Index: %d/n", vector_get_size(vec2));	}	printf("Popping out of vector/n");	for(i=0; i<10; i++)	{		vector_pop_back(&vec2);		printf("Index: %d/n", vector_get_size(vec2));	}		vector_destroy(&vec2);return 0;}
开发者ID:EvtimPavlov,项目名称:c-programming-2014-2015-homework,代码行数:46,


示例18: capture_deinit

voidcapture_deinit(){    // Close pcap handler    capture_close();    // Deallocate vectors    vector_set_destroyer(capture_cfg.sources, vector_generic_destroyer);    vector_destroy(capture_cfg.sources);    vector_set_destroyer(capture_cfg.tcp_reasm, packet_destroyer);    vector_destroy(capture_cfg.tcp_reasm);    vector_set_destroyer(capture_cfg.ip_reasm, packet_destroyer);    vector_destroy(capture_cfg.ip_reasm);    // Remove capture mutex    pthread_mutex_destroy(&capture_cfg.lock);}
开发者ID:cruzccl,项目名称:sngrep,代码行数:17,


示例19: pptp_conn_open

/* Open new pptp_connection.  Returns NULL on failure. */PPTP_CONN * pptp_conn_open(int inet_sock, int isclient, pptp_conn_cb callback){    PPTP_CONN *conn;    /* Allocate structure */    if ((conn = malloc(sizeof(*conn))) == NULL) return NULL;    if ((conn->call = vector_create()) == NULL) { free(conn); return NULL; }    /* Initialize */    conn->inet_sock = inet_sock;    conn->conn_state = CONN_IDLE;    conn->ka_state  = KA_NONE;    conn->ka_id     = 1;    conn->call_serial_number = 0;    conn->callback  = callback;    /* Create I/O buffers */    conn->read_size = conn->write_size = 0;    conn->read_alloc = conn->write_alloc = INITIAL_BUFSIZE;    conn->read_buffer =        malloc(sizeof(*(conn->read_buffer)) * conn->read_alloc);    conn->write_buffer =        malloc(sizeof(*(conn->write_buffer)) * conn->write_alloc);    if (conn->read_buffer == NULL || conn->write_buffer == NULL) {        if (conn->read_buffer  != NULL) free(conn->read_buffer);        if (conn->write_buffer != NULL) free(conn->write_buffer);        vector_destroy(conn->call); free(conn); return NULL;    }    /* Make this socket non-blocking. */    fcntl(conn->inet_sock, F_SETFL, O_NONBLOCK);    /* Request connection from server, if this is a client */    if (isclient) {        struct pptp_start_ctrl_conn packet = {            PPTP_HEADER_CTRL(PPTP_START_CTRL_CONN_RQST),            hton16(PPTP_VERSION), 0, 0,             hton32(PPTP_FRAME_CAP), hton32(PPTP_BEARER_CAP),            hton16(PPTP_MAX_CHANNELS), hton16(PPTP_FIRMWARE_VERSION),             PPTP_HOSTNAME, PPTP_VENDOR        };        /* fix this packet, if necessary */        int idx, rc;        idx = get_quirk_index();        if (idx != -1 && pptp_fixups[idx].start_ctrl_conn) {            if ((rc = pptp_fixups[idx].start_ctrl_conn(&packet)))                warn("calling the start_ctrl_conn hook failed (%d)", rc);        }        if (pptp_send_ctrl_packet(conn, &packet, sizeof(packet)))            conn->conn_state = CONN_WAIT_CTL_REPLY;        else            return NULL; /* could not send initial start request. */    }    /* Set up interval/keep-alive timer */    /*   First, register handler for SIGALRM */    sigpipe_create();    sigpipe_assign(SIGALRM);    global.conn = conn;    /* Reset event timer */    pptp_reset_timer();    /* all done. */    return conn;}
开发者ID:a170785,项目名称:buildroot,代码行数:59,


示例20: get_heading

 int get_heading (data_t* data) {    // Initialize heading value -  it's an integer because it is    // going to eventually be binned into North, South, East, or West    vector north, east, mag_vector, accel_vector, from;    int heading;    // Initialize north and east vectors    vector_init(&north, 0, 0, 0);    vector_init(&east, 0, 0, 0);    // Put magnetometer and accelerometer data into vector format    vector_init(&mag_vector, data->Mx, data->My, data-> Mz);    vector_init(&accel_vector, data->Ax, data->Ay, data-> Az);    // Initialize "from" vector based on carrier board design    vector_init(&from, 1, 0, 0);    // Subtract calibration offset from magnetometer readings    mag_vector.x -= ((float) MAG_MAX_X + MAG_MIN_X) / 2.0;    mag_vector.y -= ((float) MAG_MAX_Y + MAG_MIN_Y) / 2.0;    mag_vector.z -= ((float) MAG_MAX_Z + MAG_MIN_Z) / 2.0;    // Compute East and North    vector_cross(&mag_vector, &accel_vector, &east);    vector_norm(&east);    vector_cross(&accel_vector, &east, &north);    vector_norm(&north);    // Compute the heading and make sure it's positive    heading = (int)(atan2(vector_dot(&east, &from), vector_dot(&north, &from))* 180 / PI);    if (heading < 0) {        heading += 360;    }    // Memory cleanup    vector_destroy(&north);    vector_destroy(&east);    vector_destroy(&mag_vector);    vector_destroy(&accel_vector);    vector_destroy(&from);    return heading; }
开发者ID:ricearcane,项目名称:ti_contest,代码行数:45,


示例21: test1

void test1(void){    vector_t vec = vector_create2(0, 4);    int value = 1;    for (int i = 0; i < 1000; i++)        vector_push_back(vec, &value);    vector_foreach(vec, test1_walker, NULL);    vector_destroy(vec);}
开发者ID:varphone,项目名称:libgcontainers,代码行数:9,


示例22: watchfile_destroy

static void watchfile_destroy(void){  for (int i = 0; i < watchfile_entries.size; ++i) {    struct watchfile_entry *entry = vector_at(&watchfile_entries, i);    free(entry->name);    adex_destroy(&entry->adex);  }  vector_destroy(&watchfile_entries);}
开发者ID:glankk,项目名称:gz,代码行数:9,


示例23: vector_free

/** * free the vector * @param vec the vector to free */void vector_free(vector_t * vec){#ifdef DEBUG    assert(NULL != vec);#endif    vector_destroy(vec);    free(vec);}
开发者ID:jeffdn,项目名称:srv,代码行数:13,


示例24: test__type_get_varg_value__cstl_builtin

void test__type_get_varg_value__cstl_builtin(void** state){    _typeinfo_t t_info;    size_t i = 0;    vector_t* pvec_result = create_vector(int);    vector_t* pvec_input = create_vector(int);    _test__get_type(&t_info, "vector_t");    t_info._t_style = _TYPE_CSTL_BUILTIN;    vector_init(pvec_result);    vector_init_elem(pvec_input, 10, 100);    _test__type_get_varg_value__stub(pvec_result, &t_info, pvec_input);    assert_true(vector_size(pvec_result) == 10);    for (i = 0; i < 10; ++i) {        assert_true(*(int*)vector_at(pvec_result, i) == 100);    }    vector_destroy(pvec_result);    vector_destroy(pvec_input);}
开发者ID:Aluonna,项目名称:libcstl,代码行数:18,


示例25: media_destroyer

voidmedia_destroyer(void *item){    sdp_media_t *media = (sdp_media_t *) item;    if (!item)        return;    vector_destroy(media->formats);    sng_free(media);}
开发者ID:cukupupas,项目名称:sngrep,代码行数:9,


示例26: read_images

/* * read_images: Reads the images from and mnist image db file and puts the *              images into and array of vectors. * * Parameters: *  - train: boolean value, read from training db if 0, test db if 1 * * Return value: *  - array of vectors containing mnist images */ mnist_images_t read_images(uint32_t train){    // Set the filename based the mode (train or test)    char *full_path;    if (train) {        full_path = concat_fname(mnist_path, train_image_fname);    } else {        full_path = concat_fname(mnist_path, test_image_fname);    }    // Open the file for reading    char *mode = FILE_MODE;    FILE *fp = Fopen(full_path, mode);     // Read the header of the file    uint8_t header[IMAGE_HEADER_SIZE];    Fread(header, sizeof(uint8_t), IMAGE_HEADER_SIZE, fp);    // Extract size info from mnist db header    uint32_t num_images = read_word(header, NUM_ITEMS_OFFSET);    uint32_t rows = read_word(header, ROW_OFFSET);    uint32_t cols = read_word(header, COL_OFFSET);    uint32_t img_size = rows * cols;    // Create array of mnist image vectors    vector_t *mnist_data = (vector_t*) Calloc(num_images, sizeof(vector_t));        // Populate vectors with one image each    for (uint32_t i = 0; i < num_images; i++) {        mnist_data[i] = Vector((size_t) img_size);        uint8_t *image_bytes = (uint8_t*) Calloc(img_size, sizeof(uint8_t));        uint32_t actual_size;        // Read img_size bytes from the db file into the byte array        if ((actual_size = fread(image_bytes, sizeof(uint8_t), img_size, fp)) < img_size) {            Free(image_bytes);            for (uint32_t i = 0; i < num_images; i++) vector_destroy(mnist_data[i]);            return NULL;        }        // Move 8 bit data to 32 bit integer for more precision        uint32_t *vector_data = (uint32_t*) Calloc(img_size, sizeof(uint32_t));        for (uint32_t j = 0; j < img_size; j++) {            vector_data[j] = (uint32_t) image_bytes[j];        }        mnist_data[i]->data = vector_data;        Free(image_bytes);    }    // Create the mnist_images_t pointer and populate the struct it points to    mnist_images_t mnist_imgs = Mnist_images((size_t) num_images);     mnist_imgs->imgs = mnist_data;    Free(full_path);    Fclose(fp);    return mnist_imgs;}
开发者ID:kkudrolli,项目名称:Team-SDK-545,代码行数:67,


示例27: BM_VectorDestroy

static void BM_VectorDestroy(benchmark::State& state){    vector_t * vector = NULL;    while(state.KeepRunning())    {        vector = vector_new(sizeof(int));        vector_destroy(vector);    }}
开发者ID:tibabit,项目名称:ccollection,代码行数:9,


示例28: del_value

void del_value(values *v, const char *key) {	vector *values_set;	if (hash_get(v, key, (void**)(&values_set)) == ERR_HASH_NOTFOUND) {		return;	}		vector_destroy(values_set);	return;}
开发者ID:mlmhl,项目名称:cWeb,代码行数:9,


示例29: test__create_vector__registed_type

void test__create_vector__registed_type(void** state){    typedef struct _tag__create_vector__registed_type{int n_elem;}_create_vector__registed_type_t;    vector_t* pvec = NULL;    type_register(_create_vector__registed_type_t, NULL, NULL, NULL, NULL);    pvec = _create_vector("_create_vector__registed_type_t");    assert_true(pvec != NULL);    vector_destroy(pvec);}
开发者ID:cffyh,项目名称:libcstl,代码行数:9,


示例30: hashtbl_destroy

void hashtbl_destroy(hashtbl_t *h) {  if (!h) return;  for (size_t i = 0; i < h->bktnum; ++i) {    if (h->buckets[i]) {      vector_destroy(h->buckets[i]);    }  }  free(h->buckets);  free(h);}
开发者ID:rodolf0,项目名称:natools,代码行数:10,



注:本文中的vector_destroy函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ vector_dot函数代码示例
C++ vector_delete函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。