#include "bbw.h" #include #include #include #include #include #include #include #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET #include #include #include igl::BBWData::BBWData(): partition_unity(false), W0(), #ifndef IGL_NO_MOSEK mosek_data(), #endif active_set_params(), qp_solver(QP_SOLVER_IGL_ACTIVE_SET), verbosity(0) { // We know that the Bilaplacian is positive semi-definite active_set_params.Auu_pd = true; } void igl::BBWData::print() { using namespace std; cout<<"partition_unity: "< IGL_INLINE bool igl::bbw( const Eigen::PlainObjectBase & V, const Eigen::PlainObjectBase & Ele, const Eigen::PlainObjectBase & b, const Eigen::PlainObjectBase & bc, igl::BBWData & data, Eigen::PlainObjectBase & W ) { using namespace igl; using namespace std; using namespace Eigen; // number of domain vertices int n = V.rows(); // number of handles int m = bc.cols(); SparseMatrix L; cotmatrix(V,Ele,L); MassMatrixType mmtype = MASSMATRIX_VORONOI; if(Ele.cols() == 4) { mmtype = MASSMATRIX_BARYCENTRIC; } SparseMatrix M; SparseMatrix Mi; massmatrix(V,Ele,mmtype,M); invert_diag(M,Mi); // Biharmonic operator SparseMatrix Q = L.transpose() * Mi * L; W.derived().resize(n,m); if(data.partition_unity) { // Not yet implemented assert(false); }else { // No linear terms VectorXd c = VectorXd::Zero(n); // No linear constraints SparseMatrix A(0,n),Aeq(0,n),Aieq(0,n); VectorXd uc(0,1),Beq(0,1),Bieq(0,1),lc(0,1); // Upper and lower box constraints (Constant bounds) VectorXd ux = VectorXd::Ones(n); VectorXd lx = VectorXd::Zero(n); active_set_params eff_params = data.active_set_params; switch(data.qp_solver) { case QP_SOLVER_IGL_ACTIVE_SET: { if(data.verbosity >= 1) { cout<<"BBW: Computing initial weights for "< mqwf; min_quad_with_fixed_precompute(Q,b,Aeq,true,mqwf); min_quad_with_fixed_solve(mqwf,c,bc,Beq,W); // decrement eff_params.max_iter--; bool error = false; // Loop over handles #pragma omp parallel for for(int i = 0;i= 1) { cout<<"BBW: Computing weight for handle "<= 1) { cout<<"BBW: Computing weight for handle "<, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, igl::BBWData&, Eigen::PlainObjectBase >&); #endif