|
@@ -25,6 +25,7 @@ IGL_INLINE void igl::sort(
|
|
Eigen::PlainObjectBase<DerivedY>& Y,
|
|
Eigen::PlainObjectBase<DerivedY>& Y,
|
|
Eigen::PlainObjectBase<DerivedIX>& IX)
|
|
Eigen::PlainObjectBase<DerivedIX>& IX)
|
|
{
|
|
{
|
|
|
|
+ typedef typename DerivedX::Scalar Scalar;
|
|
// get number of rows (or columns)
|
|
// get number of rows (or columns)
|
|
int num_inner = (dim == 1 ? X.rows() : X.cols() );
|
|
int num_inner = (dim == 1 ? X.rows() : X.cols() );
|
|
// Special case for swapping
|
|
// Special case for swapping
|
|
@@ -51,15 +52,15 @@ IGL_INLINE void igl::sort(
|
|
{
|
|
{
|
|
// Unsorted index map for this column (or row)
|
|
// Unsorted index map for this column (or row)
|
|
std::vector<size_t> index_map(num_inner);
|
|
std::vector<size_t> index_map(num_inner);
|
|
- std::vector<double> data(num_inner);
|
|
|
|
|
|
+ std::vector<Scalar> data(num_inner);
|
|
for(int j = 0;j<num_inner;j++)
|
|
for(int j = 0;j<num_inner;j++)
|
|
{
|
|
{
|
|
if(dim == 1)
|
|
if(dim == 1)
|
|
{
|
|
{
|
|
- data[j] = (double) X(j,i);
|
|
|
|
|
|
+ data[j] = (Scalar) X(j,i);
|
|
}else
|
|
}else
|
|
{
|
|
{
|
|
- data[j] = (double) X(i,j);
|
|
|
|
|
|
+ data[j] = (Scalar) X(i,j);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// sort this column (or row)
|
|
// sort this column (or row)
|
|
@@ -344,4 +345,7 @@ template void igl::sort<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int,
|
|
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> >&);
|
|
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> >&);
|
|
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> >&);
|
|
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> >&);
|
|
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> >&);
|
|
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> >&);
|
|
|
|
+#ifdef WIN32
|
|
|
|
+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> > &);
|
|
|
|
+#endif
|
|
#endif
|
|
#endif
|