Category : BASIC Source Code
Archive   : UBAS830.ZIP
Filename : RATDEP.UB

 
Output of file : RATDEP.UB contained in archive : UBAS830.ZIP
7
˜ä See end of listing for a program description.
r§"decimals after point"ÁPÀPÑñ݀܁Pæñ.ñ)
ŽŸ€àñÂñåP)À©P
Ê(DрÆñ æP)À™"Maximal dimension set to "ÁDÝñ
2¤„RD)„BDD)„MDD)„VD)˜È
used by main algorithm
]<¤„XD)„YD)„ZD)˜
 used by *SEARCH
mFƒPPÑð.ñ
¦PƒPsÑñ˜\ Display width for printing coefficients
¯Z˜
¾dˆõMENUó
Ön¸ÿÿÀˆõCHOICEÓó¹t
ßx˜
‚õMENU™"1: Input data to check for linear dependence"
bΪ"2: Input datum to test for algebraicity (previous value is x)"
€–™"3: Run form reduction"
¢ ™"4: Look for short vectors"
Ъ™"5: Change display width and redisplay"
Ù´˜†
¾õCHOICE§"CHOICE (0 for menu)"ÁƒAÀÄƒAÑð‡õMENU|
3ȍàƒAÑñ‡õLINEAR
LҍùƒAÑñ‡õALGÀ
s܍ ƒDTÑðŽ™"No data."À‡õCHOICEu

æ:ƒAÑñ‡õINITÖ
ÍðƒAÑñŽoƒRDÑð™"First run reduction!"‡õSEARCHš
úƒAÑñŽ™"Width (Current is"ÁƒPsÁ")"ÁÀ§ƒPsÀ‡õHowbig?
‡õCHOICEg

)˜
9õLINEAR
h"§"Number of entries (n=0 to return)"ÁM
Š,€èMÔñMҁD}Ž•
Õ6NсMÞñÀƒRDÑðÀƒDTÑðÀ‰ƒIÑðŠNÀ™"X("ÁƒIÁ") ="ÁÀ§„RƒI)
ë@„RƒI)ÑðŽ•
ýJŒÀƒDTÑñÀ•
T˜
/^õALG§"Degree"ÁMÀÜMÔñŽ•
bhNсMÀƒRDÑðÀƒDTÑðÀ§"X"ÁƒXÀƒXÑðŽ•
r€ÀƒX)ÒñŽ§"|X|<=1 is best. Invert X (0/1)"ÁƒI
Ç|ÀtƒIŽƒXÑñæƒXÀ™"X inverted"
†„Rð)ÑñÀ‰ƒIÑðŠNÞñÀ„RƒIÝñ)фRƒI)åƒXÀŒÀƒDTÑñÀ•
˜
)šõINIT
o¤™"Parameter (best <"Á€Üñ .ñåP)Á"; see comments. 0 exits)"Á
–®§ƒRQÀ6ƒRQÑðŽ•ƒRQÑñ
ïƒRQ
Ÿ¸˜L
­ÂƒRrÑñ
Ç̨¢„MðÁNÂðÁN)
Ö„Vð)р´„Rð))ïñ݀µ„Rð))ïñÀ„Vñ)рµ„Rð)倳„Rñ)))
Nà‰ƒJÑñŠNÀ„MƒJÂð)р´„Rð)倳„RƒJ)))æ„Vð)ÀŒ
”êA„Vñ)ÑðŽ„Vñ)ÑñÀ™"Assuming real entries. "ÀƒRrÑðÀ¶
Øô‰ƒJÑñŠNÀ„MƒJÂñ)рµ„Rð)倳„RƒJ)))æ„Vñ)ÀŒ
ÿþ„Vñ)фVñ)ïñæ„Vð)åƒRQ
·À„Vð)фVð)åƒRQ
=‰ƒJÑñŠNÀ„VƒJ)ÑñÀŒ
y¨¢„BðÁNÂðÁN)À‰ƒIÑðŠNÀ„BƒIƒI)ÑñÀŒ
‚&˜/
˜0ƒKÑñÀ‡õR1&

:õR2ƒMфMƒKƒKÞñ)ÀƒVфVƒK)݃MåƒMå„VƒKÞñ)À„MƒKƒKÞñ)уMå„VƒKÞñ)æƒV
L D„VƒK)фVƒKÞñ)å„VƒK)æƒVÀ„VƒKÞñ)уV
z N¥¢„BƒKÂðÁN)¢„BƒKÞñÂðÁN)
¼ XiƒKÒñŽ¥¢„MƒKÂðÃKÞñ)¢„MƒKÞñÂðÃKÞñ)
Õ b‰ƒIуKÝñŠN
V
lƒVфMƒIƒK)À„MƒIƒK)фMƒIƒKÞñ)ރMåƒVÀ„MƒIƒKÞñ)уV݄MƒKƒKÞñ)å„MƒIƒK)ÀŒ
m
vƒKÒñŽ¡ƒK
Ž
€õR1ƒLуKÞñÀˆõR3ÿò
à
Š„VƒK)æ„VƒKÞñ)݄MƒKƒKÞñ)å„MƒKƒKÞñ)ԃPP‡õR2Q
 ”‰ƒLуKÞñŠð‹ÞñÀˆõR3ÿòŒƒL
