![]() |
|
|
#2113 | |
|
Aug 2006
3·1,993 Posts |
Quote:
Code:
foo()="bar"; addhelp(foo, "foo(): Bar.") ?foo |
|
|
|
|
|
|
#2114 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
if works but I can't get it to work if i save it in file like that I bet. ? how'd it work I couldn't get mine to work grrr. I bet I messed up. also can you save vectors in file and call them back ? I can't get it or I'd save the MPE's it might save me a while lol. got it thanks again you are very useful.
Last fiddled with by science_man_88 on 2011-01-29 at 22:47 |
|
|
|
|
|
#2115 |
|
Aug 2006
10111010110112 Posts |
|
|
|
|
|
|
#2116 |
|
May 2004
New York City
108B16 Posts |
To sm88: are you working on mersennes, perfects, abundants,
deficients, aliquots, riesels, sierpinskis, and brilliants too? They are intimately connected. Why not give us your versions of their definitions, just for fun. |
|
|
|
|
|
#2117 |
|
May 2004
New York City
423510 Posts |
How does one run pari?
|
|
|
|
|
|
#2118 | |
|
May 2004
New York City
423510 Posts |
Quote:
Re-think your whole programming methodology. |
|
|
|
|
|
|
#2119 |
|
Aug 2006
3·1,993 Posts |
Download the binary at
http://pari.math.u-bordeaux.fr/ (or use your package manager, if on *nix) and run. |
|
|
|
|
|
#2120 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
CRG do you think I'm able enough in PARI to attempt the BWT algorithm of encoding ? it uses RLE and I've coded that. the main hard part is remembering all the vector alteration codes. I have to rotate through all combinations ( putting them in a vector may help) then I'd have to vecsort, alphabetically then take the last character of each element in the vector and then perform RLE. I also have to have a state so I can tell if compression or decompression is wanted I could use a variable there. I think the decompression si the hard part and I don't know if I ever tried decompression for RLE.
|
|
|
|
|
|
#2121 |
|
"Forget I exist"
Jul 2009
Dumbassville
20C016 Posts |
hi is there a way in PARI to tell a function to only accept vectors and rename them to use them in the script I'm working on something of a aredisjoint(A,B) script. but I want the arguments to be treated as vectors:
Code:
aredisjoint(A,B) = a=0;for(i=1,#A,for(j=1,#B,if(A[i]==B[j],return(0),a=a+1;if(a==#A,return(1))))) Last fiddled with by science_man_88 on 2011-02-04 at 14:21 |
|
|
|
|
|
#2122 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
final script with one other change and I get:
Code:
aredisjoint(A=[],B=[]) = if(#A!=0 && #B!=0,a=0;for(i=1,#A,for(j=1,#B,if(A[i]==B[j],return(0),a=a+1;if(a==#A*#B,return(1))))),return(0)) |
|
|
|
|
|
#2123 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
Code:
ispd(C) = b=0;for(i=1,#C,for(j=1,#C,if(i!=j && aredisjoint(C[i],C[j]),b=b+1)));if(b==#C*#C-#C,return(1),return(0)) |
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why do I sometimes see all the <> formatting commands when I quote or edit? | cheesehead | Forum Feedback | 3 | 2013-05-25 12:56 |
| Passing commands to PARI on Windows | James Heinrich | Software | 2 | 2012-05-13 19:19 |
| Ubiquity commands | Mini-Geek | Aliquot Sequences | 1 | 2009-09-22 19:33 |
| 64-bit Pari? | CRGreathouse | Software | 2 | 2009-03-13 04:22 |
| Are these commands correct? | jasong | Linux | 2 | 2007-10-18 23:40 |