Changeset - 096e40410087
[Not reviewed]
0 1 3
Tom Bannink - 8 years ago 2017-07-17 13:54:56
tombannink@gmail.com
Add ccm time evol plots
1 file changed:
Changeset was too big and was cut off... Show full diff anyway
0 comments (0 inline, 0 general)
cpp/switchchain_ccm_timeevol.cpp
Show inline comments
 
@@ -16,13 +16,14 @@ int main(int argc, char* argv[]) {
 
    const int numVerticesMax = 1000;
 
    const int numVerticesStep = 1000;
 

	
 
    //float tauValues[] = {2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f};
 
    float tauValues[] = {2.1f, 2.3f, 2.5f, 2.7f, 2.9f};
 

	
 
    const int totalDegreeSamples = 10;
 
    //const int totalDegreeSamples = 10;
 
    const int totalDegreeSamples = 1;
 

	
 
    auto getMixingTime = [](int n, float tau) {
 
        return int(1.0f * (50.0f - 10.0f * (tau - 2.0f)) * n);
 
    };
 

	
 
    // Output file
 
@@ -38,14 +39,14 @@ int main(int argc, char* argv[]) {
 

	
 
    // Output Mathematica-style comment to indicate file contents
 
    outfile << "(*\n";
 
    outfile << "n from " << numVerticesMin << " to " << numVerticesMax
 
            << " step " << numVerticesStep << std::endl;
 
    outfile << "tauValues: " << tauValues << std::endl;
 
    outfile << "degreeSamples: " << totalDegreeSamples << std::endl;
 
    //outfile << "canonical ds" << std::endl;
 
    //outfile << "degreeSamples: " << totalDegreeSamples << std::endl;
 
    outfile << "canonical ds" << std::endl;
 
    outfile << "mixingTime: 0.5 * (50 - 10 (tau - 2)) n\n";
 
    outfile << "measurements: full time evol\n";
 
    outfile << "data:\n";
 
    outfile << "1: {n,tau}\n";
 
    outfile << "2: edges\n";
 
    outfile << "3: HH triangle seq\n";
 
@@ -120,13 +121,13 @@ int main(int argc, char* argv[]) {
 
                            outfile << '{' << '}';
 
                        }
 
                    }
 
                    outfile << '}';
 
#endif
 
                    bool failed = true;
 
                    for (int i = 0; i < 50; ++i) {
 
                    for (int i = 0; i < 1000; ++i) {
 
                        Graph gtemp;
 
                        if (constrainedConfigurationModel(ds, gtemp, rng,
 
                                                          ccmMethod)) {
 
                            chain.initialize(gtemp, true);
 
                            for (int i = 0; i < mixingTime; ++i) {
 
                                chain.doMove(true);
 
@@ -135,13 +136,13 @@ int main(int argc, char* argv[]) {
 
                            outfile << ',' << '{' << i << ',' << triangleSeq << '}';
 
                            failed = false;
 
                            break;
 
                        }
 
                    }
 
                    if (failed)
 
                        outfile << ",{50,{}}";
 
                        outfile << ",{1000,{}}";
 
                }
 

	
 
                outfile << '}' << std::flush;
 

	
 
                std::cout << " Finished CCM time evols." << std::flush;
 

	

Changeset was too big and was cut off... Show full diff anyway

0 comments (0 inline, 0 general)