¿ìËÙÇóaµÄb´ÎÃݶÔcÈ¡Óà
¿ìËÙÃÝÈ¡Ä£ÀíÂÛ»ù´¡£º ¼ÆËã a^b mod c ?
ÓÉ(a x b) mod c=((a mod c) x b) mod c.
ÎÒÃÇ¿ÉÒÔ½« bÏȱíʾ³É¾Í£º
b=at2^t+at-1 2^t-1+……a02^0. (ai=[0,1]).
ÕâÑùÎÒÃÇÓÉ a^b mod c=(a^(at2^t+at-12^t-1+…a02^0)mod c.
È»¶øÎÒÃÇÇó a^(2^(i+1))mod c=((a^(2^i))mod c)^2 mod c .ÇóµÃ¡£
¿ìËÙÃÝÈ¡ÓàµÄ³ÌÐò£º
long long BigMod(long long a,long long p,long long m) //a^p%m
{
if (a==0 || m==1)
return 0;
if (p==0)
return 1;
if (p%2)
return ((a%m)*BigMod(a,p-1,m))%m;
long long tmp=BigMod(a,p/2,m);
return (tmp*tmp)%m;
}
Ïà¹ØÎĵµ£º
½ñÌì¿´K&RµÄÊéµÄʱºò˳±ãÎÂÏ°ÁËCµÄÁíÒ»ÖØÒªÊý¾Ý½á¹¹bit-fields£¬ÎÒÏëbit-fieldsÔÚ±àдµ×²ãÇý¶¯
Çý¶¯³ÌÐòµÄʱºòÓ¦¸Ã±È½ÏºÃÓã¬Ëü¿ÉÒÔÈÆ¿ª"&"ºÍ"|"½øÐÐλ²Ù×÷£¬¶øÇÒ¸ü¼Ó½ÚÔ¼ÄÚ´æ¿Õ¼ä¡£·Ï»°²»¶à˵
ÁË£¬»¹ÊÇÏÈÀ´¿´¿´ËüµÄÕæÃæÄ¿°É£º
bit-fieldÀ´Ô´:
bit-fieldÊÇΪÁ˽ÚÔ¼´æ´¢¿Õ¼ä¶ø´´ÔìµÄÒ»ÖÖÊý¾ ......
ÉèÖãº
1. Tools/Projects and Solutions/VC ++ Directories
Inlcude files: C:\Program Files\MATLAB\R2009a\extern\include
Library files: C:\Program Files\MATLAB\R2009a\extern\lib
2. Property
Configuration Properties/Linker
......
Ö¸Õë,ÖÚËùÖÜÖª,ʱΪһÄÚ´æµØÖ·.Å׿ªOS¼¶±ð»ò¸üµÍµÄÓ²¼þ¼¶±ð²»Ëµ,½ö¶ÔÓ¦ÓÃÄÚµÄʹÓýøÐÐССµÄÒܲâÌÖÂÛ.
Ê×ÏÈ,ÔÚÓ¦ÓÃÄÚ,ÓÃmallocÉêÇëµ½µÄÒ»¿éµØÖ·Ó¦¸ÃÊÇÁ¬ÐøµÄ(²Â²â,Âß¼ÉÏÁ¬Ðø,ʵ¼ÊÉÏÎïÀíÈçºÎ·Ö²¼²»Óè¹Ø×¢).
Æä´Î,Êý¾Ý´æÔÚÔÚÄÚ´æÖж¼ÊÇÒÔ2½øÖÆÐÎʽ´æ·Å.²»´æÔÚÊý¾ÝÀàÐÍ,Òò´Ë,¶ÔÄÚ´æÊý¾ÝµÄ²Ù×÷,Ö»Òª×ñѽø³öÀàÐÍÒ»Ö¼´¿É.
´ ......
int svd(int m,int n,int withu,int withv,double eps,double tol,
double *a, double *q, double *u, double *v, double *vt)
{
int i,j,k,l,l1,iter,retval;
double c,f,g,h,s,x,y,z;
double *e;
e = (double *)calloc(n,sizeof(double));
retval = 0;
/* Cop ......
1.CÓïÑÔÖУ¬long±»´æ´¢ÎªËĸö×ֽڵIJ¹Â롣дһ¸ö³ÌÐò£¬·Ö±ð½«ÕâËĸö×Ö½ÚµÄÄÚÈÝÈ¡³ö£¬ÒÔ16½øÖƵķ½Ê½ÏÔʾÔÚÆÁÄ»ÉÏ¡£³ÌÐòËùÐèµÄlongÓÉÓû§´Ó¼üÅÌÊäÈ룬0±íʾÊäÈë½áÊø¡£
³ÌÐòÔËÐÐЧ¹ûÈçÏ£º
input n: 12345678<»Ø³µ>
hex: 00 BC 61 4E
input
n: -12345678<»Ø³µ>
hex: FF 43 9E B2
input n: 0<»Ø³µ& ......