Changeset 2281


Ignore:
Timestamp:
Apr 16, 2008, 12:10:00 AM (15 years ago)
Author:
Sam Hocevar
Message:
  • Prepare study 4, for exhaustive 4-cell kernel search.
Location:
research/2008-displacement
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • research/2008-displacement/main.c

    r2279 r2281  
    663663            for(e = 0; e <= TOTAL; e++)
    664664            {
     665                int a2 = a, b2 = b, c2 = c, d2 = d, e2 = e, i;
     666
    665667                if(a + b + c + d + e != TOTAL)
    666668                    continue;
     
    668670                /* Slightly shuffle our coefficients to avoid waiting until
    669671                 * 75% progress before having an idea of what's going on. */
    670                 int a2 = a, b2 = b, c2 = c, d2 = d, e2 = e;
    671672#define SHUFFLE(p,q,n) \
    672673    if(p+q) { int tmp = p+q; p = (p+n) % (tmp+1); q = tmp-p; }
     
    685686                /* We only want 4-cell kernels for now */
    686687                if(b2) continue;
    687                 //printf("K: %d,%d,%d,%d,%d ", a2, b2, c2, d2, e2);
    688                 printf("K: %d,%d,%d,%d ", a2, c2, d2, e2);
    689 
    690                 dest = ed(src, false, a2, 0,
    691                           b2, c2, d2, e2, 0,
    692                            0,  0,  0,  0, 0);
    693                 if(mode == 4)
    694                 {
    695                     study(src, dest, 1.2, 0.001, 0., 0.);
    696                 }
    697                 else
    698                 {
    699                     tmp = gauss(src, mat);
    700                     tmp2 = gauss(dest, mat);
    701                     printf("E: %.5g\n", 1000. * dist(tmp, tmp2, 1.));
    702                     free(tmp);
    703                     free(tmp2);
    704                 }
    705                 fflush(stdout);
    706                 free(dest);
     688
     689                for(i = 1; i <= 2; i++)
     690                {
     691                    //printf("[%i] K: %d,%d,%d,%d,%d ", i, a2, b2, c2, d2, e2);
     692                    printf("[%i] K: %d,%d,%d,%d ", i, a2, c2, d2, e2);
     693
     694                    dest = ed(src, i == 2, a2, 0,
     695                               b2, c2, d2, e2, 0,
     696                                0,  0,  0,  0, 0);
     697                    if(mode == 4)
     698                    {
     699                        /* XXX: E_fast is meaningless, ignore it */
     700                        study(src, dest, 1.2, 0.001, 0., 0.);
     701                    }
     702                    else
     703                    {
     704                        tmp = gauss(src, mat);
     705                        tmp2 = gauss(dest, mat);
     706                        printf("E: %.5g\n", 1000. * dist(tmp, tmp2, 1.));
     707                        free(tmp);
     708                        free(tmp2);
     709                    }
     710                    fflush(stdout);
     711                    free(dest);
     712                }
    707713            }
    708714
Note: See TracChangeset for help on using the changeset viewer.