void Engine::go(std::stringstream& stream){
    std::string command;
    init_search();
    stream>>command;
    while(command != ""){
        if(command == "wtime") stream>>wtime;
        else if(command == "btime") stream>>btime;
        else if(command == "winc") stream>>winc;
Exemple #2
0
void
init_diskload (void)
{
    init_search (DISK_STRING, DISK_STRING_LEN, diskavg_matrix);
    if ((diskavg_file = open ("/proc/stat", O_RDONLY)) == -1)
    {
        log_it ("CRON", getpid (), "STARTUP",
                "could not open /proc/stat. No disk busy waiting");
        return;
    };
    /* we have to call get_diskload() here because the first invocation does
     * not return any meaningful results.
     */
    (void) get_diskload (diskavg_file, diskavg_matrix);
}
Application::Application() {

    init_mersenne();
    init_direction_table();
    init_bitboards();
    init_uci_options();
    Position::init_zobrist();
    Position::init_piece_square_tables();
    init_eval(1);
    init_bitbases();
    init_search();
    init_threads();

    // Make random number generation less deterministic, for book moves
    for (int i = abs(get_system_time() % 10000); i > 0; i--)
        genrand_int32();
}
Exemple #4
0
void cb_main_kniha(int kniha) {
  int comment;
  char *s;
  int h, v, id;

  char* meno = GETSTR(KNIHA[kniha].meno);
  printf("\n\n<a name=\"%s\">\n", meno);

  init_search(meno);
  add_search(1, 1, -1, -1);
  do_search();

  h = 0; v = 0;
  while (get_result_id(&comment, &s, &id)) {
    if (!comment) {
      while (1) {
        // normalize h / v
        while (1) {
          if (h < 0 || h >= KNIHA[kniha].n_hlav) {
            h = -1;
            break;
          } else if (v >= GETPTR(hlava, KNIHA[kniha].hlava)[h].n_versov) {
            v = 0;
            h++;
          } else break;
        }
        if (h >= 0 &&
            GETPTR(vers, (GETPTR(hlava, KNIHA[kniha].hlava)[h].vers))[v].min <= id) {
          printf("<a name=\"%s%d,%d\">\n", meno, h + 1, v + 1);
          v++;
        } else break;
      }
      TranslateLinksAndPrint(s);
      printf("\n");
    } else {
      printf("<span id=\"e%d\" ", html_id);
      printf("class=\"komentar\">(");
      TranslateLinksAndPrint(s);
      printf(")</span>\n");
      html_id++;
    }
  }
}
Exemple #5
0
int modeCheck(int c,int recordSelected,int *cursorLeft,int *cursorArea, char *subject,Cursor *cursor,Area rArea,Record **hovered,struct RecordList **activeBuffer,  struct RecordList *RLBuffer) {
	int redraw = FALSE;
	if(commandMode(*cursorArea)) {
		if(KEY_MODE_RECORDS(c) || KEY_MODE_ESCAPE(c)) {
			redraw = check_record(cursorArea,hovered,activeBuffer,RLBuffer);
		}
		else if (KEY_MODE_ADD(c)) {
			redraw = init_add(cursorArea,cursor);
		}
		else if (KEY_MODE_SEARCH(c)){
			redraw = init_search(subject,cursor,cursorArea);
		}
		else if (KEY_MODE_EDIT(c)) {
			if(*hovered) redraw = init_edit(recordSelected,cursorLeft,cursorArea,cursor,rArea,*hovered,*activeBuffer);
		} else if(KEY_MODE_DELETE(c)) {
			if(*hovered) redraw = init_delete(recordSelected,cursorArea,*hovered,*activeBuffer);
		}
	}
	return redraw;
}
Exemple #6
0
/*use the set flat to build the search structure */
search* build_search(msg_one *flags) {
	search *mysearch; /*ptr to a structure holding the search request */
	int buffer_size;
	mysearch = NULL;
	init_search(&mysearch);
	if (mysearch == NULL)
		pthread_exit(NULL);
	/*set search for parameters for message 1*/
	mysearch->options_flags = ntohl(flags->options_flags);
	mysearch->max_dir_depth = ntohl(flags->max_dir_depth);
	buffer_size = ntohl(flags->line_buffer_size);
	if (buffer_size == -1)
		mysearch->line_buffer_size = DEFAULT_LINE_BUFFER;
	else
		mysearch->line_buffer_size = buffer_size;
	mysearch->max_line_number = ntohl(flags->max_line_number);
	mysearch->column_number = ntohl(flags->column_number);
	mysearch->thread_limits = ntohl(flags->thread_limits);
	return mysearch;
}
Exemple #7
0
void init_subsystems(){
 init_cal();
 init_cli_macro();
 init_clipboard();
 init_commandline();
 init_evilloop();
 init_exec_cmd();
 init_expanded();
 init_file();
 init_file_ascii();
 init_file_help();
 init_file_hnb();
 init_file_html();
 init_file_opml();
 init_file_ps();
 init_file_xml();
 init_go();
 init_insertbelow();
 init_keepstate();
 init_mem();
 init_movenode();
 init_nodetest();
 init_outdent_indent();
 init_prefs();
 init_query();
 init_quit();
 init_remove();
 init_search();
 init_sort();
 init_spell();
 init_stats();
 init_tree_todo();
 init_ui_binding();
 init_ui_cli();
 init_ui_draw();
 init_ui_edit();
 init_ui_menu();
 init_ui_overlay();
 init_ui_style();
}
Exemple #8
0
/*main function*/
int main(int argc, char *argv[]) {

	search *mysearch; /*ptr to a structure holding the search request */
	remote *rmt;
	Client_para *para;
	pthread_t id;
	int err, rmt_flag;
	char *temp;
	time_type t_start, t_end;
	double tdiff;
	/*initialization*/
	err = 0;
	rmt_flag = 0;
	mysearch = NULL;
	init_search(&mysearch);

	/* process all the command line switches */
	opterr = 0; /* prevent getopt() from printing error messages */
	scan_opt_search(argc, argv, mysearch); /*move the getopt to command_util.h to shorten the main */
	/*build the shift table*/
	build_shifttable(mysearch);
	/*
	 * if there is no argument in list of files
	 * directly go to stdin
	 */
	if (optind >= argc) {
		search_stream(stdin, NULL, mysearch, NULL);
		return 0;
	}
	get_time(&t_start);
	/* process the list of files*/
	for (; optind < argc; optind++) {
		/* if it a remote search */
		temp = argv[optind];
		/* if it is remote search and has been successfully parsed*/
		if ((rmt = scan_remote_search(temp, &rmt_flag)) != NULL) {
			if ((para = (Client_para*) malloc(sizeof(Client_para))) == NULL) {
				perror("malloc");
				continue;
			}
			para->mysearch = mysearch;
			para->rmt = rmt;
			/* spawn a thread the perform remote search*/
			// increment the stack count
			pthread_mutex_lock(&(mysearch->lock));
			err = pthread_create(&id, NULL, client_agent, (void*) para);
			mysearch->stk_count++;
			if (err != 0) {
				fprintf(stderr, "Pthread_create of client\n");
				free(para);
				mysearch->stk_count--;
				pthread_mutex_unlock(&(mysearch->lock));
				continue;
			}
			pthread_mutex_unlock(&(mysearch->lock));
			continue;
		} else if (rmt_flag == 1) {
			/* if a : used to appear there but has not been parsed, neglect it */
			continue;
		}
		if (strcmp(temp, STREAM_REDIRECT) == 0)
			/* "-" redirect the io to stdin*/
		{
			search_stream(stdin, NULL, mysearch, NULL);
			continue;
		}
		search_given(temp, mysearch);
	}
	/* wait all the thread to be done*/
	while (mysearch->stk_count != 0) {
		pthread_cond_wait(&(mysearch->ready), &(mysearch->lock));
	}
	get_time(&t_end);
	tdiff = time_diff(&t_start, &t_end);
	/* print the statistical result*/
	print_stat(stdout, &(mysearch->statistics), tdiff);
	destroy_search(mysearch);

	return 0;
} /* main */
Exemple #9
0
void Print(struct casti *_c) {
  char *k, *s;
  int vb, ve, hb, he, comment;
  struct casti *c;
  static struct strbuf q;

  Rst(&q);

  //nepekne: spoliehame sa, ze vsetko je z jednej knihy
  if (!_c) return;
  k = check_book(_c->k);
  if (!k) return;

  init_search(k);

  hb=vb=-1;
  he=ve=-1;
  for (c=_c; c!=NULL; c=c->n) {
    if (c->h!=-1) {
      hb = c->h;
      vb=-1;
    }
    if (c->v!=-1) vb = c->v;
    ve = vb;
    he = hb;
    if (c->range && c->n) {
      c=c->n;
      if (c->h!=-1) he = c->h;
      if (c->v!=-1) ve = c->v;
    }

    if (hb==-1) { hb = vb; vb = -1; }
    if (he==-1) { he = ve; ve = -1; }
    // zapiseme do kontextu
    if (first.h==-1) {
      first.h=hb;
      first.k=k;
    }
    if (hb!=kontext_last_hb || he!=kontext_last_he) {
      if (hb!=he) Prn(&kontext, ";%s%d-%d", k, hb,he);
      else Prn(&kontext, ";%s%d", k, hb);
      kontext_last_hb = hb; kontext_last_he = he;
    }

    add_search(hb,vb,he,ve);

    vb = ve;
    hb = he;
  }
  last.h = kontext_last_he;
  last.k = k;

  do_search();

  while (get_result(&comment, &s)) {
    if (!comment) printf("%s\n", s);
    else printf("<span class=\"komentar\">(%s)</span>\n", s);
  }
  free_search();

  // do not free k - it might be used in first/last
}
Exemple #10
0
int main()
{
	char *here;
	char *find_strings[] = {"abb",  "you", "not", "it", "dad", "yoo", "hoo",
		"oo", "oh", "xx", "xx", "x", "x", "field", "new", "row",
		"regime", "boom", "that", "impact", "and", "zoom", "texture",
		"magnet", "doom", "loom", "freq", "current", "phase",
		"images", 
		"appears", "phase", "conductor", "wavez", 
		"normal", "free", "termed",
		"provide", "for", "and", "struct", "about", "have",
		"proper",
		"involve",
		"describedly",
		"thats",
		"spaces",
		"circumstance",
		"the",
		"member",
		"such",
		"guide",
		"regard",
		"officers",
		"implement",
		"principalities",			      
		NULL};
	char *search_strings[] = {"cabbie", "your", "It isn't here",
		"But it is here", "hodad", "yoohoo", "yoohoo",
		"yoohoo", "yoohoo", "yoohoo", "xx", "x", ".", 
		"In recent years, the field of photonic ",
		"crystals has found new",
		"applications in the RF and microwave",
		"regime. A new type of metallic",
		"electromagnetic crystal has been", 
		"developed that is having a",
		"significant impact on the field of", 
		"antennas. It consists of a",
		"conductive surface, covered with a",
		"special texture which alters its",
		"electromagnetic properties. Made of solid",
		"metal, the structure",
		"conducts DC currents, but over a",
		"particular frequency range it does",
		"not conduct AC currents. It does not",
		"reverse the phase of reflected",
		"waves, and the effective image currents",

		"appear in-phase, rather than",
		"out-of-phase as they are on normal",
		"conductors. Furthermore, surface",
		"waves do not propagate, and instead",
		"radiate efficiently into free",
		"space. This new material, termed a",
		"high-impedance surface, provides",
		"a useful new ground plane for novel",
		"low-profile antennas and other",
		"electromagnetic structures.",
		"The recent protests about the Michigamua",
		"student organization have raised an",
		"important question as to the proper nature",
		"and scope of University involvement",
		"with student organizations. Accordingly",
		"the panel described in my Statement of",
		"February 25, 2000 that is considering the",
		"question of privileged space also will",
		"consider under what circumstances and in", 
		"what ways the University, its",
		"administrators and faculty members should",
		"be associated with such organizations",
		"and it will recommend guiding principles",
		"in this regard. The University's",
		"Executive Officers and I will then decide",
		"whether and how to implement such",
		"principles."			       
	};
	int i;

	for (i = 0; find_strings[i]; i++)
	{
		init_search(find_strings[i]);
		here = strsearch(search_strings[i]);
		printf("\"%s\" is%s in \"%s\"", find_strings[i],
				here ? "" : " not", search_strings[i]);
		if (here)
			printf(" [\"%s\"]", here);
		putchar('\n');
	}

	return 0;
}
Exemple #11
0
int q_sig_search(int g_m) {
  int i, j, k;
  double time;
  int m_num;
  //char can_name_buffer[256];
  //char avr_can_name_buffer[256];
  char match_name_buffer[256];
  double temp0, temp1, switch_point, proba;
  double beta[MAX_PARTI];
  //char can_index_name_buffer[256];
  //char avr_can1_name_buffer[256];
  //sprintf(can_name_buffer, "./can_stat_m=%d_q=%d_o=%d.txt", g_m, g_q, order_num);
  //sprintf(can_index_name_buffer, "./index_stat_m=%d_q=%d_o=%d_can.txt", g_m, g_q, order_num);
  sprintf(match_name_buffer, "./match_m=%d_q=%d_o=%d.txt", g_m, g_q, order_num);

  //init power_hashmap
  power_hashmap = init_power_hashmap(N, power_hashmap);

  //init bitmap mask
  for (i = 0; i < U_INT_LEN / 2; i++) {
    mask[i] = 3 << (i << 1);
  }


  /*
    if (g_element_random_order == 1) {
    order_num = 0;
    }
   */
  // link data to stream
  FILE * fp_record;
  if ((fp_record = fopen(data_source, "rt+")) == NULL) {
    fprintf(stderr, "No Document has been found.\n");
    return EXIT_FAILURE;
  }
  // set a buffer to store combining elements as a sig

  // read data
  g_curr_record_num = read_all_documents(fp_record, g_records);
  fclose(fp_record);
  //calculate best Q based on m 
  g_q = calculate_Q(g_records[0].len, g_m);
  //fprintf(stdout, "partition length is %d\n", g_q);
  //if (g_q <= 15){
  //collapse_filtering = 0;
  //}
  //sig_str_buffer = (char *) malloc(sizeof (char) * 2 * g_q * MAX_ELEMENT_LEN);

  if (g_curr_record_num < 0) {
    fprintf(stderr, "Error: Read data error\n");
    return EXIT_FAILURE;
  }

  // init the hashtable
  init_element_index(MAX_ELEMENT_NUM);
  // create space for elements
  for (i = 0; i < g_curr_record_num; i++) {
    if ((g_records[i].element_slots = (element_slot_t *) malloc(sizeof (element_slot_t) * g_records[i].len)) == NULL) {
      fprintf(stderr, "ERROR: Out of memory\n");
      exit(-1);
    }
    // build the element list
    build_record_elements(g_records[i].str, g_records[i].len, g_records[i].element_slots);
  }

  //random the frq to random the element order
  //if (g_element_random_order == 1) {
  if (bit_fv) {
    hash_element_in_dimension(_element_block_head);
    bitwise_record(g_records, g_curr_record_num);
  }

  free(_buffer);
  //sort_all_element_list_by_freq(g_records, g_curr_record_num);
  //}

  // initiate index
  /*
    if(collapse_filtering){
    rand_bucket_num(_element_block_head);
    //fprintf(stdout,"%u\t%u\t%u\t%u\n", g_records[0].element_slots[0].element->bucket_num, g_records[0].element_slots[1].element->bucket_num, 
    //g_records[0].element_slots[2].element->bucket_num, g_records[0].element_slots[3].element->bucket_num );
    rec_bucket_init(g_records, g_curr_record_num);
    //fprintf(stdout,"%u\t%u\t%u\t%u\n", g_records[0].bucket[0], g_records[0].bucket[1], 
    //g_records[0].bucket[3], g_records[0].bucket[4]);
    }
   */

  init_sig_index(MAX_SIG_NUM);
  // create data sigs for each record from their elements
  for (i = 0; i < g_curr_record_num; i++) {

    //calculate the number of sig_prefix for each record
    g_records[i].sig_num = calculate_sig_num(&g_records[i], g_m);
    //set space for those sigs
    if ((g_records[i].sig_slots = (sig_slot *) malloc(sizeof (sig_slot) * g_records[i].sig_num)) == NULL) {
      fprintf(stderr, "ERROR: Out of memory\n");
      exit(-1);
    }
    //create sigs
    build_sigs(&g_records[i], g_q, g_m);
  }


  //random the frq to random the sig order
  //if (g_sig_random_order == 1) {
  //  random_sig_frq(_sig_block_head);
  //}
  //sort those sigs by idf
  //sort_all_sig_list_by_freq(g_records, g_curr_record_num);
  // build index
  build_sig_idf_list(g_records, g_curr_record_num, g_m, g_q);

  fprintf(stdout, "The number of documents:%d\n", g_curr_record_num);
  printf("\n");
  // print out the average length of the documents in data source
  int sum = 0;
  int avg_len = 0;
  for (i = 0; i < g_curr_record_num; i++) {
    sum += g_records[i].len;
  }
  avg_len = sum / g_curr_record_num;
  fprintf(stdout, "The average length of these documents is:%d\n", avg_len);
  fprintf(stdout, "\n");
  //show the information in the index
  fprintf(stdout, "The number of different elements is %d\n", g_element_num);
  fprintf(stdout, "The number of different sigs is %d\n", g_sig_num);


  //search part

#ifndef DEBUG_INDEX
  //output result

  if ((fp_query_match = fopen(match_name_buffer, "w+")) == NULL) {
    fprintf(stderr, "Error: create file error\n");
    return EXIT_FAILURE;
  }
  //output candidate status
  /*
    if ((fp_query_cand = fopen(can_name_buffer, "w+")) == NULL) {
      fprintf(stderr, "Document creating error.\n");
      return EXIT_FAILURE;
    }

    if ((fp_query_cand_index = fopen(can_index_name_buffer, "w+")) == NULL) {
      fprintf(stderr, "Document creating error.\n");
      return EXIT_FAILURE;
    }
   */
  //FILE * fp_query_stat;
  //if ((fp_query_stat = fopen("/Users/xyzhang/Desktop/q_sig/search_stat.txt", "w+")) == NULL) {
  //    fprintf(stderr, "Document creating error.\n");
  //    return EXIT_FAILURE;
  //}

  // data query
  FILE * fp_query;
  if ((fp_query = fopen(query_source, "rt+")) == NULL) {
    fprintf(stderr, "No Document has been found.\n");
    return EXIT_FAILURE;
  }

  //read query data
  g_curr_query_num = read_all_queries(fp_query, g_query);
  fclose(fp_query);
  //reset timer


  if (g_curr_query_num < 0) {
    fprintf(stderr, "Error: Read query error\n");
    return EXIT_FAILURE;
  }

  double average_can0, average_can1, average_can2, average_can3, average_can4, average_can5, average_esti_can1;
  average_can0 = 0;
  average_can1 = 0;
  average_can2 = 0;
  average_can3 = 0;
  average_can4 = 0;
  average_can5 = 0;
  //average_esti_can1 = 0;

  for (i = 0; i < g_curr_query_num; i++) {
    //for (i = 63; i<64 ;i++){
    //init_query_element_head();
    //set space for query elements
    if ((g_query[i].element_slots = (element_slot_t *) malloc(sizeof (element_slot_t) * g_query[i].len)) == NULL) {
      fprintf(stderr, "ERROR: Out of memory\n");
      exit(-1);
    }
    //create query elements
    build_query_elements(g_query[i].str, g_query[i].len, g_query[i].element_slots);

    if (bit_fv) {
      bitwise_query(g_query, i);
    }
    //set order by dimension

    /*
        if(collapse_filtering){
        //init_query_sig_head();
        que_bucket_init(g_query, i);
         }
     */
  }

  ResetUsage();
  mytimer preptimer;
  preptimer.timesum = 0;
  mytimer probetimer;
  probetimer.timesum = 0;

  init_search(g_curr_record_num);
  
  
  
  for (i = 0; i < g_curr_query_num; i++) {
#ifdef DEBUG_OUTPUT
    can0 = 0;
    can1 = 0;
    can2 = 0;
    can3 = 0;
    can4 = 0;
    can5 = 0;
#endif
    
  proba = 0;
  temp0 = 1;
  temp1 = 0;
    //calculate the number of sig_prefix for each query
    g_query[i].sig_num = calculate_query_sig_num(&g_query[i], g_m);

    if ((g_query[i].sig_slots = (sig_slot *) malloc(sizeof (sig_slot) * g_query[i].sig_num)) == NULL) {
      fprintf(stderr, "ERROR: Out of memory\n");
      exit(-1);
    }
    
    //build query sigs
    build_query_sigs(&(g_query[i]), g_q, g_m);

    k = 0;
     for (j = 0; j < (N- g_m +3)/2; j++) {
        //idf[k]= g_query[i].sig_slots[j].sig->last_idf;
        can0 += partition_can0[j];
        beta[k] = (double)(partition_can0[j] - (partition_len[j] - 1) * partition_exact[j] )/ (double)g_curr_record_num;
        temp0 *= (1 - beta[k]);
        k++;
    }
    
     for (j = 0; j < k; j++) {
       //fprintf(stderr, "%e %e\n", temp0, beta[j]);
        proba = (temp0 / (1 - beta[j])) * beta[j];
        //fprintf(stderr, "%e\n", proba);
        temp1 += proba;
    }
   
   switch_point = (double)can0 / ((double)g_curr_record_num * (temp0 + temp1));
   //average_esti_can1 += ((double)g_curr_record_num * ((double)1 - temp0 - temp1));

    if ((N - g_m) % 2 == 0) {
      if ( switch_point > alpha_even) {
        StartTimer(&probetimer);
        can1 = g_curr_record_num;
        for (j = 0; j < g_curr_record_num; j++) {
          m_num = bitwise_check_line_based(&(g_query[i]), &(g_records[j]), g_m);
          if (m_num >= g_m) {
            can4++;
          }
        }
        PauseTImer(&probetimer);
        can0 = g_curr_record_num;
      } else {
        StartTimer(&probetimer);
        search_in_index(g_query, i, g_records, g_curr_record_num, g_m, g_q);
        PauseTImer(&probetimer);
      }
    } else {
      if ( switch_point > alpha_odd) {
        can1 = g_curr_record_num;
        StartTimer(&probetimer);
        for (j = 0; j < g_curr_record_num; j++) {
          m_num = bitwise_check_line_based(&(g_query[i]), &(g_records[j]), g_m);
          if (m_num >= g_m) {
            can4++;
          }
        }
        PauseTImer(&probetimer);
        can0 = g_curr_record_num;
      } else {
        StartTimer(&probetimer);
        search_in_index_odd(g_query, i, g_records, g_curr_record_num, g_m, g_q);
        PauseTImer(&probetimer);
      }
    }
  
    //free malloc space
    //free(g_query[i].element_slots);
    //free(g_query[i].sig_slots);
#ifdef DEBUG_OUTPUT
    average_can0 += can0;
    average_can1 += can1;
    average_can2 += can2;
    average_can3 += can3;
    average_can4 += can4;
    average_can5 += can5;
    //average_m_num += avg_m_num;
#endif
  }
  //  fprintf(fp_query_stat,"query[%d]\t%d\t%d\n", i, g_query[i].can0, g_query[i].pair_num);
  //}

  /*
  #ifdef dump_one_query
    char order_buffer[256];
    sprintf(order_buffer, "./order_m=%d_q=%d_o=%d.txt", g_m, g_q, order_num);
    if ((fp_output_order = fopen(order_buffer, "w+")) == NULL) {
      fprintf(stderr, "Error: create file error\n");
      return EXIT_FAILURE;
    }
    for (i =0; i<order_num;i++){
    dump_element_random_order(_element_block_head, g_m, g_q, i);
    }
  #endif
   */

  //#ifdef DEBUG_OUTPUT
  time = ShowUsage();
  fprintf(stdout, "Usage: %s\n", __usage_information);

  average_can0 /= g_curr_query_num;
  average_can1 /= g_curr_query_num;
  average_can2 /= g_curr_query_num;
  average_can3 /= g_curr_query_num;
  average_can4 /= g_curr_query_num;
  average_can5 /= g_curr_query_num;
  //average_esti_can1 /= g_curr_query_num;

  /*
          FILE * fp_avr_cand1_num;
      if ((fp_avr_cand1_num = fopen(avr_can1_name_buffer, "rt+")) == NULL) {
        fprintf(stderr, "No Document has been found.\n");
        return EXIT_FAILURE;
      }
   */

  //print out the query's name
  int p;
  char * data;
  data = query_source;
  p = strlen(data) - 1;
  while (data[p] != '/') {
    p--;
  }
  p++;
  while (data[p] != '\0' && data[p] != '.') {
    fprintf(stderr, "%c", data[p]);
    p++;
  }
  fprintf(stderr, " ");

  fprintf(stderr, "m %d partition_len %d ", g_m, g_q);
  fprintf(stderr, "time %.6f can0 %f ", time, average_can0);
  fprintf(stderr, "can1 %f ", average_can1);
  //fprintf(stderr, "esti_can1 %f ", average_esti_can1);
  fprintf(stderr, "can2 %f ", average_can2);
  fprintf(stderr, "can3 %f ", average_can3);
  //fprintf(stderr, "can4 %Lf ", average_can5);
  fprintf(stderr, "can4 %f bitnum: %d\n", average_can4, bit_per_d);
  //fprintf(stderr, "avg_m_num_in_pfx\t%Lf\n", average_m_num);
  //dump useful order
  //dump_element_order(_element_block_head, g_m, g_q);
  //dump_sig_order(_sig_block_head, g_m, g_q);
  //dump_sig_order_in_prefix(_sig_block_head, g_m, g_q);

  //free space
  /*
    destroy_element_index();
    destroy_sig_index();
    for (i = 0; i < g_curr_record_num; i++) {
      free(g_records[i].element_slots);
      free(g_records[i].sig_slots);
    }

    //destroy_query_element_blocks();
    //destroy_query_sig_blocks();

    free(sig_str_buffer);
    free(_buffer);
   */
  //#endif
#endif 
  return EXIT_SUCCESS;
}
Exemple #12
0
VALUE wrap_init_search(VALUE self, VALUE dump, VALUE index, VALUE map)
{
	init_search(StringValuePtr(dump), StringValuePtr(index), StringValuePtr(map));
	return Qnil;
}