// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2013 Alec Jacobson // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #include "bbw.h" #include #include #include #include #include #include #include #include #include igl::bbw::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::bbw::BBWData::print() { using namespace std; cout<<"partition_unity: "< IGL_INLINE bool igl::bbw::bbw( const Eigen::PlainObjectBase & V, const Eigen::PlainObjectBase & Ele, const Eigen::PlainObjectBase & b, const Eigen::PlainObjectBase & bc, igl::bbw::BBWData & data, Eigen::PlainObjectBase & W ) { 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_TYPE_VORONOI; if(Ele.cols() == 4) { mmtype = MASSMATRIX_TYPE_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: max_iter: "<= 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) { #pragma omp critical 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::bbw::BBWData&, Eigen::PlainObjectBase >&); #endif