Beispiel #1
0
int tester()
{
  Compta::Posting default_post;
  std::string cat("category"), description("some description here");
  Compta::Date date(20120904);
  float amount(15.12);
  Compta::PostingType::PostingType pt(Compta::PostingType::V);
  Compta::Posting custom_one(cat,date,description,amount,true);
  Compta::Posting custom_two(cat,date,description,amount,false);
  custom_two.set_identifier(pt);
  int return_flag(0);

  return_flag = return_flag || check_posting(default_post,std::string(),Compta::Date(),std::string(),0.,true,Compta::PostingType::B,"default")
                            || check_posting(custom_one,cat,date,description,amount,true,Compta::PostingType::B,"custom one")
                            || check_posting(custom_two,cat,date,description,amount,false,pt,"custom two")
                            || check_posting(-custom_two,cat,date,description,-amount,false,pt,"minus custom two");

  default_post.set_description(description);
  default_post.set_category(cat);
  default_post.set_amount(amount);
  default_post.set_date(date);
  default_post.set_identifier(pt);
  default_post.set_accounted(true);
  Compta::Posting copy_post(default_post);

  return_flag = return_flag || check_posting(default_post,cat,date,description,amount,true,pt,"default changed")
                            || check_posting(copy_post,cat,date,description,amount,true,pt,"default changed");

  return return_flag;
}
Beispiel #2
0
void srslte_dft_run_c(srslte_dft_plan_t *plan, cf_t *in, cf_t *out) {
  float norm;
  int i;
  fftwf_complex *f_out = plan->out;

  copy_pre((uint8_t*)plan->in, (uint8_t*)in, sizeof(cf_t), plan->size,
           plan->forward, plan->mirror, plan->dc);
  fftwf_execute(plan->p);
  if (plan->norm) {
    norm = 1.0/sqrtf(plan->size);
    srslte_vec_sc_prod_cfc(f_out, norm, f_out, plan->size);    
  }
  if (plan->db) {
    for (i=0;i<plan->size;i++) {
      f_out[i] = 10*log10(f_out[i]);
    }
  }
  copy_post((uint8_t*)out, (uint8_t*)plan->out, sizeof(cf_t), plan->size,
            plan->forward, plan->mirror, plan->dc);
}