bbw.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef BBW_H
  2. #define BBW_H
  3. #include "../igl_inline.h"
  4. #include <Eigen/Dense>
  5. #include "mosek_quadprog.h"
  6. namespace igl
  7. {
  8. // Container for BBW computation related data and flags
  9. class BBWData
  10. {
  11. public:
  12. // Enforce partition of unity during optimization (optimize all weight
  13. // simultaneously)
  14. bool partition_unity;
  15. // TODO: Is it safe if this is a reference?
  16. // Initial guess
  17. Eigen::MatrixXd W0;
  18. // TODO: Mosek options
  19. igl::MosekData mosek_data;
  20. // TODO: Active set options
  21. public:
  22. BBWData();
  23. // Print current state of object
  24. void print();
  25. };
  26. // Compute Bounded Biharmonic Weights on a given domain (V,Ele) with a given
  27. // set of boundary conditions
  28. //
  29. // Templates
  30. // DerivedV derived type of eigen matrix for V (e.g. MatrixXd)
  31. // DerivedF derived type of eigen matrix for F (e.g. MatrixXi)
  32. // Derivedb derived type of eigen matrix for b (e.g. VectorXi)
  33. // Derivedbc derived type of eigen matrix for bc (e.g. MatrixXd)
  34. // DerivedW derived type of eigen matrix for W (e.g. MatrixXd)
  35. // Inputs:
  36. // V #V by dim vertex positions
  37. // Ele #Elements by simplex-size list of element indices
  38. // b #b boundary indices into V
  39. // bc #b by #W list of boundary values
  40. // data object containing options, intial guess --> solution and results
  41. // Outputs:
  42. // W #V by #W list of weights
  43. // Returns true on success, false on failure
  44. template <
  45. typename DerivedV,
  46. typename DerivedEle,
  47. typename Derivedb,
  48. typename Derivedbc,
  49. typename DerivedW>
  50. IGL_INLINE bool bbw(
  51. const Eigen::MatrixBase<DerivedV> & V,
  52. const Eigen::MatrixBase<DerivedEle> & Ele,
  53. const Eigen::MatrixBase<Derivedb> & b,
  54. const Eigen::MatrixBase<Derivedbc> & bc,
  55. BBWData & data,
  56. Eigen::MatrixBase<DerivedW> & W);
  57. }
  58. #ifdef IGL_HEADER_ONLY
  59. # include "bbw.cpp"
  60. #endif
  61. #endif