Skip to content

Commit b8a1976

Browse files
Merge pull request #58 from CosmoStat/clang_v17
rename to_array to avoid std conflict
2 parents 866ae82 + 7e79547 commit b8a1976

23 files changed

Lines changed: 972 additions & 975 deletions

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ endif()
121121
# ------------------ #
122122

123123
# Set CXX options
124-
set(CMAKE_CXX_STANDARD 17)
124+
set(CMAKE_CXX_STANDARD 20)
125125
set(CMAKE_CXX_STANDARD_REQUIRED ON)
126126
set(CMAKE_CXX_EXTENSIONS OFF)
127127

cmake/FetchPybind11.cmake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# -------------- #
44

55
# Set Pybind11 Version
6-
set(Pybind11Version 2.10.3)
7-
set(Pybind11SHA256 5d8c4c5dda428d3a944ba3d2a5212cb988c2fae4670d58075a5a49075a6ca315)
6+
set(Pybind11Version 2.13.6)
7+
set(Pybind11SHA256 e08cb87f4773da97fa7b5f035de8763abc656d87d5773e62f6da0587d1f0ec20)
88

99
# Set Pybdin11 fetch location
1010
FetchContent_Declare(
@@ -16,6 +16,5 @@ FetchContent_Declare(
1616
# Fetch and source Pybind11
1717
FetchContent_GetProperties(pybind11)
1818
if(NOT pybind11_POPULATED)
19-
FetchContent_Populate(pybind11)
20-
add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR})
19+
FetchContent_MakeAvailable(pybind11)
2120
endif()

src/astro_wl/libwl/shearinversions.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void ShearInversions::kappa2gamma(double* pt_kappa, double* pt_gamma1, double* p
197197

198198
}
199199

