コード例 #1
0
ファイル: sgraph_bit.cpp プロジェクト: JehandadKhan/roccc-2.0
BitVector *SGraphBit::new_node_successors(SGraphNode node) const {
  if (!has_bv(node)) {
    return new BitVector;
  } else {
    return(new BitVector(*get_bv(node)));
  }
}
コード例 #2
0
ファイル: sgraph_bit.cpp プロジェクト: JehandadKhan/roccc-2.0
SNodeIter SGraphBit::
get_node_successor_iterator(SGraphNode node) const {
  if (!node_has_successors(node)) return new SGraphEmptyIter;
  if (has_bv(node)) {
    return(SNodeIter( new SGraphBitIter(get_bv(node), false) ));
  } else {
    return(SNodeIter( new SGraphEmptyIter()) );
  }
}
コード例 #3
0
ファイル: term_op.c プロジェクト: LarryCN/VEDiC
static inline int *get_bit_vector(struct tobj* tobj)
{
    struct tobj *t = tobj;
    int s_bit, e_bit;
    int cur = t->cur_doc;
    int len, i;
    int *output;

    //printf("get_bit_vector %d, %d, %d\n", t->cur_chunk, t->chunk_s, t->chunk_e);

    if(!cur){
        s_bit = 0;
    }else{
        s_bit = t->chunk.bvoff[cur - 1];
    }
    e_bit = t->chunk.bvoff[cur];
    //printf("-- %d, %d, %d\n", cur, s_bit, e_bit);
    /* huffman decode */
    len = hfman_decode(s_bit, e_bit, t->hcode_addr, hcode_buff);
    /*
    printf("%d \n", len);
    for(i = 0; i < len; i++){
        printf("%d ", hcode_buff[i]);
    }
    printf("\n");
    */
    /* bit vector decode */
    output = get_bv(len, hcode_buff, &len); // output is the pointer to the bit vector array
    /* 
    printf("%d \n", len);
    for(i = 0; i < len; i++){
        printf("%d ", output[i]);
    }
    printf("\n");
    */
    return output;
}
コード例 #4
0
ファイル: sgraph_bit.cpp プロジェクト: JehandadKhan/roccc-2.0
bool SGraphBit::node_has_successors(SGraphNode node) const {
  BitVector *bv = get_bv(node);
  if (!bv) return false;
  return(bv->num_significant_bits() != 0);
}