コード例 #1
0
ファイル: moc_form1.cpp プロジェクト: darwinbeing/Hifi-Pod
int Form1::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: quit(); break;
        case 1: play(); break;
        case 2: musinfo(); break;
        case 3: stop(); break;
        case 4: slR(); break;
        case 5: slP(); break;
        case 6: opcje(); break;
        case 7: showplaylist(); break;
        case 8: timrefDo(); break;
        case 9: funkcje_opn(); break;
        case 10: info(); break;
        case 11: aWAV(); break;
        case 12: slAT((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 13: setVol((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 14: savMus(); break;
        case 15: nextB(); break;
        case 16: prevB(); break;
        case 17: AboutQMP(); break;
        case 18: NextXs(); break;
        case 19: volup(); break;
        case 20: voldown(); break;
        case 21: minimize(); break;
        case 22: seekP((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 23: setVolR((*reinterpret_cast< int*(*)>(_a[1]))); break;
        case 24: pwp(); break;
        case 25: pwl(); break;
        case 26: netA(); break;
        case 27: selA(); break;
        case 28: SoH(); break;
        case 29: mnuAct((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
        case 30: checkUpdatesButton(); break;
        case 31: checkUpdates(); break;
        case 32: updateQVis(); break;
        case 33: BTpause(); break;
        case 34: showEq(); break;
        case 35: volMnu(); break;
        case 36: setBothVolB(); break;
        case 37: TrayMessageClicked(); break;
        case 38: showMnuOpt(); break;
        case 39: miniQMP(); break;
        case 40: showTrayMnu(); break;
        case 41: setVolFromMiniQMP((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 42: opisQMP(); break;
        case 43: resetInfoWindow(); break;
        case 44: miniVersion(); break;
        case 45: copyTitleA(); break;
        case 46: fileChanged(); break;
        default: ;
        }
        _id -= 47;
    }
    return _id;
}
コード例 #2
0
 cholmod_sparse *
 MultivariateFNormalSufficientSparse::evaluate_derivative_Sigma() const
 {
     //d(-log(p))/dSigma = 1/2 (N P - N P epsilon transpose(epsilon) P - P W P)
     IMP_LOG(TERSE, "MVNsparse: evaluate_derivative_Sigma() = " << std::endl);
     cholmod_sparse *ptp(compute_PTP());
     cholmod_sparse *pwp(compute_PWP());
     //std::cout << " ptp " << std::endl << ptp << std::endl << std::endl;
     //std::cout << " pwp " << std::endl << pwp << std::endl << std::endl;
     static double one[2]={1,0};
     static double minusone[2]={-1,0};
     cholmod_sparse *tmp =
         cholmod_add(P_, ptp, one, minusone, true, false, c_);
     double enn[2]={0.5*N_,0};
     static double ptfive[2]={-0.5,0};
     cholmod_sparse *R = cholmod_add(tmp, pwp, enn, ptfive, true, false, c_);
     cholmod_free_sparse(&ptp, c_);
     cholmod_free_sparse(&pwp, c_);
     cholmod_free_sparse(&tmp, c_);
     return R;
 }
コード例 #3
0
ファイル: main_conf.c プロジェクト: 4auka/cmusphinx
/* Find the confidence score and dump the confidence output into the file */
static void
confidence_utt(char *uttid, FILE * _confmatchsegfp)
{
    seg_hyp_line_t s_hypline;
    char line[16384];
    char dagfile[16384];
    const char *fmt;
    const char *latdir;
    const char *latext;
    E_INFO("Processing %s\n", uttid);
    if (fgets(line, sizeof(line), _confmatchsegfp) == NULL)
        E_FATAL("Fail to read a line in the matchsegfp for uttid %s\n",
                uttid);

    /* Read the hypseg */
    if (read_s3hypseg_line(line, &s_hypline, lmset->cur_lm, dict) ==
        HYPSEG_FAILURE)
        E_FATAL("Fail to parse matchseg in utt ID %s\n", uttid);

    E_INFO("Matchseg file name %s\n", s_hypline.seq);
    if (strcmp(uttid, s_hypline.seq))
        E_FATAL("Uttids in control file and matchseg file mismatches\n");

    /* Read the lattice */
    latdir = cmd_ln_str_r(config, "-inlatdir");
    latext = cmd_ln_str_r(config, "-latext");

    if (latdir)
        sprintf(dagfile, "%s/%s.%s", latdir, uttid, latext);
    else
        sprintf(dagfile, "%s.%s", uttid, latext);

    E_INFO("Reading DAG file: %s\n", dagfile);

    if (confidence_word_posterior(dagfile,
                                  &s_hypline,
                                  uttid,
                                  lmset->cur_lm,
                                  dict, fpen) == CONFIDENCE_FAILURE) {
        E_INFO("Fail to compute word posterior probability \n");
    }


#if 0
    if (ca_dag_load_lattice
        (dagfile, &word_lattice, lmset->cur_lm, dict,
         fpen) == CONFIDENCE_FAILURE)
        E_FATAL("Unable to load dag %s for uttid %s\n", dagfile, uttid);

    /* Compute Alpha-beta */
    if (alpha_beta(&word_lattice, lmset->cur_lm, dict) ==
        CONFIDENCE_FAILURE)
        E_FATAL("Unable to compute alpha beta score for uttid %s\n",
                uttid);

    /* Compute Posterior WORD probability */
    if (pwp(&s_hypline, &word_lattice) == CONFIDENCE_FAILURE)
        E_FATAL("Unable to compute pwp for uttid %s\n", uttid);
#endif

    /* Compute LM type */
    if (compute_lmtype(&s_hypline, lmset->cur_lm, dict) ==
        CONFIDENCE_FAILURE)
        E_FATAL("Fail to compute lm type\n");

    /* combined LM type */
    if (compute_combined_lmtype(&s_hypline) == CONFIDENCE_FAILURE)
        E_FATAL("Fail to compute lm type\n");

    /* Dump pwp line */
    fmt = cmd_ln_str_r(config, "-confoutputfmt");
    if (!strcmp(fmt, "scores")) {
        dump_line(stdout, &s_hypline, dict);
        dump_line(outconfmatchsegfp, &s_hypline, dict);
    }
    else {
        glist_t hyp;
        srch_hyp_t *s;
        conf_srch_hyp_t *h;

        hyp = NULL;
        for (h = (conf_srch_hyp_t *) s_hypline.wordlist; h; h = h->next) {
            s = &(h->sh);
            hyp = glist_add_ptr(hyp, (void *) s);
        }
        matchseg_write(stdout, hyp, uttid, NULL,
                       lmset->cur_lm, dict, 0, NULL, 0);
        matchseg_write(outconfmatchsegfp, hyp, uttid, NULL,
                       lmset->cur_lm, dict, 0, NULL, 0);
    }

#if 0
    /* Delete lattice, delete hypsegline */
    if (ca_dag_free_lattice(&word_lattice) == CONFIDENCE_FAILURE) {
        E_WARN("Fail to free lattice.\n");
        return CONFIDENCE_FAILURE;
    }
#endif

    if (free_seg_hyp_line(&s_hypline) != HYPSEG_SUCCESS)
        E_FATAL("Fail to free the segment hypothesis line structure. \n");
}