Changeset - 03b85970d933
[Not reviewed]
0 1 0
Tom Bannink - 8 years ago 2017-07-03 16:51:00
tom.bannink@cwi.nl
Re-run canonical for fixed powerlaw
1 file changed with 19 insertions and 10 deletions:
0 comments (0 inline, 0 general)
cpp/switchchain_canonical_properties.cpp
Show inline comments
 
@@ -50,10 +50,17 @@ int main(int argc, char* argv[]) {
 
    //const int totalDegreeSamples = 5000;
 

	
 
    auto getMixingTime = [](int n, float tau) {
 
        return int(50.0f * (50.0f - 30.0f * (tau - 2.0f)) * n);
 
        return int(50.0f * (50.0f - 10.0f * (tau - 2.0f)) * n);
 
    };
 
    auto getMeasurements = [](int n, float tau) {
 
        (void)n;
 
        (void)tau;
 
        return 10;
 
    };
 
    auto getMeasureSkip = [](int n, float tau) {
 
        (void)tau;
 
        return n; // Take a sample every ... steps
 
    };
 
    constexpr int measurements = 10;
 
    constexpr int measureSkip = 1000; // Take a sample every ... steps
 

	
 
    // Output file
 
    std::ofstream outfile;
 
@@ -72,7 +79,7 @@ int main(int argc, char* argv[]) {
 
            << " step " << numVerticesStep << std::endl;
 
    outfile << "tauValues: " << tauValues << std::endl;
 
    outfile << "Canonical degree sequence.\n";
 
    outfile << "mixingTime: 50 * (50 - 30 (tau - 2)) n\n";
 
    outfile << "mixingTime: 50 * (50 - 10 (tau - 2)) n\n";
 
    outfile << "data:\n";
 
    outfile << "1: {n,tau}\n";
 
    outfile << "2: avgTriangles\n";
 
@@ -118,12 +125,12 @@ int main(int argc, char* argv[]) {
 
            std::array<double, 3> avgAspectrum;
 
            std::array<double, 3> avgLspectrum;
 

	
 
            auto getSpectralValues =
 
                [](const std::vector<float> &s) -> std::array<double, 3> {
 
                auto l1 = s[s.size() - 1];
 
                auto l2 = s[s.size() - 2];
 
                return {l1, l1 - l2, l1 / l2};
 
            };
 
            //auto getSpectralValues =
 
            //    [](const std::vector<float> &s) -> std::array<double, 3> {
 
            //    auto l1 = s[s.size() - 1];
 
            //    auto l2 = s[s.size() - 2];
 
            //    return {l1, l1 - l2, l1 / l2};
 
            //};
 

	
 
            GraphSpectrum gs_start(g);
 
            GraphSpectrum gs(chain.g);
 
@@ -139,6 +146,8 @@ int main(int argc, char* argv[]) {
 
            int movesDone = 0;
 
            avgAspectrum.fill(0);
 
            avgLspectrum.fill(0);
 
            int measurements = getMeasurements(numVertices, tau);
 
            int measureSkip = getMeasureSkip(numVertices, tau);
 
            for (int i = 0; i < measurements; ++i) {
 
                for (int j = 0; j < measureSkip; ++j)
 
                    if (chain.doMove())
0 comments (0 inline, 0 general)