gc periods in gp

gc periods in gp

/**

======================================
Abel-Jacobi map on hyperelliptic curves
=======================================

computing period matrix of hyperelliptic curves

*/

msgtimer(s,level=1) = {
  if(default(debug)>=level,printf("  Time %s : %ld\n",s,gettime()));
}
msgdebug(s,header="  ",level=1) = {
  if(default(debug)>=level,printf("%s%s\n",header,s));
}

global(iMax=0);
iGenus            =  iMax++;
iRoots            =  iMax++;
iTree             =  iMax++;
iIntersection     =  iMax++;
iABtoC            =  iMax++;
iTau              =  iMax++;

/**

Numerical integration with Gauss Chebychev
------------------------------------------

*/
/* compute prod sqrt(z-u_i) as sqrt prod(z-u_i)
   track the number of loops around 0
   while multiplying the (z-ui).
 */
/* sign of the imaginary part with positive zero */
isign(x) = { my(s);s=sign(imag(x));if(s,s,1);}
sqrt_affinereduction(u,z,product=0) = {
  my(z1,i1,z2,i2,sgn);
  \\ if we want the long method, or there is only one root
  if(product||#u==1,
    prod(i=1,#u, if(real(u[i])>0,I*sqrt(u[i]-z),sqrt(z-u[i])))
    , \\ otherwise
    sgn = 1; \\ track the number of loops
    z1 = z-u[1];
    /* if the point is on the right, take non-standard cut */
    if(imag(z1)==0&&real(z1)<0,z1=-z1;sgn*=-I);
    i1 = isign(z1);
    for(i=2,#u,
      z2 = z-u[i];
      if(imag(z2)==0&&real(z2)<0,z2=-z2;sgn *=-I);
      i2 = isign(z2);
      z1 *= z2;
      if(i1==i2,
        i1 = isign(z1);
        if(i1!=i2,sgn*=-1),
        i1 = isign(z1)
        ));
    sqrt(z1)*sgn
    );
}

/*
 compute the column of period integrals
 [ int x^k/y dx ]
*/
integrals_gc(u, g, n, product = 0) = {
  my(res = vector(g));
  for(k=1,n,
    my(xk = cos((2*k-1)*Pi/(2*n)));
    my(t = 1/sqrt_affinereduction(u,xk,product));
    res[1] += t;
    for(i=2,g, res[i] += (t *= xk));
    );
  res * Pi/n;
}

/* make u vectors : remove one or two roots */
ab_points(A,ia, ib) = {
    my(a = A[ia]); my(b=A[ib]); my(j=0);
    my(u=vector(#A-2));
    for(i=1,#A,i==ia||i==ib||u[j++]=(2*A[i]-a-b)/(b-a));
    u;
}
integrals_edge(C, i1, i2, product = 0) = {
  my(g = C[iGenus]);
  my(u = ab_points(C[iRoots], i1, i2));
  my(n = gc_n(u));
  my(res = integrals_gc(u, g, n));
  msgdebug(res, "int =", 2);
  /* shift */
  my(a = C[iRoots][i1]);
  my(b = C[iRoots][i2]);
  my(c = (b+a)/(b-a));
  for(j = 2, g, res[j] += res[j-1] * c);
  msgdebug(res, "shifted =", 2);
  /* fix factors */
  my(geom_factor = (b-a)/2);
  my(fact = I/sqrt(geom_factor)^#u);
  res[1] *= fact;
  for(j=2,g,
          fact *= geom_factor;
          res[j] *= fact;
     );
  \\ to track signs, return also the values of the sqrt chosen at end points
  vplus = sqrt_affinereduction(u,1,flag)*sqrt(geom_factor)^#u/geom_factor;
  vmoins = sqrt_affinereduction(u,-1,flag)*sqrt(geom_factor)^#u/geom_factor;
  return([res,vmoins,vplus]);
}

/** == compute integration parameters == */
dist_ellipse(p,a) = {
    my(b,t);
    my(x,y);
    my(eps=0.*1e6);
    b = sqrt(a^2-1);
    x=real(p);y=imag(p);
    if(x==0,abs(b-y),
            y==0,abs(a-x),
            t = atan(a*y/(b*x));
            ft = 1;
            while(abs(ft) > eps,
                st = sin(t);
                ct = cos(t);
                ft = ct*st-x*a*st+y*b*ct;
                fpt = ct^2-st^2-x*a*ct-y*b*st;
                t -= ft / fpt;
                );
            abs(p-a*cos(t)-I*b*sin(t))
      );
}
gc_n(u,prec,mult=.25) = {
    \\my(A,B);
    if(!prec,prec=precision(1.));
    au = [ abs(z-1)+abs(z+1) | z<-u ] / 2;
    v = vecsort(au, , 1);
    a = au[v[1]];
    m = 1; while(m<#u&&au[v[m+1]]-a<.001,m++);
    r = a + sqrt(a^2-1);
    /* first estimate */
    M = 1/sqrt(a^m*prod(i=m+1,#u,dist_ellipse(u[v[i]],a)));
    A = prec*log(10) + log(2*Pi*M) + 1;
    B = 2*log(r);
    msgdebug(A/B,"n1 = ",2);
    n = ceil(A / B);
    /* second */
    a = a*(1-mult/n);
    M = 1/sqrt(prod(i=1,#u,dist_ellipse(u[i],a)));
    A = prec*log(10) + log(2*Pi*M) + 1;
    r = a + sqrt(a^2-1);
    B = 2*log(r);
    msgdebug(A/B,"n2 = ",2);
    ceil(A/B);
}
r_3(a,b,c) = {
  (abs(c-a)+abs(c-b))/abs(b-a);
}
r_edge(A,i,j) = {
  rij = oo;
  for(k=1,#A,
    if(k==i||k==j,next());
      rij = min(rij,r_3(A[i],A[j],A[k]));
      );
   return(rij);
}
r_tree(A,edges) = {
  my(r = oo);
  for(k=1,#edges,
    r = min(r,r_edge(A,edges[k][1],edges[k][2]));
  );
  return(r);
}
/* *************************************************************************
 *  period matrix
 * ************************************************************************* */

/* *************************************************************************
 *  step 1: maximal-flow spanning tree
 * ************************************************************************* */
max_spanning(A,nedges=0)= {
  /* low precision parameters */
  localprec(19);
  my(n,r_v,z,taken,tree,rmin);
  n = #A;
  if(!nedges,nedges=n-1); /* spanning tree */
  r_v=vector(n*(n-1)/2);
  /* build list of edges ordered by r */
  z=0;
  for(i=1,n,
    for(j=i+1,n,
      r_v[z++] = [r_edge(A,i,j),i,j];
      );
    );
  r_v = vecsort(r_v,1); \\ sort according to r
  taken = vector(n,i,0); \\ mark vertex if in tree
  tree = vector(nedges);
  /* this is not optimal... too many loops */
  z=n*(n-1)/2; \\select edge with maximum r
  rmin = r_v[z][1];
  for(k=1,nedges,
    z=n*(n-1)/2;
    /* consider next edge with exactly one vertex taken (no cycle) */
    while(k>1 && taken[r_v[z][2]]==taken[r_v[z][3]],z--);
    /* this is the best edge allowed */
    i = r_v[z][2]; j = r_v[z][3];
    /* ensure i already in tree */
    if(taken[j],[i,j]=[j,i]);
    tree[k] = [i,j];
    rmin = min(rmin,r_v[z][1]);
    taken[i] = taken[j] = 1;
    );
  return([tree,rmin]);
}

/* *************************************************************************
 *  step 2 : intersection matrix of selected edges
 * ************************************************************************* */

/* end intersection I[ab].I[bd] */
intersection_abbd(A,ia,ib,ic,id) = {
    k = #A;
    a = A[ia]; b = A[ib]; d = A[id];
    tau = arg((d-b)/(b-a));
    /* \frac{\sqrt{d-b}^{k}\prod_{λ\neq b,d}\sqrt{x_β(b)-ψ_β(λ)}} */
    \\fbd = sqrt((d-b))^k
        \\*prod(i=1,k,if(i==ib||i==id,1,sqrt(-1-(2*A[i]-b-d)/(d-b))));
    Aprim = ab_points(A,ib,id);
    fbd = sqrt((d-b))^k*sqrt_affinereduction(Aprim,-1);
    \\fab = sqrt((b-a))^k
        \\*prod(i=1,k,if(i==ib||i==ia,1,sqrt(+1-(2*A[i]-b-a)/(b-a))));
    Aprim = ab_points(A,ia,ib);
    fab = sqrt((b-a))^k*sqrt_affinereduction(Aprim,1);
    if(default(debug)>=1,
            endarg = arg(fab/fbd);
            arg1 = -(Pi+tau)/2;
            arg2 = (Pi-tau)/2;
            if(abs(endarg-arg1)>0.0001&&abs(endarg-arg2)>0.0001,
                print("intersection_abbd");
                print("  tau=",tau);
                printf("  arg[fab/fbd]=%1.4f should be %1.4f or %1.4f\n",endarg,arg1, arg2);
                printf("tau/2=%1.3f ; 2*tau=%1.3f ; (Pi-tau)/2=%1.3f ; Pi-2*tau=%1.3f ; \n",
                    tau/2,2*tau,(Pi-tau)/2,Pi-2*tau);
              );
      );
    if(imag(fbd/fab)<0,return(-1),return(1));
}
intersection_abad(A,ia,ib,ic,id) = {
    k = #A;
    a = A[ia]; b = A[ib]; d = A[id];
    tau = arg((d-a)/(b-a));
    \\ \frac{\sqrt{d-b}^{k}\prod_{λ\neq b,d}\sqrt{x_β(b)-ψ_β(λ)}}
    \\fad = sqrt((d-a))^k
        \\*prod(i=1,k,if(i==ia||i==id,1,sqrt(-1-(2*A[i]-a-d)/(d-a))));
    Aprim = ab_points(A,ia,id);
    fad = sqrt((d-a))^k*sqrt_affinereduction(Aprim,-1);
    \\fab = sqrt((b-a))^k
        \\*prod(i=1,k,if(i==ib||i==ia,1,sqrt(-1-(2*A[i]-b-a)/(b-a))));
    Aprim = ab_points(A,ia,ib);
    j=0;for(i=1,k,if(i==ia||i==ib,,Aprim[j++]=(2*A[i]-a-b)/(b-a)));
    fab = sqrt((b-a))^k*sqrt_affinereduction(Aprim,-1);
    if(default(debug)>=1,
            endarg = arg(fab/fad);
            arg1 = -tau/2;
            arg2 = if(tau>0,Pi-tau/2,-Pi-tau/2);
            if(abs(endarg-arg1)>0.0001&&abs(endarg-arg2)>0.0001,
                print("intersection_abad");
                print("  tau=",tau);
                printf("  arg[fab/fad]=%1.4f should be %1.4f or %1.4f\n",endarg,arg1, arg2);
                printf("tau/2=%1.3f ; 2*tau=%1.3f ; (Pi-tau)/2=%1.3f ; Pi-2*tau=%1.3f ; Pi-tau/2=%1.3f ; Pi+tau/2=%1.3f \n", tau/2,2*tau,(Pi-tau)/2,Pi-2*tau,Pi-tau/2,Pi+tau/2);
              );
      );
    if(imag(fab/fad)<0,return(-1),return(1));
}
/* TODO: check aligned points ... */
intersection(A,ia,ib,ic,id) = {
  \\ do we have a common point ?
  if(ia==ib||ic==id, 0,
    (ia==ic&&ib==id)||(ia==id&&ib==ic), 0,\\ self intersection
    ia!=ic&&ia!=id&&ib!=ic&&ib!=id,0,\\ no intersection
    ia==ic, +intersection_abad(A,ia,ib,ic,id),
    ib==ic, +intersection_abbd(A,ia,ib,ic,id),
    ia==id, -intersection_abbd(A,ic,id,ia,ib),
    ib==id, +intersection_abcb(A,ia,ib,ic,id),
    error("this intersection should not occur",[ia,ib,ic,id]);
    );
}
intersection_spanning(A,tree) = {
  n = #tree;
  res = matrix(n,n);
  for(i=1,#tree,
    for(j=i+1,#tree,
    s = intersection(A,tree[i][1],tree[i][2],tree[j][1],tree[j][2]);
    res[i,j] =  s;
    res[j,i] = -s;
    );
  );
  res;
}

/* *************************************************************************
 *  step 3 : period matrix of edges + intersection matrix
 * ************************************************************************* */
periods_spanning(C) = {
  my(g = C[iGenus]);
  my(tree = C[iTree]);
  my(A = C[iRoots]);
  if(1, /* forget about end points */
  Mat(vector(#tree,k,2*integrals_edge(C,tree[k][1],tree[k][2])[1]~));
  ,
  res = vector(#tree);
  endpointsvalues=vector(#tree);
  for(k=1,#tree,
    tmp = int_periods_affinereduction(A,tree[k][1],tree[k][2]);
    /* should use final values to find intersection if sure that no
     * crossing edges TODO */
    res[k] = 2*tmp[1]~;
    endpointsvalues[k] = [tmp[2],tmp[3]];
  );
  Mat(res);
  );
}

/* *************************************************************************
 *  step 4 : retrieve symplectic basis
 * ************************************************************************* */

/* assume M is invertible, antisymetric and of even dimension 2g */
symplectic_reduction(M) = {
  g=matsize(M)[1];
  if(g%2,return(0),g/=2);
  N = Vec(M); \\ columns matrices
  P = Vec(matid(2*g));
  /* algorithm similar to snf
     take minimal N[i,j] non-zero value above diagonal
     1. transform it to be the gcd over the line
     2. reduce lines i and j to have symplectic
        [0,1;-1,0] and zeroes outside
     3. move these in front
  the same operations are done on P to track
  the base change.
  */
  \\ find a non zero value;
  \\ TODO better to take minimum
    /* main loop on symplectic 2-subspaces */
    for(d = 1, g,
        if(1,
          my(res = Mat(vector(2*g,k,if(k<=g,P[2*k-1],P[2*(k-g)]))));
          \\print(res)
          \\print(Mat(N)); \\ FIXME
          );

        /* find a pivot value */
        i = 2*d-1; j = i+1;
        while(!N[j][i],
            print("i",i,"j",j,"->",N[j][i]);
            if(j++>2*g,j=i+++1);
          );
        \\ i and j give a and b
        if(N[j][i]<0,
           P[j] = -P[j];
           N[j] = -N[j];
           for(l=1,2*g,N[l][j] = -N[l][j]);
        );
        ii=i; jj=j;
        while(jj,
        \\print("d=",d," -> i=",i,"&j=",j);
        /* remove all coeffs on column j */
          for(k=2*d-1,2*g, \\ the column
            \\print("column ",k);
            if(k==jj||!N[k][ii],next()); \\ next if already zero
            \\print(Mat(N));
            if(N[k][ii]%N[jj][ii]==0,
              /* N[jj][ii] divides N[k][ii], set it to zero */
              my(q = N[k][ii]/N[jj][ii]);
              P[k] = P[k]-q*P[jj];
              N[k] = N[k]-q*N[jj];
              for(l=1,2*g,N[l][k] = N[l][k] - q*N[l][jj];);
              ,
              /* otherwise replace N[jj][ii] by the gcd */
              tmp = bezout(N[jj][ii],N[jj][k]);
              u = tmp[1]; v = tmp[2]; d = tmp[3];
              P[ii] = u*P[ii]+v*P[jj];
              N[ii] = u*N[ii]+v*N[jj];
              for(l=1,2*g,N[l][ii] = u*N[l][ii] + v*N[l][jj];);
              \\ now resume on N[jj][ii]
              k--
              );
            );
          if(jj>ii,ii=j;jj=i,jj=0);
  );
  /* and put the 2-2 symplectic at 2*d-1, 2*d */
  tmpN = N[2*d-1]; tmpP = P[2*d-1];
  N[2*d-1] = N[i]; P[2*d-1] = P[i];
  N[i] = tmpN; P[i] = tmpP;
  tmpN = N[2*d]; tmpP = P[2*d];
  N[2*d] = N[j]; P[2*d] = P[j];
  N[j] = tmpN; P[j]= tmpP;
  );
  /* and finally canonical basis */
  res = Mat(vector(2*g,k,if(k<=g,P[2*k-1],P[2*(k-g)])));
  \\print(mattranspose(res)*M*res);
  return(res);
}
/* inverse of a symplectic matrix */
symplectic_inverse(M) = {
  my(g = matsize(M)[1]/2);
  /* M=[A,B;C,D] -> M^(-1)=[D^t,-B^t,-C^t,A^t] */
  my(res=matrix(2*g,2*g));
  for(i=1,g,
    for(j=1,g,
      /* A block */
      res[i,j] = M[g+j,g+i];
      /* D block */
      res[g+i,g+j] = M[j,i];
      /* B block */
      res[i,g+j] = -M[g+j,i];
      /* C block */
      res[g+i,j] = -M[j,g+i];
   );
 );
return(res);
}

/* *************************************************************************
 *  put everything together
 * ************************************************************************* */

/** Remark on matrices conventions :
 during computations, the tree corresponds to a homology basis C_1,..C_2g ; we
have the canonical symplectic homology basis A_1,..A_g,B_1,..B_g. We compute
first the period matrix C whose columns are the periods of the canonical
differential forms along the paths C_j :

coh1x_homC =    C_1,   C_2g
               +-----------+
             1 |
             x |

Then we
compute the intersection matrix of C_j

IntC = C_1,   C_2g
     +-----------+
 C_1 |
 C_2 |

and we perform symplectic reduction to have the base change to a canonical
basis (which is not Mumford's in general)

ABtoC = A_1,  A_g,B_1  B_g
     +------------------+
C_1  |
...  |
C_2g |

satisfying :

(ABtoC)^t * IntC * ABtoC = J_g = intersection in (A,B) basis.

Now we have the big period matrix of canonical differentials in symplectic basis

coh1x_homAB = coh1x_homC*ABtoC = [ Omega_0 Omega_1 ]
    =      A_1,.. B_g
          +----------+
       1  |
      ... |
     x^g-1|

and we take the (A)-dual cohomology basis to have a Siegel tau matrix

cohWto1x = 1,x,.. x^g-1
          +------------+
       w_1|
       ...|
       w_g|

cohWto1x*Omega_0 = Id
cohWto1x*Omega_1 = tau = Omega_0^(-1)*Omega_1

As for Abel-Jacobi map : we compute it in the 1,x cohomology basis
and return its left-product by cohWto1x.

For Weierstrass points Pi, we compute half loops P0Pi in C_i basis

P0Pi = P0P1,... P0P2g+1  (one column is zero for Pi=P0)
      +--------------+
  C_1 |
  ... |

then in A,B basis

(ABtoC)^t * P0Pi

and finally return the integration

cohWto1x * coh1x_homAB * (ABtoC)^t * P0Pi
*/

/**
the period matrix is computed in some symplectic homology basis
determined during computations.
*/
hcperiods(f,flag) = {
  my(A);
  if(type(f)=="t_VEC",A=f,
     type(f)=="t_POL",A=polroots(f)
     );
  my(hcStruct = vector(iMax));
  my(Dcalc,g,tree,tau,h,npoints,IntFactor,IntPoints,AB,Intersection,P);
  my(Omega0,Omega1);
  if(type(A)=="t_POL",A = polroots(pol));
  g = floor((#A-1)/2);
  hcStruct[iRoots] = A;
  hcStruct[iGenus] = g;
  gettime();
  my(tmp = max_spanning(A,2*g));
  msgtimer("tree");
  hcStruct[iTree] =  tree = tmp[1];
  msgdebug(tree,"  ",2);
  /* compute big period matrix of periods C_1,..C_2g */
  coh1x_homC = periods_spanning(hcStruct);
  msgtimer("periods");
  msgdebug(coh1x_homC,"  ",2);
  /* intersection matrix of basis C_1,.. C_2g */
  IntC = intersection_spanning(A,tree);
  hcStruct[iIntersection] = IntC;
  msgtimer("intersection");
  msgdebug(IntC,"  ",2);
  /* column base change from (A_i,B_i) to C_i */
  /* that is, P^t * Intersection * P = J_g */
  ABtoC = symplectic_reduction(IntC);
  hcStruct[iABtoC] = ABtoC;
  /* change basis */
  /* put everything in the struct */
  coh1x_homAB = coh1x_homC * ABtoC; /* now matrix in (A,B) basis */
  Omega0 = vecextract(coh1x_homAB,Str("1..",g),Str("1..",g));
  Omega1 = vecextract(coh1x_homAB,Str("1..",g),Str(g+1,".."));
  if(flag==0, Omega1^(-1)*Omega0, /* default, tau matrix */
     flag==1, [Omega0,Omega1],
     error("unknown flag"));
}

/**
action of an Moebius transformation on x
*/

homog(H,pts) = {
  res = [];
  for(k=1,#pts,
    my(den = H[2,1]*pts[k]+H[2,2]);
    if(den,res = concat(res,(H[1,1]*pts[k]+H[1,2])/den));
     );
  \\ infinity ?
  if(#pts%2,res=concat(res,0));
  return(res);
  \\return(vector(#pts,k,(H[1,1]*pts[k]+H[1,2])/(H[2,1]*pts[k]+H[2,2])));
}
HS=[0,1;1,0];
HT=[1,1;0,1];
H1=[3,7;2,5];
H2=[8,-3;11,-4];
H3=[13,892;5,343];
H4=[1729,138; 213,17];

/** GL(g) action of a SL(2) moebius transform :
we decompose
(ax+b)/(cx+d) = (b-ad/c)/(cx+d) + a/c
i.e.
[a,b;c,d] = [b-a*d/c,a/c;0,1]*[0,1;1,0]*[c,d;0,1]
*/
/* left matrix corresponding to inversion [0,1;1,0] */
invert_mat(g) = {
  matrix(g,g,i,j,if(i+j==g+1,-1,0));
}
/* left matrix corresponding to homothety ax+b */
homot_mat(g,a,b,degree) = {
  matrix(g,g,i,j,if(i>=j,binomial(i-1,j-1)*a^j*b^(i-j)))/sqrt(a^degree);
}
moebius_matrix_old(m,g,degree) = {
  my(a = m[1,1]);
  my(b = m[1,2]);
  my(c = m[2,1]);
  my(d = m[2,2]);
  if(c,
  return(
homot_mat(g,b-a*d/c,a/c,degree)*invert_mat(g)*homot_mat(g,c,d,degree))
  ,
  if(d,
  return(homot_mat(g,a/d,b/d,degree))
  ,
  return(homot_mat(g,a,b,degree))
  ));

}
/* computed all at once */
moebius_matrix(m,g) = {
  my(a = m[1,1]);
  my(b = m[1,2]);
  my(c = m[2,1]);
  my(d = m[2,2]);
/* line k represents (ax+b)^k (cx+d)^(g-k-1) on basis 1,x,...x^{g-1} */
  P1=Pol([a,b]); P2=Pol([c,d]);
  lines = vector(g,kk,
  my(k=kk-1);
  P1^k*P2^(g-1-k)
 );
(a*d-b*c)*
matrix(g,g,k,l,
  polcoeff(lines[k],l-1)
);
}
/** action on the curve */
moebius_action(C,m) = {
  g = C[iGenus];
  A = C[iRoots];
  degree = #A;
  Omega0 = hcBigperiods(C);
  Omega1 = moebius_matrix(m,g)*Omega0;
  Omega2 = hcBigperiods(hcInit(homog(m,A)));
  print("Omega1=",Omega1);
  print("Omega2=",Omega2);
}

error: pathspec 'gp/gcperiods.gp' did not match any file(s) known to git


new script and clean up

new script and clean up

fatal: unable to access 'https://github.com/Mausy5043/bonediagd.git/': The requested URL returned error: 403


Provide defaults for the configure script of GSI-OpenSSH

#! /bin/sh
"${0%.gnu}" "$@" --without-zlib-version-check --with-ssl-engine --with-ipaddr-display --with-pam --without-kerberos5 --with-libedit --with-gsi --sysconfdir="\${prefix}/etc/gsissh"

error: pathspec 'gsi_openssh/source/configure.gnu' did not match any file(s) known to git


Add curve_tangent gnuplot file

Add curve_tangent gnuplot file

set view 0,0
set isosample 500,500
set contour base
set cntrparam levels discrete 0
unset surface
set grid
unset key
unset ztics
set xlabel ''
set ylabel ''

curve(x,y) = x**3 + -5*x + 9 - y**2
line(x,y) = (-0.188762*x)+3.42127 - y

set label at -1.1, 3.65, 0 " A" point pointtype 7 pointsize 1
set label at 2.23, 3.0, 0 " C" point pointtype 7 pointsize 1
set label at 2.23, -3.0, 0 " -C" point pointtype 7 pointsize 1

splot [-5:5][-5:5] curve(x,y), line(x,y)

pause -1

error: pathspec 'crypto/elliptic/curve_tangent.gp' did not match any file(s) known to git


add detial enegy plt

add detial enegy plt

set term pdfcairo
set output 'detail_energy.pdf'
#set pointtype 5
set xlabel "time"
set ylabel "energy"

plot "energy.dat"  u 1:2 w l,"energy.dat" u 1:4  w l

error: pathspec 'plot_scripts/detail_energy.plt' did not match any file(s) known to git


restore gp file

restore gp file

resultfile ="NE_3DS_3Knee_1Prism_MLCP.dat"
#resultfile ="NE_3DS_3Knee_1Prism_MLCP_D1MinusLinear.dat"

resultfile ="NE_3DS_3Knee_1Prism_MLCP_MoreauJeanCombinedProjection.dat"
set xrange [-0.1:3]
set yrange [-3:0.1]
#plot resultfile u 1:2
resultfile1 ="NE_3DS_3Knee_1Prism_MLCP_beam1.dat"
resultfile2 ="NE_3DS_3Knee_1Prism_MLCP_beam2.dat"
resultfile3 ="NE_3DS_3Knee_1Prism_MLCP_beam3.dat"
#resultfile1 ="NE_3DS_3Knee_1Prism_MLCP_D1MinusLinear_beam1.dat"
#resultfile2 ="NE_3DS_3Knee_1Prism_MLCP_D1MinusLinear_beam2.dat"
#resultfile3 ="NE_3DS_3Knee_1Prism_MLCP_D1MinusLinear_beam3.dat"
set label 1 sprintf("Siconos NewtonEulerDS simulation.")  at first 1.5 , first 0
i=0
plot resultfile1 u 3*i+1:3*i+3 w lp t 'beam1',  resultfile2 u 3*i+1:3*i+3 w lp t 'beam2',  resultfile3 u 3*i+1:3*i+3 w lp t 'beam3'
set term gif animate

outputfile="animatedbeams.gif"
#outputfile="animatedbeams_D1MinusLinear.gif"

set size square
set xrange [-0.1:3]
set yrange [-3:0.1]
set output outputfile
n=1000    #n frames
n=500
i=0
every=5

load "animbeam.gp"

error: pathspec 'Examples/Mechanics/JointsTests/NE_3DS_3Knee_1Prism.gp' did not match any file(s) known to git


Create grafica2linesShadow.gnu

Create grafica2linesShadow.gnu

the content of silver.data is:
20 60 130 135
30 60 78 81
40 60 58 60
50 60 52 57
60 60 50 57

## 14/07/09
## Aqui graficamos 2 lineas del umbral de saturación del protocolo
##

set terminal jpeg medium
set output "lost.jpeg"
#set term postscript eps color blacktext "Helvetica" 16

set xlabel 'message size (KBytes)'
set ylabel 'number of messages sent per second (#)'
set key bottom left
# set terminal pngcairo  transparent enhanced font "arial,10" fontscale 1.0 size 500, 350
# set output 'fillbetween.2.png'
set style fill 	pattern 2 border
set style data 	lines
set title "The threshold limit of message loss is reached with different message size"
set xrange [ 52 : 135 ] noreverse nowriteback
set yrange [ 0 : 58 ] noreverse nowriteback

### la una
#plot 'silver.dat' u 4:2:1 title "zone of lost" w filledcu, '' u 4:1 lt -1 notitle, '' u 4:2 lt -1 notitle

### la dos
#plot "silver.dat" u 3:1 title "no-lost" w linespoints, \
#     "silver.dat" u 4:1 title "lost" w linespoints

### el mix
## en fondo rojo
#plot "silver.dat" u 4:2:1 title "zone of lost" w filledcu, '' u 4:1 lt -1 notitle, '' u 4:2 lt -1 notitle, \
#	"silver.dat" u 3:1 title "lost" w linespoints

## en fondo verde
plot "silver.dat" u 3:1 title "free-loss limit" w linespoints, \
	"silver.dat" u 4:2:1 title "zone of lost" w filledcu, '' u 4:1 lt -1 notitle, '' u 4:2 lt -1 notitle

set output

error: pathspec 'grafica2linesShadow.gnu' did not match any file(s) known to git


* Added gnuplot file to greate a contour plot of the two formulas.

#!/usr/bin/gnuplot
set terminal pngcairo size 900,500 font "Arial,8"

use_SI = 1
use_old = 0

b0 = 2.828
b1 = 0.0000296
b2 = 0.006123
b3 = -0.008284
b4 = 0.1845
b5 = -0.1943

ale(L,G) = b0 + b1*G*G*L + b2*G*L + b3*G*G + b4*G + b5*L

usc_ale(L,G) = ale(L*2.54, G*2.54)/0.453592
usc_old(L,G) = G*G*L/800
old(L,G) = usc_old(L/2.54, G/2.54)*0.453592

set key noautotitle
set key outside right
set contour base
set view map
unset surface

if (use_SI) {
    set xrange [100 : 250]
    set yrange [50  : 140]
    set xlabel "Length (cm)"
    set ylabel "Girth (cm)"
    set key title "Weight (kg)"
    set cntrparam levels incremental 10, 10, 170
    if (use_old) {
        set title "Old formula"
        splot old(x,y)
    } else {
        set title "ALE formula"
        splot ale(x,y)
    }

} else {
    set xrange [40 : 90]
    set yrange [19 : 51]
    set xlabel "Length (in)"
    set ylabel "Girth (in)"
    set key title "Weight (lb)"
    set cntrparam levels incremental 30, 10, 270
    if (use_old) {
        set title "Old formula"
        splot usc_old(x,y)
    } else {
        set title "ALE formula"
        splot usc_ale(x,y)
    }

}

error: pathspec 'chart_card.gnuplot' did not match any file(s) known to git


More functions for listing primes where P+1 or ECM have smooth order.
Cleanup TBD

git-svn-id: 189946a10c5fc96e9dd03ba7cba917cd4c3d09f4@2193 de4796e2-0b1e-0410-91b4-86bc23549317

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/mancoast/cado-nfs.git/'


Add gnuplot config

Add gnuplot config

set samples 3000
set colorsequence classic

error: pathspec '.config/.gnuplot' did not match any file(s) known to git


Add memory graphing script

Add memory graphing script

# gnuplot script file for plotting memory usage over time
#!/usr/bin/gnuplot
reset

set terminal unknown

set xdata time
set timefmt "%s"
set format x "%H:%M:%S"

plot "/home/minecraft/memorylogs/memorylog.dat" using 1:2 title "Minnebruk"
set xlabel "Tid/dato"
set ylabel "Minnebruk"

set ytics 200
#set xtics 1000

xspan = GPVAL_DATA_X_MAX - GPVAL_DATA_X_MIN
yspan = GPVAL_DATA_Y_MAX - GPVAL_DATA_Y_MIN

xequiv = 60
yequiv = 100
ar = yspan/xspan * xequiv/yequiv

ydim = 1080
xdim = 200/ar

set xrange [GPVAL_DATA_X_MIN:GPVAL_DATA_X_MAX+200]
set yrange [GPVAL_DATA_Y_MIN:GPVAL_DATA_Y_MAX]

set terminal png size xdim,ydim
set size ratio ar
set style data linespoints

set title "Minnebruk over tid"
set key below
set grid

plot "/home/minecraft/memorylogs/memorylog.dat" using 1:2 title "Minnebruk"

error: pathspec 'scripts/creategraph.gp' did not match any file(s) known to git


FFT plot file for gnuplot

FFT plot file for gnuplot

set datafile separator ","

set pm3d map
set xlabel "Frequency"
set ylabel "Time Step"

splot "healthy_person1_fft_converted.csv" matrix

error: pathspec 'data/fft_plot.plt' did not match any file(s) known to git


Add gnuplot script to generate plots

Add gnuplot script to generate plots

I still need to find out if these plots are correct ...

# gnuplot script for p1c and p1d

# global
set terminal png
unset key
set ylabel "Number of Packets"

# minutes
set title "Packet Timing by Minute"
set xlabel "Time (minutes)"
set output "by_minute.png"
plot "binned_data_m.txt" using 1:2 with impulses

# seconds
set title "Packet Timing by Second"
set xlabel "Time (seconds)"
set output "by_second.png"
plot "binned_data_s.txt" using 1:2 with impulses

# milliseconds
set title "Packet Timing by Millisecond"
set xlabel "Time (milliseconds)"
set output "by_millisecond.png"
plot "binned_data_ms.txt" using 1:2 with impulses

# CDF
set title "Packet Size Distribution"
set xlabel "Packet Size (Bytes)"
set ylabel "Frequency"
set output "cdf.png"
plot "frequency_data.txt" using 1:2 smooth cumulative

error: pathspec 'proj2/plots.gp' did not match any file(s) known to git


initial gnuplot file

initial gnuplot file

set terminal png medium size 800, 500
set output "linux-statistics.png"

set style data lines

set grid x y
set border
plot 'linux-statistics.txt' using 2:xticlabels(1) t 'size (M)'
#     'linux-statistics.txt' using 1:3 t 'number of files'

error: pathspec 'linux-statistics.gnuplot' did not match any file(s) known to git


gnuplot script for plotting yield stress profiles

set datafile separator ","

# set terminal pngcairo \
#   transparent enhanced font "arial,14" fontscale 1.0 size 1600, 1200
set key right box

set title 'Velocity profiles'
set ylabel 'u (lat unit / sec)'
set xlabel 'y (lat unit)'
# set output 'yield-stress.png'
plot \
    'data/bingham-mrt_5000_500_20_006_000008/prof-at-250_step-4000.dsv' \
			using 1:2 title 'nu=0.06, tau_y=8e-6', \
    'data/bingham-mrt_5000_500_20_006_000016/prof-at-250_step-4000.dsv' \
			using 1:2 title 'nu=0.06, tau_y=16e-6', \
		'data/bingham-mrt_5000_500_20_006_000032/prof-at-250_step-4000.dsv' \
			using 1:2 title 'nu=0.06, tau_y=32e-6', \
		'data/bingham-mrt_5000_500_20_006_000064/prof-at-250_step-4000.dsv' \
			using 1:2 title 'nu=0.06, tau_y=64e-6'

error: pathspec 'scripts/plot_profiles_yield-stress.gp' did not match any file(s) known to git


Add divergence.gnuplot

Add divergence.gnuplot

# Note you need gnuplot 4.4 for the pdfcairo terminal.

# set terminal pdfcairo font "Gill Sans,9" linewidth 4 rounded fontscale 1.0
set terminal pdfcairo font "Gill Sans,7" linewidth 1 rounded fontscale 1.0

# Line style for axes
set style line 80 lt rgb "#808080"

# Line style for grid
set style line 81 lt 0  # dashed
set style line 81 lt rgb "#808080"  # grey

set grid back linestyle 81
set border 3 back linestyle 80

set style line 1 lc rgb "#A00000" lw 2 pt 7 ps 0.5
set style line 2 lc rgb "#00A000" lw 2 pt 7 ps 0.5
set style line 3 lc rgb "#5060D0" lw 2 pt 7 ps 0.5

set output outputname
set xlabel "Clients"
set ylabel "Divergence"

set key bottom right

# set yrange [0:*]

# Titles with spaces are not allowed
# These titles should be separated by "_" and here we replace by " "
pretty(title) = system("echo ".title." | sed 's/_/ /g'")

# Input file contains comma-separated values fields
set datafile separator ","

plot for [i=0:words(inputnames) - 1] word(inputnames, i + 1) using 1:2 title pretty(word(titles, i + 1)) with linespoints ls i + 1

error: pathspec 'divergence.gnuplot' did not match any file(s) known to git


common part of the subdir rules used by the new GNUmakefile

git-svn-id: 69a08f0be502e23ba71eb4e212ee2948ff83149c@301 4e380d45-d1fd-0310-85a7-d18ec86df0ad

include ../make.settings

TEST_BINARIES	 = $(TESTS:=.$(bin))

tests: $(TEST_BINARIES)

lib: $(LIB_SRC:.cpp=.$o)

clean::
	$(RM) *.$o
	$(RM) *.d *.dT
	$(RM) $(TEST_BINARIES)

-include *.d

.SECONDARY:

error: pathspec 'Makefile.subdir.gnu' did not match any file(s) known to git


new graph14 for testing

new graph14 for testing

fatal: unable to access 'https://github.com/Mausy5043/lnxdiagd.git/': The requested URL returned error: 403


Added plotfile for safe keeping.

Added plotfile for safe keeping.

fatal: unable to access 'https://github.com/lagerspetz/TimeSeriesSpark.git/': The requested URL returned error: 403


Add tests for bson super module.

Add tests for bson super module.

:- include(misc(common)).

:- begin_tests('bson:term_bson/2').

test('nonvar, nonvar') :-
    Term =
    [
        hello: 32
    ],
    Bson =
    [
        xxx_not_impl,0,0,0, % Length of top doc.
        0x10, % Int32 tag
            104,101,108,108,111, 0, % Ename "hello\0".
            32,0,0,0, % Int32 data, 32.
        0 % End of top doc.
    ],
    bson:term_bson(Term, Bson).

/* XXX Fix when implemented encoder.
test('nonvar, var', [true(Got == Expected)]) :-
    Term =
    [
        hello: 32
    ],
    Expected =
    [
        xxx_not_impl,0,0,0, % Length of top doc.
        0x10, % Int32 tag
            104,101,108,108,111, 0, % Ename "hello\0".
            32,0,0,0, % Int32 data, 32.
        0 % End of top doc.
    ],
    bson:term_bson(Term, Got).
*/

test('var, nonvar', [true(Got == Expected)]) :-
    Expected =
    [
        hello: 32
    ],
    Bson =
    [
        xxx_not_impl,0,0,0, % Length of top doc.
        0x10, % Int32 tag
            104,101,108,108,111, 0, % Ename "hello\0".
            32,0,0,0, % Int32 data, 32.
        0 % End of top doc.
    ],
    bson:term_bson(Got, Bson).

test('var, var', [fail]) :-
    bson:term_bson(_, _).

:- end_tests('bson:term_bson/2').

error: pathspec 'src/bson/bson.plt' did not match any file(s) known to git


Create command.gp

Create command.gp

error: pathspec 'exemplier/6_interprocess/signal/command.gp' did not match any file(s) known to git


class_path UT

class_path UT

:- begin_tests(class_diagram).
:- use_module(u(class_diagram)).

test(class_path, all(PAs == [[man_v, citizen_v, callup_v]])) :-
   class_path(man_v, callup_v, true, PAs).

:- end_tests(class_diagram).

error: pathspec 'U-238/u/class_diagram.plt' did not match any file(s) known to git


adding barnsley information from thinkercon

do for [t=0:100] {
    plot for [ind=0:t] "barnsley.dat" i ind notitle pointtype 15 pointsize 0.2
    pause 0.1
}

error: pathspec 'fractal/plot_barnsley.gp' did not match any file(s) known to git