c concepts for c concepts for ill posed inverse problems
play

C++ Concepts for C++ Concepts for Ill-posed Inverse Problems - PowerPoint PPT Presentation

C++ Concepts for C++ Concepts for Ill-posed Inverse Problems Ill-posed Inverse Problems Or: How to do weird math stu at compile time Or: How to do weird math stu at compile time David Frank David Frank -- -- frankd@in.tum.de


  1. C++ Concepts for C++ Concepts for Ill-posed Inverse Problems Ill-posed Inverse Problems Or: How to do weird math stu� at compile time Or: How to do weird math stu� at compile time David Frank David Frank -- -- frankd@in.tum.de frankd@in.tum.de Complete code at https://godbolt.org/z/EBuSA5 Complete code at https://godbolt.org/z/EBuSA5 1 / 9 1 / 9

  2. What we'll be doing Convert key ideas of elsa's* design, which currently does a lot at runtime, to work at compile time * You can find it at: https://gitlab.lrz.de/IP/elsa 2 / 9

  3. What is an ill-posed Inverse Problem Arise when, we want to compute information about hidden data from outside Can represent image processing or tomographic reconstruction task Check out the book Discrete Inverse Problems by Per Christian Hansen (Math heavy!!) 3 / 9

  4. What is an ill-posed Inverse Problem Arise when, we want to compute information about hidden data from outside Can represent image processing or tomographic reconstruction task Check out the book Discrete Inverse Problems by Per Christian Hansen (Math heavy!!) The concept Problem Models mathematical optimization problem Incorporates logic, so an algorithm can find a solution (called a Solver ) Currently elsa does all checks, if the Solver can actually handle the problem at run time. 4 / 9

  5. A base concept for a problem template<class P_> concept Problem = requires(P_ p) { { p.dataTerm_ } -> Functional; requires requires (vector x) { { p.gradient(x) } -> convertible_to<vector>; }; }; How to read this: If a type has a member dataTerm_ , which fulfills the concept Functional and has a member function gradient , which takes a vector and returns something, which is convertible to a vector , it satisfies the concept Problem 5 / 9

  6. Specialized Problem s For example, Conjugate Gradient * requires a data term in quadric from Introduce concepts, which require the original Problem and impose further restrictions * for the interested https://en.wikipedia.org/wiki/Conjugate_gradient_method 6 / 9

  7. Specialized Problem s For example, Conjugate Gradient * requires a data term in quadric from Introduce concepts, which require the original Problem and impose further restrictions Concepts for Conjugate Gradient template<class P_> concept QuadricProblem = Problem<P_> && requires(P_ p) { requires is_specialization<decltype(p.dataTerm_), quadric>; }; template<class P_> concept ConvertibleToQuadricProblem = Problem<P_> && requires(P_ p) { requires is_specialization<decltype(p.dataTerm_), l2_norm_pow2> && requires { { p.toQuadric() } -> QuadricProblem; }; }; * for the interested https://en.wikipedia.org/wiki/Conjugate_gradient_method 7 / 9

  8. A promising approach for elsa* Remove flat polymorphic hierarchies Remove coupling between some components Describing mathematical constrains at compile time Personally, the approach of requiring something feels natural * and maybe for your project? 8 / 9

  9. I hope you enjoyed my talk! I hope you enjoyed my talk! David Frank David Frank -- -- frankd@in.tum.de frankd@in.tum.de Complete code at Complete code at https://godbolt.org/z/EBuSA5 https://godbolt.org/z/EBuSA5 9 / 9 9 / 9

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend