Skip to content

Commit 2493ca9

Browse files
committed
Fix build with Eigen 3.4.0
Eigen 3.4.0 is here! https://eigen.tuxfamily.org/index.php?title=3.4#Changes_that_might_break_existing_code * Make DenseMatrix's initializer_list constructor explicit to match the corresponding constructor added in Eigen 3.4.0, and guard it to avoid an ambiguous overloaded constructor * Fix instances of float/double matrix indexing
1 parent fe9e59a commit 2493ca9

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

cxx/isce3/core/DenseMatrix.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ class DenseMatrix : public Eigen::Matrix<T, N, N> {
3333
return *this * other;
3434
}
3535

36-
CUDA_HOSTDEV constexpr DenseMatrix(
36+
// Backport Eigen 3.4.0's initializer_list constructor
37+
#if !EIGEN_VERSION_AT_LEAST(3, 4, 0)
38+
CUDA_HOSTDEV explicit constexpr DenseMatrix(
3739
std::initializer_list<std::initializer_list<T>> lst) {
3840
int i = 0, j = 0;
3941
for (const auto& l : lst) {
@@ -43,6 +45,7 @@ class DenseMatrix : public Eigen::Matrix<T, N, N> {
4345
i++, j = 0;
4446
}
4547
}
48+
#endif
4649

4750
/** Matrix transposition */
4851
CUDA_HOSTDEV constexpr DenseMatrix<N, T> transpose() const {

cxx/isce3/core/Pegtrans.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void Pegtrans::SCHbasis(const cartesian_t &sch, cartmat_t &,
9999
/*
100100
* Computes the transformation matrix from xyz to a local sch frame
101101
*/
102-
cartmat_t matschxyzp = {{{-sin(sch[0]/radcur),
102+
cartmat_t matschxyzp {{{-sin(sch[0]/radcur),
103103
-(sin(sch[1]/radcur) * cos(sch[0]/radcur)),
104104
cos(sch[0]/radcur) * cos(sch[1]/radcur)},
105105
{cos(sch[0]/radcur),

cxx/isce3/geocode/GeocodeCov.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ inline void Geocode<T>::_interpolate(
769769

770770
if (flag_apply_rtc) {
771771
float rtc_value =
772-
rtc_area(rdrY + azimuthFirstLine, rdrX + rangeFirstPixel);
772+
rtc_area(int(rdrY + azimuthFirstLine), int(rdrX + rangeFirstPixel));
773773
val /= std::sqrt(rtc_value);
774774
if (out_geo_rtc != nullptr) {
775775
#pragma omp atomic write
@@ -818,7 +818,7 @@ inline void Geocode<T>::_interpolate(
818818

819819
if (phase_screen_raster != nullptr) {
820820
phase -= phase_screen_array(
821-
rdrY + azimuthFirstLine, rdrX + rangeFirstPixel);
821+
int(rdrY + azimuthFirstLine), int(rdrX + rangeFirstPixel));
822822
}
823823

824824
T_out cpxPhase;

tests/cxx/isce3/core/attitude/attitude.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ struct AttitudeTest : public ::testing::Test {
3838
attitude = Attitude(time, quaternions, epoch);
3939

4040
// Define the reference rotation matrix (YPR)
41-
R_ypr_ref = {{{0.993760669166, -0.104299329454, 0.039514330251},
42-
{0.099708650872, 0.989535160981, 0.104299329454},
43-
{-0.049979169271, -0.099708650872, 0.993760669166}}};
41+
R_ypr_ref = cartmat_t{{{0.993760669166, -0.104299329454, 0.039514330251},
42+
{0.099708650872, 0.989535160981, 0.104299329454},
43+
{-0.049979169271, -0.099708650872, 0.993760669166}}};
4444

4545
// Set tolerance
4646
tol = 1.0e-10;

0 commit comments

Comments
 (0)