Example #1
0
int main(int argc, char *argv[])
{

 testSequence();
 testUnivariateStats();
 testBivariateStats();
 testUtility();
 testVectorAlgebra(); 
 testMatrixDeterminant();
 testMatrixInverse();
 testLUFactorisation();
 testLUSolver();
 testGaussianElimination();
 testInterpolation();
 testIntegration();
 testRoot();
 testTimeStep();
 testRSignificanceTest();
 testChiSquared();
 testMultipleRegression(); 
 test_golden_fit();
 testSimplex(); 
 testSimplex2(); 
 testSimplex3();
 test_simplex_fit(); 


 return (EXIT_SUCCESS);

} 
int main()
{
    testSequence2();
    return 0;
    testSequenceCMAES();
    return 0;
    testSequence();
    return 0;
    testLogs();
    return 0;

    //Plot real target function
    Leph::Plot plot;
    for (double x=0.0;x<=1.0;x+=0.03) {
        for (double y=0.0;y<=1.0;y+=0.03) {
            plot.add(Leph::VectorLabel(
                "x", x, 
                "y", y, 
                "real", function(x, y)));
        }
    }

    //Initialize Gaussian Process
    libgp::GaussianProcess gp(2, "CovSum ( CovSEiso, CovNoise)");
    
    //Adding noised data point to model
    for (size_t k=0;k<100;k++) {
        double x = 0.5*uniform(generator) + 0.5;
        double y = 0.5*uniform(generator) + 0.5;
        double f = function(x, y) + noise(1.0);
        plot.add(Leph::VectorLabel(
            "x", x, 
            "y", y, 
            "target", f));
        double input[] = {x, y};
        gp.add_pattern(input, f);
    }
    
    //Optimize hyper parameter
    libgp::RProp rprop;
    rprop.init();
    rprop.maximize(&gp, 50, true);
    
    //Predict fitted model
    for (double x=0.0;x<=1.0;x+=0.04) {
        for (double y=0.0;y<=1.0;y+=0.04) {
            double input[] = {x, y};
            plot.add(Leph::VectorLabel(
                "x", x, 
                "y", y, 
                "fitted", gp.f(input)));
        }
    }
    
    //Display plot
    plot.plot("x", "y", "all").render();

    return 0;
}
Example #3
0
int main(int argc, char** argv) {
    int period;
    int sequence[4] = {1, 2, 0, 3};	// cf. Table 1
    period = sizeof(sequence) / sizeof(sequence[0]);

    testSequence(period, 0, sequence);

    return 0;
}
Example #4
0
int main()
{
    const int repeats = 8;
    const int steps = 350;

    const size_t kb = 1024;
    const size_t mb = 1024 * kb;


    size_t init_size = 16 * kb / sizeof(Node);
    size_t small_init_size = 1 * kb / sizeof(Node);
    size_t size =  1 * kb / sizeof(Node);

    Node * nodes = initNodeArray(size);
    for(int j = 0; j < steps; j++) {

        double rand_sum = 0;
        double seq_sum = 0;

        for(int i = 0; i < repeats; i++) {
            nodes = initNodeArray(size);
            seq_sum += testSequence(nodes, size);
            rand_sum += testRandom(nodes, size);
        }

        std::cout.setf(std::ios::fixed);
        std::cout.precision( 3 );
        std::cout << size / sizeof(Node) << "kb :"
                  << seq_sum * 1000 /(size * (double)repeats) << "   ---   "
                  << rand_sum * 1000 /(size * (double)repeats)
                  << std::endl;
        if(size >= init_size * 3)
            size += init_size;
        else
            size += small_init_size;
    }

    delete[] nodes;

    return 0;
}
main(int argc, char *argv[], char *envp[])
{
   testSequence();
}
void SkaarhojUHB::testSequence() { testSequence(20); }
void SkaarhojBroadcastButtons::testSequence() { testSequence(20); }