200-
void ShearInversions::kappa2gamma(to_array< double, true >& kappa, to_array< double, true >& gamma1, to_array< double, true >& gamma2)
200+
void ShearInversions::kappa2gamma(convert_to_array< double, true >& kappa, convert_to_array< double, true >& gamma1, convert_to_array< double, true >& gamma2)
201201
{
202202
double *pt_gamma1 = gamma1.buffer();
203203
double *pt_gamma2 = gamma2.buffer();
@@ -210,7 +210,7 @@ void ShearInversions::kappa2gamma(to_array< double, true >& kappa, to_array< dou
210210
kappa2gamma(pt_kappa,pt_gamma1,pt_gamma2,Nx,Ny,Nz+1);
211211
}
212212

213-
void ShearInversions::kappa2flexion(double pixel_size, to_array< double, true >& kappa, to_array< double, true >& F1, to_array< double, true >& F2)
213+
void ShearInversions::kappa2flexion(double pixel_size, convert_to_array< double, true >& kappa, convert_to_array< double, true >& F1, convert_to_array< double, true >& F2)
214214
{
215215
double *pt_F1 = F1.buffer();
216216
double *pt_F2 = F2.buffer();
@@ -280,7 +280,7 @@ void ShearInversions::kappa2flexion(double pixel_size, double* pt_kappa, double*
280280
}
281281

282282

283-
void ShearInversions::flexion2kappa(double pixel_size,to_array< double, true >& F1, to_array< double, true >& F2, to_array< double, true >& kappa)
283+
void ShearInversions::flexion2kappa(double pixel_size,convert_to_array< double, true >& F1, convert_to_array< double, true >& F2, convert_to_array< double, true >& kappa)
284284
{
285285
double *pt_F1 = F1.buffer();
286286
double *pt_F2 = F2.buffer();
@@ -342,7 +342,7 @@ void ShearInversions::flexion2kappa(double pixel_size, double* pt_F1, double* pt
342342

343343
}
344344

345-
void ShearInversions::gamma_flexion2kappa(double pixel_size, to_array< double, true >& gamma1, to_array< double, true >& gamma2, to_array< double, true >& F1, to_array< double, true >& F2, to_array< double, true >& kappa)
345+
void ShearInversions::gamma_flexion2kappa(double pixel_size, convert_to_array< double, true >& gamma1, convert_to_array< double, true >& gamma2, convert_to_array< double, true >& F1, convert_to_array< double, true >& F2, convert_to_array< double, true >& kappa)
346346
{
347347
double *pt_gamma1 = gamma1.buffer();
348348
double *pt_gamma2 = gamma2.buffer();

src/mr/libmr2d/Wavelet_wmir.h

Lines changed: 212 additions & 212 deletions
Large diffs are not rendered by default.

src/mrs/libmrs/mrs_planck_lGMCA.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ class lGMCA_inv {
106106

107107
C_UWT2D_ATROUS WT_Trans; //will contain the wavelet transform routines for the Nchannels
108108

109-
to_array<unsigned long,true> FaceIndices;//Index of each pixel in a face in Healpix Ring format
110-
to_array<unsigned long,true> Nest2Ring_indices;//Index of each pixel in a face in Healpix Ring format
111-
to_array<unsigned long,true> Ring2Nest_indices;//Index of each pixel in a face in Healpix Ring format
109+
convert_to_array<unsigned long,true> FaceIndices;//Index of each pixel in a face in Healpix Ring format
110+
convert_to_array<unsigned long,true> Nest2Ring_indices;//Index of each pixel in a face in Healpix Ring format
111+
convert_to_array<unsigned long,true> Ring2Nest_indices;//Index of each pixel in a face in Healpix Ring format
112112

113113
bool Verbose;
114114
bool Debug;

src/msvst/libmsvst/Fisz.h

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,27 @@ class FiszTransform
2222
// dimension of the nearest power of two,
2323
// if the data size is not of power two;
2424
// ext is an array of 6 elements (extension information of 6 directions)
25-
void dataExtension (to_array<DATATYPE, true> &data, int ext[], type_border BORDERTYPE=I_MIRROR);
25+
void dataExtension (convert_to_array<DATATYPE, true> &data, int ext[], type_border BORDERTYPE=I_MIRROR);
2626
// extract the original data in using the extension information
27-
void dataExtraction (to_array<DATATYPE, true> &data, int ext[]);
27+
void dataExtraction (convert_to_array<DATATYPE, true> &data, int ext[]);
2828

2929
// Fisz transform 1D / 2D / 3D
3030
// the data size MUST be power of two,
3131
// otherwise, a DataSizeException will be thrown out
32-
void fisz1D (to_array<DATATYPE, true> &data);
33-
void fisz2D (to_array<DATATYPE, true> &data);
34-
void fisz3D (to_array<DATATYPE, true> &data);
32+
void fisz1D (convert_to_array<DATATYPE, true> &data);
33+
void fisz2D (convert_to_array<DATATYPE, true> &data);
34+
void fisz3D (convert_to_array<DATATYPE, true> &data);
3535

3636
// Inverse Fisz transform 1D / 2D / 3D
3737
// data size MUST be power of two.
3838
// otherwise, a DataSizeException will be thrown out
39-
void ifisz1D (to_array<DATATYPE, true> &data);
40-
void ifisz2D (to_array<DATATYPE, true> &data);
41-
void ifisz3D (to_array<DATATYPE, true> &data);
39+
void ifisz1D (convert_to_array<DATATYPE, true> &data);
40+
void ifisz2D (convert_to_array<DATATYPE, true> &data);
41+
void ifisz3D (convert_to_array<DATATYPE, true> &data);
4242
};
4343

4444
template <class DATATYPE>
45-
void FiszTransform<DATATYPE>::dataExtension (to_array<DATATYPE, true> &data, int ext[], type_border BORDERTYPE)
45+
void FiszTransform<DATATYPE>::dataExtension (convert_to_array<DATATYPE, true> &data, int ext[], type_border BORDERTYPE)
4646
{
4747
int lext = 0, rext = 0, uext = 0, dext = 0, bext = 0, fext = 0;
4848
int dim = data.naxis();
@@ -54,7 +54,7 @@ void FiszTransform<DATATYPE>::dataExtension (to_array<DATATYPE, true> &data, int
5454
lext = (newlen - len1) / 2;
5555
rext = (newlen - len1) - lext;
5656

57-
to_array<DATATYPE, true> *temp = new to_array<DATATYPE, true>(newlen);
57+
convert_to_array<DATATYPE, true> *temp = new convert_to_array<DATATYPE, true>(newlen);
5858
for (int x=0; x<newlen; x++)
5959
(*temp)(x) = data(x-lext, BORDERTYPE);
6060
data = *temp;
@@ -72,7 +72,7 @@ void FiszTransform<DATATYPE>::dataExtension (to_array<DATATYPE, true> &data, int
7272
lext = (newlen1 - len1) / 2; rext = (newlen1 - len1) - lext;
7373
uext = (newlen2 - len2) / 2; dext = (newlen2 - len2) - uext;
7474

75-
to_array<DATATYPE, true> *temp = new to_array<DATATYPE, true>(newlen1, newlen2);
75+
convert_to_array<DATATYPE, true> *temp = new convert_to_array<DATATYPE, true>(newlen1, newlen2);
7676
for (int y=0; y<newlen2; y++)
7777
for (int x=0; x<newlen1; x++)
7878
(*temp)(x, y) = data(x-lext, y-uext, BORDERTYPE);
@@ -92,7 +92,7 @@ void FiszTransform<DATATYPE>::dataExtension (to_array<DATATYPE, true> &data, int
9292
uext = (newlen2 - len2) / 2; dext = (newlen2 - len2) - uext;
9393
bext = (newlen3 - len3) / 2; fext = (newlen3 - len3) - fext;
9494

95-
to_array<DATATYPE, true> *temp = new to_array<DATATYPE, true>(newlen1, newlen2, newlen3);
95+
convert_to_array<DATATYPE, true> *temp = new convert_to_array<DATATYPE, true>(newlen1, newlen2, newlen3);
9696
for (int z=0; z<newlen3; z++)
9797
for (int y=0; y<newlen2; y++)
9898
for (int x=0; x<newlen1; x++)
@@ -106,7 +106,7 @@ void FiszTransform<DATATYPE>::dataExtension (to_array<DATATYPE, true> &data, int
106106
}
107107

108108
template<class DATATYPE>
109-
void FiszTransform<DATATYPE>::dataExtraction (to_array<DATATYPE, true> &data, int ext[])
109+
void FiszTransform<DATATYPE>::dataExtraction (convert_to_array<DATATYPE, true> &data, int ext[])
110110
{
111111
int dim = data.naxis();
112112
int lext = ext[0], rext = ext[1], uext = ext[2];
@@ -115,7 +115,7 @@ void FiszTransform<DATATYPE>::dataExtraction (to_array<DATATYPE, true> &data, in
115115
if ((dim == 1) && ((lext != 0) || (rext != 0)))
116116
{
117117
int finallen = data.nx() - lext - rext;
118-
to_array<DATATYPE,true> *tdata = new to_array<DATATYPE, true>(finallen);
118+
convert_to_array<DATATYPE,true> *tdata = new convert_to_array<DATATYPE, true>(finallen);
119119
for (int x=0; x<finallen; x++) (*tdata)(x) = data(lext+x);
120120
data = (*tdata);
121121
if (tdata != NULL) { delete tdata; tdata = NULL; }
@@ -125,7 +125,7 @@ void FiszTransform<DATATYPE>::dataExtraction (to_array<DATATYPE, true> &data, in
125125
{
126126
int finallen1 = data.nx() - lext - rext;
127127
int finallen2 = data.ny() - uext - dext;
128-
to_array<DATATYPE,true> *tdata = new to_array<DATATYPE, true>(finallen1, finallen2);
128+
convert_to_array<DATATYPE,true> *tdata = new convert_to_array<DATATYPE, true>(finallen1, finallen2);
129129
for (int x=0; x<finallen1; x++)
130130
for (int y=0; y<finallen2; y++)
131131
(*tdata)(x, y) = data(lext+x, uext+y);
@@ -139,7 +139,7 @@ void FiszTransform<DATATYPE>::dataExtraction (to_array<DATATYPE, true> &data, in
139139
int finallen1 = data.nx() - lext - rext;
140140
int finallen2 = data.ny() - uext - dext;
141141
int finallen3 = data.nz() - bext - fext;
142-
to_array<DATATYPE,true> *tdata = new to_array<DATATYPE, true>(finallen1, finallen2, finallen3);
142+
convert_to_array<DATATYPE,true> *tdata = new convert_to_array<DATATYPE, true>(finallen1, finallen2, finallen3);
143143
for (int x=0; x<finallen1; x++)
144144
for (int y=0; y<finallen2; y++)
145145
for (int z=0; z<finallen3; z++)
@@ -150,14 +150,14 @@ void FiszTransform<DATATYPE>::dataExtraction (to_array<DATATYPE, true> &data, in
150150
}
151151

152152
template<class DATATYPE>
153-
void FiszTransform<DATATYPE>::fisz1D (to_array<DATATYPE, true> &data)
153+
void FiszTransform<DATATYPE>::fisz1D (convert_to_array<DATATYPE, true> &data)
154154
{
155155
double ca, cd;
156156
int len = data.nx();
157157
if (len <= 1) return;
158158
else if (!is_power_of_2(len))
159159
throw DataSizeException(len, "data size not of power of two");
160-
to_array<DATATYPE, true> *temp = new to_array<DATATYPE, true>(len);
160+
convert_to_array<DATATYPE, true> *temp = new convert_to_array<DATATYPE, true>(len);
161161

162162
// decomposition by Haar transform and modification of detail coefficients
163163
while (len > 1)
@@ -193,14 +193,14 @@ void FiszTransform<DATATYPE>::fisz1D (to_array<DATATYPE, true> &data)
193193
}
194194

195195
template<class DATATYPE>
196-
void FiszTransform<DATATYPE>::ifisz1D (to_array<DATATYPE, true> &data)
196+
void FiszTransform<DATATYPE>::ifisz1D (convert_to_array<DATATYPE, true> &data)
197197
{
198198
double ca, cd;
199199
int len = data.nx();
200200
if (len <= 1) return;
201201
else if (!is_power_of_2(len))
202202
throw DataSizeException(len, "data size not of power of two");
203-
to_array<DATATYPE, true> *temp = new to_array<DATATYPE, true>(len);
203+
convert_to_array<DATATYPE, true> *temp = new convert_to_array<DATATYPE, true>(len);
204204

205205
// decomposition by Haar transform
206206
while (len > 1)
@@ -232,7 +232,7 @@ void FiszTransform<DATATYPE>::ifisz1D (to_array<DATATYPE, true> &data)
232232
}
233233

234234
template<class DATATYPE>
235-
void FiszTransform<DATATYPE>::fisz2D (to_array<DATATYPE, true> &data)
235+
void FiszTransform<DATATYPE>::fisz2D (convert_to_array<DATATYPE, true> &data)
236236
{
237237
double ca, dh, dv, dd;
238238
int s, offsetx, offsety;
@@ -242,7 +242,7 @@ void FiszTransform<DATATYPE>::fisz2D (to_array<DATATYPE, true> &data)
242242
throw DataSizeException(len1, "data size not of power of two");
243243
else if (!is_power_of_2(len2))
244244
throw DataSizeException(len2, "data size not of power of two");
245-
to_array<DATATYPE, true> *temp = new to_array<DATATYPE, true>(len1, len2);
245+
convert_to_array<DATATYPE, true> *temp = new convert_to_array<DATATYPE, true>(len1, len2);
246246

247247
// decomposition by Haar transform and modification of detail coefficients
248248
while ((len1 > 1) && (len2 > 1))
@@ -318,7 +318,7 @@ void FiszTransform<DATATYPE>::fisz2D (to_array<DATATYPE, true> &data)
318318
}
319319

320320
template<class DATATYPE>
321-
void FiszTransform<DATATYPE>::ifisz2D (to_array<DATATYPE, true> &data)
321+
void FiszTransform<DATATYPE>::ifisz2D (convert_to_array<DATATYPE, true> &data)
322322
{
323323
double ca, dh, dv, dd;
324324
int s, offsetx, offsety;
@@ -328,7 +328,7 @@ void FiszTransform<DATATYPE>::ifisz2D (to_array<DATATYPE, true> &data)
328328
throw DataSizeException(len1, "data size not of power of two");
329329
else if (!is_power_of_2(len2))
330330
throw DataSizeException(len2, "data size not of power of two");
331-
to_array<DATATYPE, true> *temp = new to_array<DATATYPE, true>(len1, len2);
331+
convert_to_array<DATATYPE, true> *temp = new convert_to_array<DATATYPE, true>(len1, len2);
332332

333333
// decomposition by Haar transform
334334
while ((len1 > 1) && (len2 > 1))
@@ -396,7 +396,7 @@ void FiszTransform<DATATYPE>::ifisz2D (to_array<DATATYPE, true> &data)
396396
}
397397

398398
template<class DATATYPE>
399-
void FiszTransform<DATATYPE>::fisz3D (to_array<DATATYPE, true> &data)
399+
void FiszTransform<DATATYPE>::fisz3D (convert_to_array<DATATYPE, true> &data)
400400
{
401401
int len1 = data.nx(), len2 = data.ny(), len3 = data.nz();
402402
int len = MIN(MIN(len1, len2), len3);
@@ -409,7 +409,7 @@ void FiszTransform<DATATYPE>::fisz3D (to_array<DATATYPE, true> &data)
409409
throw DataSizeException(len3, "data size not of power of two");
410410

411411
int s = iilog2(len);
412-
to_array<DATATYPE, true> *coef = new to_array<DATATYPE, true>[7*s + 1];
412+
convert_to_array<DATATYPE, true> *coef = new convert_to_array<DATATYPE, true>[7*s + 1];
413413

414414
dblarray dfilterh(2), dfilterg(2), rfilterh(2), rfilterg(2);
415415
dfilterh(0) = .5; dfilterh(1) = .5; dfilterg(0) = -.5; dfilterg(1) = .5;
@@ -449,7 +449,7 @@ void FiszTransform<DATATYPE>::fisz3D (to_array<DATATYPE, true> &data)
449449
}
450450

451451
template<class DATATYPE>
452-
void FiszTransform<DATATYPE>::ifisz3D (to_array<DATATYPE, true> &data)
452+
void FiszTransform<DATATYPE>::ifisz3D (convert_to_array<DATATYPE, true> &data)
453453
{
454454
int len1 = data.nx(), len2 = data.ny(), len3 = data.nz();
455455
int len = MIN(MIN(len1, len2), len3);
@@ -462,7 +462,7 @@ void FiszTransform<DATATYPE>::ifisz3D (to_array<DATATYPE, true> &data)
462462
throw DataSizeException(len3, "data size not of power of two");
463463

464464
int s = iilog2(len);
465-
to_array<DATATYPE, true> *coef = new to_array<DATATYPE, true>[7*s + 1];
465+
convert_to_array<DATATYPE, true> *coef = new convert_to_array<DATATYPE, true>[7*s + 1];
466466

467467
dblarray dfilterh(2), dfilterg(2), rfilterh(2), rfilterg(2);
468468
dfilterh(0) = .5; dfilterh(1) = .5; dfilterg(0) = -.5; dfilterg(1) = .5;

0 commit comments

Comments
 (0)