n_polyvector_general.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Olga Diamanti <olga.diam@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. #include <igl/n_polyvector_general.h>
  9. //#include <igl/edge_topology.h>
  10. //#include <igl/local_basis.h>
  11. //#include <igl/nchoosek.h>
  12. //#include <igl/slice.h>
  13. //#include <igl/polyroots.h>
  14. //#include <Eigen/Sparse>
  15. //#include <Eigen/Geometry>
  16. //#include <iostream>
  17. //#include <iostream>
  18. //
  19. //namespace igl {
  20. // template <typename DerivedV, typename DerivedF>
  21. // class GeneralPolyVectorFieldFinder
  22. // {
  23. // private:
  24. // const Eigen::PlainObjectBase<DerivedV> &V;
  25. // const Eigen::PlainObjectBase<DerivedF> &F; int numF;
  26. // const int n;
  27. //
  28. // Eigen::MatrixXi EV; int numE;
  29. // Eigen::MatrixXi F2E;
  30. // Eigen::MatrixXi E2F;
  31. // Eigen::VectorXd K;
  32. //
  33. // Eigen::VectorXi isBorderEdge;
  34. // int numInteriorEdges;
  35. // Eigen::Matrix<int,Eigen::Dynamic,2> E2F_int;
  36. // Eigen::VectorXi indInteriorToFull;
  37. // Eigen::VectorXi indFullToInterior;
  38. //
  39. ////#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
  40. // Eigen::PlainObjectBase<DerivedV> B1, B2, FN;
  41. //
  42. // IGL_INLINE void computek();
  43. // IGL_INLINE void setFieldFromGeneralCoefficients(const std::vector<Eigen::Matrix<std::complex<typename DerivedV::Scalar>, Eigen::Dynamic,1>> &coeffs,
  44. // std::vector<Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, 2> > &pv);
  45. // IGL_INLINE void computeCoefficientLaplacian(int n, Eigen::SparseMatrix<std::complex<typename DerivedV::Scalar> > &D);
  46. // IGL_INLINE void getGeneralCoeffConstraints(const Eigen::VectorXi &isConstrained,
  47. // const Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, Eigen::Dynamic> &cfW,
  48. // int k,
  49. // const Eigen::VectorXi &rootsIndex,
  50. // Eigen::Matrix<std::complex<typename DerivedV::Scalar>, Eigen::Dynamic,1> &Ck);
  51. // IGL_INLINE void precomputeInteriorEdges();
  52. //
  53. //
  54. // IGL_INLINE void minQuadWithKnownMini(const Eigen::SparseMatrix<std::complex<typename DerivedV::Scalar> > &Q,
  55. // const Eigen::SparseMatrix<std::complex<typename DerivedV::Scalar> > &f,
  56. // const Eigen::VectorXi isConstrained,
  57. // const Eigen::Matrix<std::complex<typename DerivedV::Scalar>, Eigen::Dynamic, 1> &xknown,
  58. // Eigen::Matrix<std::complex<typename DerivedV::Scalar>, Eigen::Dynamic, 1> &x);
  59. //
  60. // public:
  61. // IGL_INLINE GeneralPolyVectorFieldFinder(const Eigen::PlainObjectBase<DerivedV> &_V,
  62. // const Eigen::PlainObjectBase<DerivedF> &_F,
  63. // const int &_n);
  64. // IGL_INLINE bool solve(const Eigen::VectorXi &isConstrained,
  65. // const Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, Eigen::Dynamic> &cfW,
  66. // const Eigen::VectorXi &rootsIndex,
  67. // Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, Eigen::Dynamic> &output);
  68. //
  69. // };
  70. //}
  71. //
  72. //template<typename DerivedV, typename DerivedF>
  73. //IGL_INLINE igl::GeneralPolyVectorFieldFinder<DerivedV, DerivedF>::
  74. // GeneralPolyVectorFieldFinder(const Eigen::PlainObjectBase<DerivedV> &_V,
  75. // const Eigen::PlainObjectBase<DerivedF> &_F,
  76. // const int &_n):
  77. //V(_V),
  78. //F(_F),
  79. //numF(_F.rows()),
  80. //n(_n)
  81. //{
  82. //
  83. // igl::edge_topology(V,F,EV,F2E,E2F);
  84. // numE = EV.rows();
  85. //
  86. //
  87. // precomputeInteriorEdges();
  88. //
  89. // igl::local_basis(V,F,B1,B2,FN);
  90. //
  91. // computek();
  92. //
  93. //};
  94. //
  95. //
  96. //template<typename DerivedV, typename DerivedF>
  97. //IGL_INLINE void igl::GeneralPolyVectorFieldFinder<DerivedV, DerivedF>::
  98. //precomputeInteriorEdges()
  99. //{
  100. // // Flag border edges
  101. // numInteriorEdges = 0;
  102. // isBorderEdge.setZero(numE,1);
  103. // indFullToInterior = -1*Eigen::VectorXi::Ones(numE,1);
  104. //
  105. // for(unsigned i=0; i<numE; ++i)
  106. // {
  107. // if ((E2F(i,0) == -1) || ((E2F(i,1) == -1)))
  108. // isBorderEdge[i] = 1;
  109. // else
  110. // {
  111. // indFullToInterior[i] = numInteriorEdges;
  112. // numInteriorEdges++;
  113. // }
  114. // }
  115. //
  116. // E2F_int.resize(numInteriorEdges, 2);
  117. // indInteriorToFull.setZero(numInteriorEdges,1);
  118. // int ii = 0;
  119. // for (int k=0; k<numE; ++k)
  120. // {
  121. // if (isBorderEdge[k])
  122. // continue;
  123. // E2F_int.row(ii) = E2F.row(k);
  124. // indInteriorToFull[ii] = k;
  125. // ii++;
  126. // }
  127. //
  128. //}
  129. //
  130. //
  131. //template<typename DerivedV, typename DerivedF>
  132. //IGL_INLINE void igl::GeneralPolyVectorFieldFinder<DerivedV, DerivedF>::
  133. //minQuadWithKnownMini(const Eigen::SparseMatrix<std::complex<typename DerivedV::Scalar> > &Q,
  134. // const Eigen::SparseMatrix<std::complex<typename DerivedV::Scalar> > &f,
  135. // const Eigen::VectorXi isConstrained,
  136. // const Eigen::Matrix<std::complex<typename DerivedV::Scalar>, Eigen::Dynamic, 1> &xknown,
  137. // Eigen::Matrix<std::complex<typename DerivedV::Scalar>, Eigen::Dynamic, 1> &x)
  138. //{
  139. // int N = Q.rows();
  140. //
  141. // int nc = xknown.rows();
  142. // Eigen::VectorXi known; known.setZero(nc,1);
  143. // Eigen::VectorXi unknown; unknown.setZero(N-nc,1);
  144. //
  145. // int indk = 0, indu = 0;
  146. // for (int i = 0; i<N; ++i)
  147. // if (isConstrained[i])
  148. // {
  149. // known[indk] = i;
  150. // indk++;
  151. // }
  152. // else
  153. // {
  154. // unknown[indu] = i;
  155. // indu++;
  156. // }
  157. //
  158. // Eigen::SparseMatrix<std::complex<typename DerivedV::Scalar>> Quu, Quk;
  159. //
  160. // igl::slice(Q,unknown, unknown, Quu);
  161. // igl::slice(Q,unknown, known, Quk);
  162. //
  163. //
  164. // std::vector<typename Eigen::Triplet<std::complex<typename DerivedV::Scalar> > > tripletList;
  165. //
  166. // Eigen::SparseMatrix<std::complex<typename DerivedV::Scalar> > fu(N-nc,1);
  167. //
  168. // igl::slice(f,unknown, Eigen::VectorXi::Zero(1,1), fu);
  169. //
  170. // Eigen::SparseMatrix<std::complex<typename DerivedV::Scalar> > rhs = (Quk*xknown).sparseView()+.5*fu;
  171. //
  172. // Eigen::SparseLU< Eigen::SparseMatrix<std::complex<typename DerivedV::Scalar>>> solver;
  173. // solver.compute(-Quu);
  174. // if(solver.info()!=Eigen::Success)
  175. // {
  176. // std::cerr<<"Decomposition failed!"<<std::endl;
  177. // return;
  178. // }
  179. // Eigen::SparseMatrix<std::complex<typename DerivedV::Scalar>> b = solver.solve(rhs);
  180. // if(solver.info()!=Eigen::Success)
  181. // {
  182. // std::cerr<<"Solving failed!"<<std::endl;
  183. // return;
  184. // }
  185. //
  186. // indk = 0, indu = 0;
  187. // x.setZero(N,1);
  188. // for (int i = 0; i<N; ++i)
  189. // if (isConstrained[i])
  190. // x[i] = xknown[indk++];
  191. // else
  192. // x[i] = b.coeff(indu++,0);
  193. //
  194. //}
  195. //
  196. //
  197. //
  198. //template<typename DerivedV, typename DerivedF>
  199. //IGL_INLINE bool igl::GeneralPolyVectorFieldFinder<DerivedV, DerivedF>::
  200. // solve(const Eigen::VectorXi &isConstrained,
  201. // const Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, Eigen::Dynamic> &cfW,
  202. // const Eigen::VectorXi &rootsIndex,
  203. // Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, Eigen::Dynamic> &output)
  204. //{
  205. // std::cerr << "This code is broken!" << std::endl;
  206. // exit(1);
  207. // // polynomial is of the form:
  208. // // z^(2n) +
  209. // // -c[0]z^(2n-1) +
  210. // // c[1]z^(2n-2) +
  211. // // -c[2]z^(2n-3) +
  212. // // ... +
  213. // // (-1)^n c[n-1]
  214. // //std::vector<Eigen::Matrix<std::complex<typename DerivedV::Scalar>, Eigen::Dynamic,1>> coeffs(n,Eigen::Matrix<std::complex<typename DerivedV::Scalar>, Eigen::Dynamic,1>::Zero(numF, 1));
  215. // //for (int i =0; i<n; ++i)
  216. // //{
  217. // // int degree = i+1;
  218. // // Eigen::Matrix<std::complex<typename DerivedV::Scalar>, Eigen::Dynamic,1> Ck;
  219. // // getGeneralCoeffConstraints(isConstrained,
  220. // // cfW,
  221. // // i,
  222. // // rootsIndex,
  223. // // Ck);
  224. //
  225. // // Eigen::SparseMatrix<std::complex<typename DerivedV::Scalar> > DD;
  226. // // computeCoefficientLaplacian(degree, DD);
  227. // // Eigen::SparseMatrix<std::complex<typename DerivedV::Scalar> > f; f.resize(numF,1);
  228. //
  229. // // if (isConstrained.sum() == numF)
  230. // // coeffs[i] = Ck;
  231. // // else
  232. // // minQuadWithKnownMini(DD, f, isConstrained, Ck, coeffs[i]);
  233. // //}
  234. // //std::vector<Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, 2> > pv;
  235. // //setFieldFromGeneralCoefficients(coeffs, pv);
  236. // //output.setZero(numF,3*n);
  237. // //for (int fi=0; fi<numF; ++fi)
  238. // //{
  239. // // const Eigen::Matrix<typename DerivedV::Scalar, 1, 3> &b1 = B1.row(fi);
  240. // // const Eigen::Matrix<typename DerivedV::Scalar, 1, 3> &b2 = B2.row(fi);
  241. // // for (int i=0; i<n; ++i)
  242. // // output.block(fi,3*i, 1, 3) = pv[i](fi,0)*b1 + pv[i](fi,1)*b2;
  243. // //}
  244. // return true;
  245. //}
  246. //
  247. //template<typename DerivedV, typename DerivedF>
  248. //IGL_INLINE void igl::GeneralPolyVectorFieldFinder<DerivedV, DerivedF>::setFieldFromGeneralCoefficients(const std::vector<Eigen::Matrix<std::complex<typename DerivedV::Scalar>, Eigen::Dynamic,1>> &coeffs,
  249. // std::vector<Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, 2>> &pv)
  250. //{
  251. // pv.assign(n, Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, 2>::Zero(numF, 2));
  252. // for (int i = 0; i <numF; ++i)
  253. // {
  254. //
  255. // // poly coefficients: 1, 0, -Acoeff, 0, Bcoeff
  256. // // matlab code from roots (given there are no trailing zeros in the polynomial coefficients)
  257. // Eigen::Matrix<std::complex<DerivedV::Scalar>, Eigen::Dynamic,1> polyCoeff;
  258. // polyCoeff.setZero(n+1,1);
  259. // polyCoeff[0] = 1.;
  260. // int sign = 1;
  261. // for (int k =0; k<n; ++k)
  262. // {
  263. // sign = -sign;
  264. // int degree = k+1;
  265. // polyCoeff[degree] = (1.*sign)*coeffs[k](i);
  266. // }
  267. //
  268. // Eigen::Matrix<std::complex<typename DerivedV::Scalar>, Eigen::Dynamic,1> roots;
  269. // igl::polyRoots<std::complex<typename DerivedV::Scalar>, typename DerivedV::Scalar >(polyCoeff,roots);
  270. // for (int k=0; k<n; ++k)
  271. // {
  272. // pv[k](i,0) = real(roots[k]);
  273. // pv[k](i,1) = imag(roots[k]);
  274. // }
  275. // }
  276. //
  277. //}
  278. //
  279. //
  280. //template<typename DerivedV, typename DerivedF>
  281. //IGL_INLINE void igl::GeneralPolyVectorFieldFinder<DerivedV, DerivedF>::computeCoefficientLaplacian(int n, Eigen::SparseMatrix<std::complex<typename DerivedV::Scalar> > &D)
  282. //{
  283. // std::vector<Eigen::Triplet<std::complex<typename DerivedV::Scalar> >> tripletList;
  284. //
  285. // // For every non-border edge
  286. // for (unsigned eid=0; eid<numE; ++eid)
  287. // {
  288. // if (!isBorderEdge[eid])
  289. // {
  290. // int fid0 = E2F(eid,0);
  291. // int fid1 = E2F(eid,1);
  292. //
  293. // tripletList.push_back(Eigen::Triplet<std::complex<typename DerivedV::Scalar> >(fid0,
  294. // fid0,
  295. // std::complex<typename DerivedV::Scalar>(1.)));
  296. // tripletList.push_back(Eigen::Triplet<std::complex<typename DerivedV::Scalar> >(fid1,
  297. // fid1,
  298. // std::complex<typename DerivedV::Scalar>(1.)));
  299. // tripletList.push_back(Eigen::Triplet<std::complex<typename DerivedV::Scalar> >(fid0,
  300. // fid1,
  301. // -1.*std::polar(1.,-1.*n*K[eid])));
  302. // tripletList.push_back(Eigen::Triplet<std::complex<typename DerivedV::Scalar> >(fid1,
  303. // fid0,
  304. // -1.*std::polar(1.,1.*n*K[eid])));
  305. //
  306. // }
  307. // }
  308. // D.resize(numF,numF);
  309. // D.setFromTriplets(tripletList.begin(), tripletList.end());
  310. //
  311. //
  312. //}
  313. //
  314. ////this gives the coefficients without the (-1)^k that multiplies them
  315. //template<typename DerivedV, typename DerivedF>
  316. //IGL_INLINE void igl::GeneralPolyVectorFieldFinder<DerivedV, DerivedF>::getGeneralCoeffConstraints(const Eigen::VectorXi &isConstrained,
  317. // const Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, Eigen::Dynamic> &cfW,
  318. // int k,
  319. // const Eigen::VectorXi &rootsIndex,
  320. // Eigen::Matrix<std::complex<typename DerivedV::Scalar>, Eigen::Dynamic,1> &Ck)
  321. //{
  322. // int numConstrained = isConstrained.sum();
  323. // Ck.resize(numConstrained,1);
  324. // // int n = rootsIndex.cols();
  325. //
  326. // Eigen::MatrixXi allCombs;
  327. // {
  328. // Eigen::VectorXi V = Eigen::VectorXi::LinSpaced(n,0,n-1);
  329. // igl::nchoosek(V,k+1,allCombs);
  330. // }
  331. //
  332. // int ind = 0;
  333. // for (int fi = 0; fi <numF; ++fi)
  334. // {
  335. // const Eigen::Matrix<typename DerivedV::Scalar, 1, 3> &b1 = B1.row(fi);
  336. // const Eigen::Matrix<typename DerivedV::Scalar, 1, 3> &b2 = B2.row(fi);
  337. // if(isConstrained[fi])
  338. // {
  339. // std::complex<typename DerivedV::Scalar> ck(0);
  340. //
  341. // for (int j = 0; j < allCombs.rows(); ++j)
  342. // {
  343. // std::complex<typename DerivedV::Scalar> tk(1.);
  344. // //collect products
  345. // for (int i = 0; i < allCombs.cols(); ++i)
  346. // {
  347. // int index = allCombs(j,i);
  348. //
  349. // int ri = rootsIndex[index];
  350. // Eigen::Matrix<typename DerivedV::Scalar, 1, 3> w;
  351. // if (ri>0)
  352. // w = cfW.block(fi,3*(ri-1),1,3);
  353. // else
  354. // w = -cfW.block(fi,3*(-ri-1),1,3);
  355. // typename DerivedV::Scalar w0 = w.dot(b1);
  356. // typename DerivedV::Scalar w1 = w.dot(b2);
  357. // std::complex<typename DerivedV::Scalar> u(w0,w1);
  358. // tk*= u;
  359. // }
  360. // //collect sum
  361. // ck += tk;
  362. // }
  363. // Ck(ind) = ck;
  364. // ind ++;
  365. // }
  366. // }
  367. //
  368. //
  369. //}
  370. //
  371. //template<typename DerivedV, typename DerivedF>
  372. //IGL_INLINE void igl::GeneralPolyVectorFieldFinder<DerivedV, DerivedF>::computek()
  373. //{
  374. // K.setZero(numE);
  375. // // For every non-border edge
  376. // for (unsigned eid=0; eid<numE; ++eid)
  377. // {
  378. // if (!isBorderEdge[eid])
  379. // {
  380. // int fid0 = E2F(eid,0);
  381. // int fid1 = E2F(eid,1);
  382. //
  383. // Eigen::Matrix<typename DerivedV::Scalar, 1, 3> N0 = FN.row(fid0);
  384. // Eigen::Matrix<typename DerivedV::Scalar, 1, 3> N1 = FN.row(fid1);
  385. //
  386. // // find common edge on triangle 0 and 1
  387. // int fid0_vc = -1;
  388. // int fid1_vc = -1;
  389. // for (unsigned i=0;i<3;++i)
  390. // {
  391. // if (F2E(fid0,i) == eid)
  392. // fid0_vc = i;
  393. // if (F2E(fid1,i) == eid)
  394. // fid1_vc = i;
  395. // }
  396. // assert(fid0_vc != -1);
  397. // assert(fid1_vc != -1);
  398. //
  399. // Eigen::Matrix<typename DerivedV::Scalar, 1, 3> common_edge = V.row(F(fid0,(fid0_vc+1)%3)) - V.row(F(fid0,fid0_vc));
  400. // common_edge.normalize();
  401. //
  402. // // Map the two triangles in a new space where the common edge is the x axis and the N0 the z axis
  403. // Eigen::Matrix<typename DerivedV::Scalar, 3, 3> P;
  404. // Eigen::Matrix<typename DerivedV::Scalar, 1, 3> o = V.row(F(fid0,fid0_vc));
  405. // Eigen::Matrix<typename DerivedV::Scalar, 1, 3> tmp = -N0.cross(common_edge);
  406. // P << common_edge, tmp, N0;
  407. //// P.transposeInPlace();
  408. //
  409. //
  410. // Eigen::Matrix<typename DerivedV::Scalar, 3, 3> V0;
  411. // V0.row(0) = V.row(F(fid0,0)) -o;
  412. // V0.row(1) = V.row(F(fid0,1)) -o;
  413. // V0.row(2) = V.row(F(fid0,2)) -o;
  414. //
  415. // V0 = (P*V0.transpose()).transpose();
  416. //
  417. //// assert(V0(0,2) < 1e-10);
  418. //// assert(V0(1,2) < 1e-10);
  419. //// assert(V0(2,2) < 1e-10);
  420. //
  421. // Eigen::Matrix<typename DerivedV::Scalar, 3, 3> V1;
  422. // V1.row(0) = V.row(F(fid1,0)) -o;
  423. // V1.row(1) = V.row(F(fid1,1)) -o;
  424. // V1.row(2) = V.row(F(fid1,2)) -o;
  425. // V1 = (P*V1.transpose()).transpose();
  426. //
  427. //// assert(V1(fid1_vc,2) < 10e-10);
  428. //// assert(V1((fid1_vc+1)%3,2) < 10e-10);
  429. //
  430. // // compute rotation R such that R * N1 = N0
  431. // // i.e. map both triangles to the same plane
  432. // double alpha = -atan2(V1((fid1_vc+2)%3,2),V1((fid1_vc+2)%3,1));
  433. //
  434. // Eigen::Matrix<typename DerivedV::Scalar, 3, 3> R;
  435. // R << 1, 0, 0,
  436. // 0, cos(alpha), -sin(alpha) ,
  437. // 0, sin(alpha), cos(alpha);
  438. // V1 = (R*V1.transpose()).transpose();
  439. //
  440. //// assert(V1(0,2) < 1e-10);
  441. //// assert(V1(1,2) < 1e-10);
  442. //// assert(V1(2,2) < 1e-10);
  443. //
  444. // // measure the angle between the reference frames
  445. // // k_ij is the angle between the triangle on the left and the one on the right
  446. // Eigen::Matrix<typename DerivedV::Scalar, 1, 3> ref0 = V0.row(1) - V0.row(0);
  447. // Eigen::Matrix<typename DerivedV::Scalar, 1, 3> ref1 = V1.row(1) - V1.row(0);
  448. //
  449. // ref0.normalize();
  450. // ref1.normalize();
  451. //
  452. // double ktemp = atan2(ref1(1),ref1(0)) - atan2(ref0(1),ref0(0));
  453. //
  454. // // just to be sure, rotate ref0 using angle ktemp...
  455. // Eigen::Matrix<typename DerivedV::Scalar, 2, 2> R2;
  456. // R2 << cos(ktemp), -sin(ktemp), sin(ktemp), cos(ktemp);
  457. //
  458. // Eigen::Matrix<typename DerivedV::Scalar, 1, 2> tmp1 = R2*(ref0.head(2)).transpose();
  459. //
  460. //// assert(tmp1(0) - ref1(0) < 1e-10);
  461. //// assert(tmp1(1) - ref1(1) < 1e-10);
  462. //
  463. // K[eid] = ktemp;
  464. // }
  465. // }
  466. //
  467. //}
  468. IGL_INLINE void igl::n_polyvector_general(const Eigen::MatrixXd &V,
  469. const Eigen::MatrixXi &F,
  470. const Eigen::VectorXi& b,
  471. const Eigen::MatrixXd& bc,
  472. const Eigen::VectorXi &I,
  473. Eigen::MatrixXd &output)
  474. {
  475. // This functions is broken, please contact Olga Diamanti
  476. assert(0);
  477. //Eigen::VectorXi isConstrained = Eigen::VectorXi::Constant(F.rows(),0);
  478. //Eigen::MatrixXd cfW = Eigen::MatrixXd::Constant(F.rows(),bc.cols(),0);
  479. //for(unsigned i=0; i<b.size();++i)
  480. //{
  481. // isConstrained(b(i)) = 1;
  482. // cfW.row(b(i)) << bc.row(i);
  483. //}
  484. //int n = I.rows();
  485. //igl::GeneralPolyVectorFieldFinder<Eigen::MatrixXd, Eigen::MatrixXi> pvff(V,F,n);
  486. //pvff.solve(isConstrained, cfW, I, output);
  487. }
  488. #ifdef IGL_STATIC_LIBRARY
  489. // Explicit template specialization
  490. #endif