sort.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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. #include "sort.h"
  9. #include "SortableRow.h"
  10. #include "reorder.h"
  11. #include "IndexComparison.h"
  12. #include "colon.h"
  13. #include "parallel_for.h"
  14. #include <cassert>
  15. #include <algorithm>
  16. #include <iostream>
  17. template <typename DerivedX, typename DerivedY, typename DerivedIX>
  18. IGL_INLINE void igl::sort(
  19. const Eigen::DenseBase<DerivedX>& X,
  20. const int dim,
  21. const bool ascending,
  22. Eigen::PlainObjectBase<DerivedY>& Y,
  23. Eigen::PlainObjectBase<DerivedIX>& IX)
  24. {
  25. typedef typename DerivedX::Scalar Scalar;
  26. // get number of rows (or columns)
  27. int num_inner = (dim == 1 ? X.rows() : X.cols() );
  28. // Special case for swapping
  29. switch(num_inner)
  30. {
  31. default:
  32. break;
  33. case 2:
  34. return igl::sort2(X,dim,ascending,Y,IX);
  35. case 3:
  36. return igl::sort3(X,dim,ascending,Y,IX);
  37. }
  38. using namespace Eigen;
  39. // get number of columns (or rows)
  40. int num_outer = (dim == 1 ? X.cols() : X.rows() );
  41. // dim must be 2 or 1
  42. assert(dim == 1 || dim == 2);
  43. // Resize output
  44. Y.resizeLike(X);
  45. IX.resizeLike(X);
  46. // idea is to process each column (or row) as a std vector
  47. // loop over columns (or rows)
  48. for(int i = 0; i<num_outer;i++)
  49. {
  50. // Unsorted index map for this column (or row)
  51. std::vector<size_t> index_map(num_inner);
  52. std::vector<Scalar> data(num_inner);
  53. for(int j = 0;j<num_inner;j++)
  54. {
  55. if(dim == 1)
  56. {
  57. data[j] = (Scalar) X(j,i);
  58. }else
  59. {
  60. data[j] = (Scalar) X(i,j);
  61. }
  62. }
  63. // sort this column (or row)
  64. igl::sort( data, ascending, data, index_map);
  65. // Copy into Y and IX
  66. for(int j = 0;j<num_inner;j++)
  67. {
  68. if(dim == 1)
  69. {
  70. Y(j,i) = data[j];
  71. IX(j,i) = index_map[j];
  72. }else
  73. {
  74. Y(i,j) = data[j];
  75. IX(i,j) = index_map[j];
  76. }
  77. }
  78. }
  79. }
  80. template <typename DerivedX, typename DerivedY, typename DerivedIX>
  81. IGL_INLINE void igl::sort_new(
  82. const Eigen::DenseBase<DerivedX>& X,
  83. const int dim,
  84. const bool ascending,
  85. Eigen::PlainObjectBase<DerivedY>& Y,
  86. Eigen::PlainObjectBase<DerivedIX>& IX)
  87. {
  88. // get number of rows (or columns)
  89. int num_inner = (dim == 1 ? X.rows() : X.cols() );
  90. // Special case for swapping
  91. switch(num_inner)
  92. {
  93. default:
  94. break;
  95. case 2:
  96. return igl::sort2(X,dim,ascending,Y,IX);
  97. case 3:
  98. return igl::sort3(X,dim,ascending,Y,IX);
  99. }
  100. using namespace Eigen;
  101. // get number of columns (or rows)
  102. int num_outer = (dim == 1 ? X.cols() : X.rows() );
  103. // dim must be 2 or 1
  104. assert(dim == 1 || dim == 2);
  105. // Resize output
  106. Y.resizeLike(X);
  107. IX.resizeLike(X);
  108. // idea is to process each column (or row) as a std vector
  109. // loop over columns (or rows)
  110. for(int i = 0; i<num_outer;i++)
  111. {
  112. Eigen::VectorXi ix;
  113. colon(0,num_inner-1,ix);
  114. // Sort the index map, using unsorted for comparison
  115. if(dim == 1)
  116. {
  117. std::sort(
  118. ix.data(),
  119. ix.data()+ix.size(),
  120. igl::IndexVectorLessThan<const typename DerivedX::ConstColXpr >(X.col(i)));
  121. }else
  122. {
  123. std::sort(
  124. ix.data(),
  125. ix.data()+ix.size(),
  126. igl::IndexVectorLessThan<const typename DerivedX::ConstRowXpr >(X.row(i)));
  127. }
  128. // if not ascending then reverse
  129. if(!ascending)
  130. {
  131. std::reverse(ix.data(),ix.data()+ix.size());
  132. }
  133. for(int j = 0;j<num_inner;j++)
  134. {
  135. if(dim == 1)
  136. {
  137. Y(j,i) = X(ix[j],i);
  138. IX(j,i) = ix[j];
  139. }else
  140. {
  141. Y(i,j) = X(i,ix[j]);
  142. IX(i,j) = ix[j];
  143. }
  144. }
  145. }
  146. }
  147. template <typename DerivedX, typename DerivedY, typename DerivedIX>
  148. IGL_INLINE void igl::sort2(
  149. const Eigen::DenseBase<DerivedX>& X,
  150. const int dim,
  151. const bool ascending,
  152. Eigen::PlainObjectBase<DerivedY>& Y,
  153. Eigen::PlainObjectBase<DerivedIX>& IX)
  154. {
  155. using namespace Eigen;
  156. using namespace std;
  157. typedef typename DerivedY::Scalar YScalar;
  158. Y = X.derived().template cast<YScalar>();
  159. // get number of columns (or rows)
  160. int num_outer = (dim == 1 ? X.cols() : X.rows() );
  161. // get number of rows (or columns)
  162. int num_inner = (dim == 1 ? X.rows() : X.cols() );
  163. assert(num_inner == 2);(void)num_inner;
  164. typedef typename DerivedIX::Scalar Index;
  165. IX.resizeLike(X);
  166. if(dim==1)
  167. {
  168. IX.row(0).setConstant(0);// = DerivedIX::Zero(1,IX.cols());
  169. IX.row(1).setConstant(1);// = DerivedIX::Ones (1,IX.cols());
  170. }else
  171. {
  172. IX.col(0).setConstant(0);// = DerivedIX::Zero(IX.rows(),1);
  173. IX.col(1).setConstant(1);// = DerivedIX::Ones (IX.rows(),1);
  174. }
  175. // loop over columns (or rows)
  176. for(int i = 0;i<num_outer;i++)
  177. {
  178. YScalar & a = (dim==1 ? Y(0,i) : Y(i,0));
  179. YScalar & b = (dim==1 ? Y(1,i) : Y(i,1));
  180. Index & ai = (dim==1 ? IX(0,i) : IX(i,0));
  181. Index & bi = (dim==1 ? IX(1,i) : IX(i,1));
  182. if((ascending && a>b) || (!ascending && a<b))
  183. {
  184. std::swap(a,b);
  185. std::swap(ai,bi);
  186. }
  187. }
  188. }
  189. template <typename DerivedX, typename DerivedY, typename DerivedIX>
  190. IGL_INLINE void igl::sort3(
  191. const Eigen::DenseBase<DerivedX>& X,
  192. const int dim,
  193. const bool ascending,
  194. Eigen::PlainObjectBase<DerivedY>& Y,
  195. Eigen::PlainObjectBase<DerivedIX>& IX)
  196. {
  197. using namespace Eigen;
  198. using namespace std;
  199. typedef typename DerivedY::Scalar YScalar;
  200. Y = X.derived().template cast<YScalar>();
  201. Y.resizeLike(X);
  202. for(int j=0;j<X.cols();j++)for(int i=0;i<X.rows();i++)Y(i,j)=(YScalar)X(i,j);
  203. // get number of columns (or rows)
  204. int num_outer = (dim == 1 ? X.cols() : X.rows() );
  205. // get number of rows (or columns)
  206. int num_inner = (dim == 1 ? X.rows() : X.cols() );
  207. assert(num_inner == 3);(void)num_inner;
  208. typedef typename DerivedIX::Scalar Index;
  209. IX.resizeLike(X);
  210. if(dim==1)
  211. {
  212. IX.row(0).setConstant(0);// = DerivedIX::Zero(1,IX.cols());
  213. IX.row(1).setConstant(1);// = DerivedIX::Ones (1,IX.cols());
  214. IX.row(2).setConstant(2);// = DerivedIX::Ones (1,IX.cols());
  215. }else
  216. {
  217. IX.col(0).setConstant(0);// = DerivedIX::Zero(IX.rows(),1);
  218. IX.col(1).setConstant(1);// = DerivedIX::Ones (IX.rows(),1);
  219. IX.col(2).setConstant(2);// = DerivedIX::Ones (IX.rows(),1);
  220. }
  221. const auto & inner = [&IX,&Y,&dim,&ascending](const Index & i)
  222. {
  223. YScalar & a = (dim==1 ? Y(0,i) : Y(i,0));
  224. YScalar & b = (dim==1 ? Y(1,i) : Y(i,1));
  225. YScalar & c = (dim==1 ? Y(2,i) : Y(i,2));
  226. Index & ai = (dim==1 ? IX(0,i) : IX(i,0));
  227. Index & bi = (dim==1 ? IX(1,i) : IX(i,1));
  228. Index & ci = (dim==1 ? IX(2,i) : IX(i,2));
  229. if(ascending)
  230. {
  231. // 123 132 213 231 312 321
  232. if(a > b)
  233. {
  234. std::swap(a,b);
  235. std::swap(ai,bi);
  236. }
  237. // 123 132 123 231 132 231
  238. if(b > c)
  239. {
  240. std::swap(b,c);
  241. std::swap(bi,ci);
  242. // 123 123 123 213 123 213
  243. if(a > b)
  244. {
  245. std::swap(a,b);
  246. std::swap(ai,bi);
  247. }
  248. // 123 123 123 123 123 123
  249. }
  250. }else
  251. {
  252. // 123 132 213 231 312 321
  253. if(a < b)
  254. {
  255. std::swap(a,b);
  256. std::swap(ai,bi);
  257. }
  258. // 213 312 213 321 312 321
  259. if(b < c)
  260. {
  261. std::swap(b,c);
  262. std::swap(bi,ci);
  263. // 231 321 231 321 321 321
  264. if(a < b)
  265. {
  266. std::swap(a,b);
  267. std::swap(ai,bi);
  268. }
  269. // 321 321 321 321 321 321
  270. }
  271. }
  272. };
  273. parallel_for(num_outer,inner,16000);
  274. }
  275. template <class T>
  276. IGL_INLINE void igl::sort(
  277. const std::vector<T> & unsorted,
  278. const bool ascending,
  279. std::vector<T> & sorted,
  280. std::vector<size_t> & index_map)
  281. {
  282. // Original unsorted index map
  283. index_map.resize(unsorted.size());
  284. for(size_t i=0;i<unsorted.size();i++)
  285. {
  286. index_map[i] = i;
  287. }
  288. // Sort the index map, using unsorted for comparison
  289. std::sort(
  290. index_map.begin(),
  291. index_map.end(),
  292. igl::IndexLessThan<const std::vector<T>& >(unsorted));
  293. // if not ascending then reverse
  294. if(!ascending)
  295. {
  296. std::reverse(index_map.begin(),index_map.end());
  297. }
  298. // make space for output without clobbering
  299. sorted.resize(unsorted.size());
  300. // reorder unsorted into sorted using index map
  301. igl::reorder(unsorted,index_map,sorted);
  302. }
  303. #ifdef IGL_STATIC_LIBRARY
  304. // Explicit template instantiation
  305. // generated by autoexplicit.sh
  306. template void igl::sort<Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  307. // generated by autoexplicit.sh
  308. template void igl::sort<Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  309. // generated by autoexplicit.sh
  310. template void igl::sort<Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  311. // generated by autoexplicit.sh
  312. template void igl::sort<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  313. template void igl::sort<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  314. template void igl::sort<int>(std::vector<int, std::allocator<int> > const&, bool, std::vector<int, std::allocator<int> >&, std::vector<size_t,class std::allocator<size_t> > &);
  315. template void igl::sort<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  316. template void igl::sort<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  317. template void igl::sort<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  318. template void igl::sort<Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  319. template void igl::sort<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
  320. template void igl::sort<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::DenseBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
  321. template void igl::sort_new<Eigen::Matrix<int, 1, 6, 1, 1, 6>, Eigen::Matrix<int, 1, 6, 1, 1, 6>, Eigen::Matrix<int, 1, 6, 1, 1, 6> >(Eigen::DenseBase<Eigen::Matrix<int, 1, 6, 1, 1, 6> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, 1, 6, 1, 1, 6> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, 1, 6, 1, 1, 6> >&);
  322. template void igl::sort<Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 2, 0, -1, 2> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&);
  323. template void igl::sort<Eigen::Matrix<double, -1, 4, 0, -1, 4>, Eigen::Matrix<double, -1, 4, 0, -1, 4>, Eigen::Matrix<int, -1, 4, 0, -1, 4> >(Eigen::DenseBase<Eigen::Matrix<double, -1, 4, 0, -1, 4> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 4, 0, -1, 4> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 4, 0, -1, 4> >&);
  324. template void igl::sort<Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  325. template void igl::sort<long>(std::vector<long, std::allocator<long> > const&, bool, std::vector<long, std::allocator<long> >&, std::vector<size_t, std::allocator<size_t> >&);
  326. template void igl::sort<Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  327. template void igl::sort<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  328. template void igl::sort<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  329. template void igl::sort<Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  330. template void igl::sort<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  331. template void igl::sort<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  332. template void igl::sort<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
  333. template void igl::sort<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<long, -1, 1, 0, -1, 1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&);
  334. template void igl::sort<Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 2, 0, -1, 2> >(Eigen::DenseBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&);
  335. template void igl::sort<Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
  336. #ifdef WIN32
  337. template void igl::sort<class Eigen::Matrix<int,-1,1,0,-1,1>,class Eigen::Matrix<int,-1,1,0,-1,1>,class Eigen::Matrix<__int64,-1,1,0,-1,1> >(class Eigen::DenseBase<class Eigen::Matrix<int,-1,1,0,-1,1> > const &,int,bool,class Eigen::PlainObjectBase<class Eigen::Matrix<int,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<__int64,-1,1,0,-1,1> > &);
  338. template void igl::sort<__int64>(class std::vector<__int64,class std::allocator<__int64> > const &,bool,class std::vector<__int64,class std::allocator<__int64> > &,class std::vector<unsigned __int64,class std::allocator<unsigned __int64> > &);
  339. #endif
  340. #endif