- scl.cpt [c+]
[..] La conception [scl] prouhethuemorsescl
Code
int prouhethuemorse_cpt(){
scltracefa(§, ƒ, ∅);
scltracefc("scl-%s (%s) : %s\n", sclver(), sclsec(), temps_char(0));
prouhethuemorse_cpt(2);
prouhethuemorse_cpt(4);
prouhethuemorse_cpt(8);
scltracefe(§, ƒ, ∅);
return 0;
}
/* ƒ décorée par
le 08-03-2025 08:06:31 */
int prouhethuemorse_cpt(double phi_deg){
scltracefa(§, ƒ, ∅);
scltracefc("scl-%s (%s) : %s\n", sclver(), sclsec(), temps_char(0));
int pn = 6;
int mn = 1<<pn; // 2^6=64
int dn=2*pn/*log(mn^2)/log(2)*/, di;
double *q=new double[1]; q[0]=0; int qn=1, qi;
double *r=∅; int rn=0, re=0;
// Génération de la séquence
for (di=0;di<dn;di++){
r=∅; rn = 0; re=0;
for (qi=0;qi<qn;qi++){
if (q[qi]>0){
// r = { r, 1, 0 }
queuetab<double>(&rn, &r, &re, 1);
queuetab<double>(&rn, &r, &re, 0);
}
else{
// r = { r, 0, 1 }
queuetab<double>(&rn, &r, &re, 0);
queuetab<double>(&rn, &r, &re, 1);
}
}
delete[] q; q=r; qn=rn;
}
double **mr = matresse<double>(mn, mn, r);
scl::string_c imgname=scl::string_c(ƒ)+".pdf",
imgpath="./srt/"+imgname;
grafmat_dis(imgpath.c_str(), mn, mn, mr, "axis", "equal",
"colormap", "rhiver", "linespeca", "-a", ∅);
// Facteur de suréchantillonnage
int en = (int)round(√(107)/((double)mn));
int xn=mn*en, yn=mn*en, xi, yi;
double **rmat=newmat<double>(xn, yn);
for(xi=0;xi<xn;xi++){
for(yi=0;yi<yn;yi++){
rmat[xi][yi]=mr[xi/en][yi/en];
}
}
// Rotations
int xr, yr;
void **trn = tournemat(xn, yn, rmat, phi_deg, 1, 1, &xr, &yr);
double **rmatplus = (double**)trn[0]; int **rinplus = (int**)trn[1];
/*delete[] */free(trn);
/* */trn = tournemat(xn, yn, rmat,-phi_deg, 1, 1, &xr, &yr);
double **rmatmnus = (double**)trn[0]; int **rinmnus = (int**)trn[1];
scltracefc("xn: %d, yn: %d, xr: %d, yr: %d\n",
xn, yn, xr, yr);
// Superposition (plus xor mnus)
double cp, cm, cr; int ir;
for(xi=0;xi<xr;xi++){
for(yi=0;yi<yr;yi++){
cp = /*ceil*/(rmatplus[xi][yi]);
cm = /*ceil*/(rmatmnus[xi][yi]);
/*if(cp>1.0){ cp=1.0; } if(cm>1.0){ cm=1.0; }*/
if(rinplus[xi][yi]>0){
if(rinmnus[xi][yi]>0){ cr=cp+cm; }
else{ cr=cp; }
}
else{
if(rinmnus[xi][yi]>0){ cr=cm; }
else{ cr=0; }
}
ir = ((int)round(cr))%2;
rmatplus[xi][yi] = (double)ir;
}
}
imgname.clear();
imgname=scl::string_c(ƒ)+"_"+num_str<double>(phi_deg)+".pdf";
imgpath.clear(); imgpath="./srt/"+imgname;
grafmat_dis(imgpath.c_str(), xr, yr, rmatplus, /*"instatus", rinp2,*/
"axis", "equal", "axis", "off", "linespeca", "-a",
"colormap", "rhiver", ∅);
//--------------------------------------------------------------------------
//[>LIBERE MEMOIRE]
//--------------------------------------------------------------------------
deletemat<int>(xr, &rinmnus); deletemat<double>(xr, &rmatmnus);
deletemat<int>(xr, &rinplus); deletemat<double>(xr, &rmatplus);
deletemat<double>(xn, &rmat);
delete[] mr;
//--------------------------------------------------------------------------
//[<LIBERE MEMOIRE]
//--------------------------------------------------------------------------
scltracefe(§, ƒ, ∅);
return 0;
}
/* ƒ décorée par
le 08-03-2025 08:06:32 */
Sortie
[>..\cpt\src\scl.cpt.cpp.prouhethuemorse_cpt]
scl-25.03 (gwin64) : 08-03-2025 08:06:32
[>..\cpt\src\scl.cpt.cpp.prouhethuemorse_cpt]
scl-25.03 (gwin64) : 08-03-2025 08:06:32
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<< END OF DISLIN / VERSION 11.3.2 <<
<< Date : 08.03.2025 Time : 08:06:32 Pageformat: DA4L <<
<< Vectors : 82 Warnings: 0 Fileformat: PDF <<
<< Metafile: ./srt/prouhethuemorse_cpt.pdf <<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
xn: 3136, yn: 3136, xr: 3244, yr: 3244
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<< END OF DISLIN / VERSION 11.3.2 <<
<< Date : 08.03.2025 Time : 08:07:00 Pageformat: DA4L <<
<< Vectors : 12 Warnings: 0 Fileformat: PDF <<
<< Metafile: ./srt/prouhethuemorse_cpt_2.pdf <<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[<..\cpt\src\scl.cpt.cpp.prouhethuemorse_cpt]
[>..\cpt\src\scl.cpt.cpp.prouhethuemorse_cpt]
scl-25.03 (gwin64) : 08-03-2025 08:07:00
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<< END OF DISLIN / VERSION 11.3.2 <<
<< Date : 08.03.2025 Time : 08:07:00 Pageformat: DA4L <<
<< Vectors : 82 Warnings: 0 Fileformat: PDF <<
<< Metafile: ./srt/prouhethuemorse_cpt.pdf <<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
xn: 3136, yn: 3136, xr: 3348, yr: 3348
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<< END OF DISLIN / VERSION 11.3.2 <<
<< Date : 08.03.2025 Time : 08:07:55 Pageformat: DA4L <<
<< Vectors : 12 Warnings: 0 Fileformat: PDF <<
<< Metafile: ./srt/prouhethuemorse_cpt_4.pdf <<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[<..\cpt\src\scl.cpt.cpp.prouhethuemorse_cpt]
[>..\cpt\src\scl.cpt.cpp.prouhethuemorse_cpt]
scl-25.03 (gwin64) : 08-03-2025 08:07:55
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<< END OF DISLIN / VERSION 11.3.2 <<
<< Date : 08.03.2025 Time : 08:07:55 Pageformat: DA4L <<
<< Vectors : 82 Warnings: 0 Fileformat: PDF <<
<< Metafile: ./srt/prouhethuemorse_cpt.pdf <<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
xn: 3136, yn: 3136, xr: 3542, yr: 3542
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<< END OF DISLIN / VERSION 11.3.2 <<
<< Date : 08.03.2025 Time : 08:08:39 Pageformat: DA4L <<
<< Vectors : 12 Warnings: 0 Fileformat: PDF <<
<< Metafile: ./srt/prouhethuemorse_cpt_8.pdf <<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[<..\cpt\src\scl.cpt.cpp.prouhethuemorse_cpt]
[<..\cpt\src\scl.cpt.cpp.prouhethuemorse_cpt]