My problem is to iterate through $[0.95,1] \times [0.95,1] \times[0.95,1] \in \mathbb{R}^{3}$. Is there a generic way to do this? I was considering rolling it all out and effectively vectorising the problem.

I would like to use Eigen but I think using a vector of MatrixXd elements seems not wise.

Any tips or help would be appreciated!

  • $\begingroup$ There are infinitely many values in this box. It's going to take me a while to verify that the algorithm I have in mind actually works... stand by... $\endgroup$ Apr 28, 2023 at 22:26
  • $\begingroup$ Yes it shall take some discretization. I look forward to your idea Wolfgang $\endgroup$ Apr 29, 2023 at 8:41
  • $\begingroup$ I think you have to explain more what you want to do. A triple loop sounds like a good starting point, but since nobody has an idea what your goal is, there's nothing we can help. $\endgroup$ Apr 30, 2023 at 23:02
  • $\begingroup$ I have done more research Wolfgang and found that I need to have a structured, rectangular mesh. So I don't need to have anything fancy but if you or others know a way to create a box mesh using a decent C++ library, I would be very grateful to know. $\endgroup$ May 1, 2023 at 20:26
  • $\begingroup$ Why create a mesh data structure? Why not just use a triple loop? $\endgroup$ May 2, 2023 at 3:02


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.