Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make error ! #1

Open
peteryuan123 opened this issue May 7, 2020 · 3 comments
Open

make error ! #1

peteryuan123 opened this issue May 7, 2020 · 3 comments

Comments

@peteryuan123
Copy link

peteryuan123 commented May 7, 2020

Hi, I compile your code and it turns out that

In member function ‘Eigen::Vector3d DisplacementField::computeKillingEnergyGradient(const Vector3i&) const’:
/home/peteryuan/Desktop/KillingFusion/KillingFusion/src/DisplacementField.cpp:276:102: error: no match for ‘operator-’ (operand types are ‘const Eigen::ArrayWrapper<const Eigen::Matrix<int, 3, 1> >’ and ‘double’)
     if ((spatialIndex.array() < 2 * deltaSize).any() || (spatialIndex.array() >= (m_gridSize.array() - 2 * deltaSize)).any())

Seem like type m_gridSize.array() and double can't do minus operation.

Using Eigen 3.3.4 on ubuntu 18.04.

I also don't find overloaded operator in ArrayWrapper. How can I solve this problem, thanks.

@saurabheights
Copy link
Owner

@daxiong-123
I dont think this should happen. However, I will need some time to get free to look into this.

@HerB1998
Copy link

HerB1998 commented Dec 7, 2021

Hi, I compile your code and it turns out that

In member function ‘Eigen::Vector3d DisplacementField::computeKillingEnergyGradient(const Vector3i&) const’:
/home/peteryuan/Desktop/KillingFusion/KillingFusion/src/DisplacementField.cpp:276:102: error: no match for ‘operator-’ (operand types are ‘const Eigen::ArrayWrapper<const Eigen::Matrix<int, 3, 1> >’ and ‘double’)
     if ((spatialIndex.array() < 2 * deltaSize).any() || (spatialIndex.array() >= (m_gridSize.array() - 2 * deltaSize)).any())

Seem like type m_gridSize.array() and double can't do minus operation.

Using Eigen 3.3.4 on ubuntu 18.04.

I also don't find overloaded operator in ArrayWrapper. How can I solve this problem, thanks.

Hello, I have met the same problem. Did you fix it?

@saurabheights
Copy link
Owner

@HerB1998 The error is coming from minus operation between an Eigen Vector(const Eigen::ArrayWrapper<const Eigen::Matrix<int, 3, 1> >) and double value: m_gridSize.array() - 2 * deltaSize).
See scalar subtraction - https://stackoverflow.com/a/35693493/1874627

I dont remember much of the codebase, but it looks almost valid. There might be a gotcha where I might have introduced a bug by trying to subtract a double from an int vector, but I believe this should be supported. If not, you might have to convert m_gridSize.array() to double before subtraction.

Apologies, but it has been years since I worked on this, can barely recall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants