min_quad_dense.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef IGL_MIN_QUAD_DENSE_H
  2. #define IGL_MIN_QUAD_DENSE_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Dense>
  5. //// debug
  6. //#include <matlabinterface.h>
  7. //Engine *g_pEngine;
  8. namespace igl
  9. {
  10. // MIN_QUAD_WITH_FIXED Minimize quadratic energy Z'*A*Z + Z'*B + C
  11. // subject to linear constraints Aeq*Z = Beq
  12. //
  13. // Templates:
  14. // T should be a eigen matrix primitive type like float or double
  15. // Inputs:
  16. // A n by n matrix of quadratic coefficients
  17. // B n by 1 column of linear coefficients
  18. // Aeq m by n list of linear equality constraint coefficients
  19. // Beq m by 1 list of linear equality constraint constant values
  20. // Outputs:
  21. // S n by (n + m) "solve" matrix, such that S*[B', Beq'] is a solution
  22. // Returns true on success, false on error
  23. template <typename T>
  24. IGL_INLINE void min_quad_dense_precompute(
  25. const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& A,
  26. const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& Aeq,
  27. Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& S);
  28. }
  29. #ifdef IGL_HEADER_ONLY
  30. # include "min_quad_dense.cpp"
  31. #endif
  32. #endif