harmonic.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_HARMONIC_H
  9. #define IGL_HARMONIC_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Compute k-harmonic weight functions "coordinates".
  15. //
  16. //
  17. // Inputs:
  18. // V #V by dim vertex positions
  19. // F #F by simplex-size list of element indices
  20. // b #b boundary indices into V
  21. // bc #b by #W list of boundary values
  22. // k power of harmonic operation (1: harmonic, 2: biharmonic, etc)
  23. // Outputs:
  24. // W #V by #W list of weights
  25. //
  26. template <
  27. typename DerivedV,
  28. typename DerivedF,
  29. typename Derivedb,
  30. typename Derivedbc,
  31. typename DerivedW>
  32. IGL_INLINE bool harmonic(
  33. const Eigen::PlainObjectBase<DerivedV> & V,
  34. const Eigen::PlainObjectBase<DerivedF> & F,
  35. const Eigen::PlainObjectBase<Derivedb> & b,
  36. const Eigen::PlainObjectBase<Derivedbc> & bc,
  37. const int k,
  38. Eigen::PlainObjectBase<DerivedW> & W);
  39. // Compute harmonic map using uniform laplacian operator
  40. //
  41. //
  42. // Inputs:
  43. // F #F by simplex-size list of element indices
  44. // b #b boundary indices into V
  45. // bc #b by #W list of boundary values
  46. // k power of harmonic operation (1: harmonic, 2: biharmonic, etc)
  47. // Outputs:
  48. // W #V by #W list of weights
  49. //
  50. template <
  51. typename DerivedF,
  52. typename Derivedb,
  53. typename Derivedbc,
  54. typename DerivedW>
  55. IGL_INLINE bool harmonic(
  56. const Eigen::PlainObjectBase<DerivedF> & F,
  57. const Eigen::PlainObjectBase<Derivedb> & b,
  58. const Eigen::PlainObjectBase<Derivedbc> & bc,
  59. const int k,
  60. Eigen::PlainObjectBase<DerivedW> & W);
  61. };
  62. #ifndef IGL_STATIC_LIBRARY
  63. #include "harmonic.cpp"
  64. #endif
  65. #endif