' ž ƒKÀÔƒKՁN‡õR1&
q ¨ƒRDÑñÀ‡õHOWBIG?˜ This is the exit line.
™ ²õR3F€À„MƒKƒL))Õð.ñŽ•
» ¼ƒRрÜð.ñ݄MƒKƒL))
 ƉƒIÑðŠNÀ„BƒKƒI)фBƒKƒI)ރRå„BƒLƒI)ÀŒƒI
r ЄMƒKƒL)фMƒKƒL)ރRÀ‰ƒIÑðŠƒLÞñÀ„MƒKƒI)фMƒKƒI)ރRå„MƒLƒI)ÀŒ
y Ú•
‚ ä˜
Ê îõHOWBIG™" coefficients | value of linear comb. | value of form"


ø‰ƒIÑðŠNÀ¨ƒAFƒAÀ‰ƒJÑðŠNÀ™€ìƒPs)„BƒIƒJ)Á
e
ƒAуA݄BƒIƒJ)å„RƒJ)ÀƒAFуAF݄BƒIƒJ)å„BƒIƒJ)ÀŒÀ™"|"Á
~
ˆõPRgó(ƒA)À™"|"Á
Ë
ˆõPRgó(ƒAF݃RQå€ÀƒA)ïñބBƒIÂð)ïñރRrå„BƒIÂñ)ïñ)À™
Ô
ŒÀ•
Ý
*˜
4õSEARCHƒKсNÀ¨„YN)„ZN)ƒNN
W>§"Search up to square length (try v(0) for shortest vector)"ÁƒTT
˜H§"Print vectors (0/1)"ÁSÀSŽ™"vector | len. | form"
¥R‡õS1 
\õS0¡ƒKÀ„ZƒK)ÑðÀ‰ƒIуKÝñŠNÀ„ZƒK)фZƒK)݄MƒIƒK)å„XƒI)ÀŒ
Rf„YƒK)фYƒKÝñ)݄VƒKÝñ)å(„XƒKÝñ)݄ZƒKÝñ))ïñ
’põS1„XƒK)р܀Å(ƒTTބYƒK))æ„VƒK))ބZƒK))
èzõS2•„VƒK)å(„XƒK)݄ZƒK))ïñ҃TTބYƒK)À ƒKÀ¡„XƒK)À‘L
„˜Æif K=N%+1 then print "ERROR":stop:return
-ŽÚƒK‡õS0^
{˜0€èõ„Xð)„Yð)}ÞñŽ™ñåƒNNÁ"nonzero vectors up to"Á€ìÂñ)ƒTT
Ģ˥
Û¬SŽƒAFÑðÀ‰ƒIÑðŠNÀƒAÑðÀ‰ƒJÑðŠNÀƒAуA݄XƒJ)å„BƒJƒI)
¶ÀŒÀ™€ìƒPs)ƒAÁÀƒAFуAF݃Aå„RƒI)
'ÀÀŒÀ™"|"ÁÀˆõPRgó(ƒAF)
`ÊÀ™"|"ÁÀˆõPRgó(„Vð)å(„Xð)݄Zð))ïñ݄Yð))À™
~Ô ƒNNÀ¡„XƒK)À‡õS2K
‡Þ˜
™èõPR(ƒPR)
¤òºƒPE
¾üƒPEÑðÀkƒPRÑðŽ¶
òŸ€ÀƒPR)Óñ
ÀƒPRуPRæñ
ÀƒPEуPEÝñÀ‘r
&Ó€ÀƒPR)ÔñÀƒPRуPRåñ
ÀƒPEуPEÞñÀ‘¦
P·À™€ìñÂñ)ƒPRÁ" E"Á€ìñ)ƒPEÁ
W$•
`.˜
ª8˜ This program uses the reduction algorithm of Lengstra, Lengstra,
öB˜ Lovasz (Math. Ann. 261 (1982) 515-534) to obtain a "reduced basis"
BL˜ for the following bilinear form over Z, (N is a large parameter):
KV˜
“`˜ q(a0, ... ,an) = a2^2+a3^2+...+an^2+N*abs(z0*a0+...+zn*an)^2
œj˜
æt˜ This tests integral dependence of the complex numbers z0,...,zn,
3~˜ since a short vector for the form makes z0*a0+...+zn*an very small.
}ˆ˜ To test if a number z is algebraic, zi=z^i is used in the above.
†’˜
Ìœ˜ If z0/z1 is real the program assumes the zi are ALL real and
ü¦˜ uses the following form Q instead of q
°˜
Eº˜ Q(a0, ... ,an) = a1^2+...+an^2+N*(z0*a0+...+zn*an)^2
NĘ
šÎ˜ A search algorithm is included to find short vectors for the form.
£Ø˜
â☠The program prompts for a parameter RQ. N is 10^RQ.
ëì˜
8ö˜ Suggested values (assuming the zi are not too far from 1): To find
€˜ ai bounded by 10^c you will need a bit more than n*c digits of
Ë
˜ accuracy for the zi. Try RQ around n*c (2*n*c in the real case),
˜ but below 2*(number of digits carried) to limit roundoff error.
˜
j(˜ Running time is roughly proportional to RQ*(n-1)^2 for given POINT.
¬2˜ Thus, with POINT and RQ optimized for for given c and n,
á<˜ it is very roughly proportional to c^3*n^5.
.F˜ W.D. Neumann


  3 Responses to “Category : BASIC Source Code
Archive   : UBAS830.ZIP
Filename : RATDEP.UB

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/