File: affect.gp

package info (click to toggle)
gp2c 0.0.14pl1-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 3,180 kB
  • sloc: ansic: 8,608; sh: 1,630; lex: 347; yacc: 227; makefile: 107
file content (25 lines) | stat: -rw-r--r-- 648 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
f(x)=
{
	local(v,i=0,j:small=0);
	v=vector(x);
	m=matpascal(x);
	while(i<x,
		v[i++]++;
		m[j++,j]+=i);
	[v,m]
}
g(x,y)=x[2]=3;y[1,1]++;[x,y]
h(x,y)=if(y>0,x,y)
th()=local(V=vector(5,i,i));vector(5,i,h(V[i],i-1))
ml(x)=local(a=x^2+1,b=a^2+1,c=b^2+1);c^2+1
col(x,a,v)=x[,if(a<=0,print("a is too small");return,a)]=v;x
lin(x,a,v)=x[if(a<=0,error("a is too small"),a),]=v;x
tr(v)=truncate(Pi,&v[1]);v
H1(n)=GA[n]=1
H2()=truncate(Pi,&GB[1])
H3(n)=GC[n]+=1
global(seed:small=0);
gp2crand31()=seed=bitand(1000276549*seed:int+12347,(1<<31)-1);
gp2crand(N)=local(p);while(p<N,p=(p<<31)+gp2crand31());p%N
randprime(N)=nextprime(gp2crand(2^N))
\\end of file