Browse Source

deprecated PlainObjectBase types

Former-commit-id: 365e025dffdcd4cf7595bdfa9e39003269e8d3f7
Alec Jacobson 9 years ago
parent
commit
e5b99abdfa

+ 2 - 2
include/igl/active_set.cpp

@@ -67,8 +67,8 @@ IGL_INLINE igl::SolverStatus igl::active_set(
   assert((Aieq.size() == 0 && Bieq.size() == 0) || Aieq.cols() == n);
   assert((Aieq.size() == 0 && Bieq.size() == 0) || Aieq.rows() == Bieq.rows());
   assert((Aieq.size() == 0 && Bieq.size() == 0) || Bieq.cols() == 1);
-  Eigen::PlainObjectBase<Derivedlx> lx;
-  Eigen::PlainObjectBase<Derivedux> ux;
+  Eigen::Matrix<typename Derivedlx::Scalar,Eigen::Dynamic,1> lx;
+  Eigen::Matrix<typename Derivedux::Scalar,Eigen::Dynamic,1> ux;
   if(p_lx.size() == 0)
   {
     lx = Eigen::PlainObjectBase<Derivedlx>::Constant(

+ 1 - 0
include/igl/angle_bound_frame_fields.cpp

@@ -38,6 +38,7 @@ namespace igl {
       Eigen::VectorXi indInteriorToFull;
       Eigen::VectorXi indFullToInterior;
 
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
       Eigen::PlainObjectBase<DerivedV> B1, B2, FN;
 
       //laplacians

+ 1 - 0
include/igl/comb_cross_field.cpp

@@ -27,6 +27,7 @@ namespace igl {
     const Eigen::PlainObjectBase<DerivedF> &F;
     const Eigen::PlainObjectBase<DerivedV> &PD1;
     const Eigen::PlainObjectBase<DerivedV> &PD2;
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
     Eigen::PlainObjectBase<DerivedV> N;
 
   private:

+ 1 - 1
include/igl/comb_frame_field.cpp

@@ -24,7 +24,7 @@ IGL_INLINE void igl::comb_frame_field(const Eigen::PlainObjectBase<DerivedV> &V,
                                       Eigen::PlainObjectBase<DerivedP> &PD1_combed,
                                       Eigen::PlainObjectBase<DerivedP> &PD2_combed)
 {
-  Eigen::PlainObjectBase<DerivedV> B1, B2, B3;
+  DerivedV B1, B2, B3;
   igl::local_basis(V,F,B1,B2,B3);
 
   PD1_combed.resize(BIS1_combed.rows(),3);

+ 2 - 0
include/igl/comb_line_field.cpp

@@ -25,10 +25,12 @@ public:
     const Eigen::PlainObjectBase<DerivedV> &V;
     const Eigen::PlainObjectBase<DerivedF> &F;
     const Eigen::PlainObjectBase<DerivedV> &PD1;
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
     Eigen::PlainObjectBase<DerivedV> N;
 
 private:
     // internal
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
     Eigen::PlainObjectBase<DerivedF> TT;
     Eigen::PlainObjectBase<DerivedF> TTi;
 

+ 1 - 1
include/igl/compute_frame_field_bisectors.cpp

@@ -70,7 +70,7 @@ IGL_INLINE void igl::compute_frame_field_bisectors(
                                                    Eigen::PlainObjectBase<DerivedV>& BIS1,
                                                    Eigen::PlainObjectBase<DerivedV>& BIS2)
 {
-  Eigen::PlainObjectBase<DerivedV> B1, B2, B3;
+  DerivedV B1, B2, B3;
   igl::local_basis(V,F,B1,B2,B3);
 
   compute_frame_field_bisectors( V, F, B1, B2, PD1, PD2, BIS1, BIS2);

+ 4 - 2
include/igl/cross_field_missmatch.cpp

@@ -28,6 +28,7 @@ namespace igl {
     const Eigen::PlainObjectBase<DerivedF> &F;
     const Eigen::PlainObjectBase<DerivedV> &PD1;
     const Eigen::PlainObjectBase<DerivedV> &PD2;
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
     Eigen::PlainObjectBase<DerivedV> N;
 
   private:
@@ -35,6 +36,7 @@ namespace igl {
     std::vector<bool> V_border; // bool
     std::vector<std::vector<int> > VF;
     std::vector<std::vector<int> > VFi;
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
     Eigen::PlainObjectBase<DerivedF> TT;
     Eigen::PlainObjectBase<DerivedF> TTi;
 
@@ -116,8 +118,8 @@ IGL_INLINE void igl::cross_field_missmatch(const Eigen::PlainObjectBase<DerivedV
                                            const bool isCombed,
                                            Eigen::PlainObjectBase<DerivedF> &missmatch)
 {
-  Eigen::PlainObjectBase<DerivedV> PD1_combed;
-  Eigen::PlainObjectBase<DerivedV> PD2_combed;
+  DerivedV PD1_combed;
+  DerivedV PD2_combed;
 
   if (!isCombed)
     igl::comb_cross_field(V,F,PD1,PD2,PD1_combed,PD2_combed);

+ 1 - 0
include/igl/cut_mesh.cpp

@@ -29,6 +29,7 @@ namespace igl {
     int num_scalar_variables;
 
     // per face indexes of vertex in the solver
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
     Eigen::PlainObjectBase<DerivedF> HandleS_Index;
 
     // per vertex variable indexes

+ 1 - 0
include/igl/cut_mesh_from_singularities.cpp

@@ -30,6 +30,7 @@ namespace igl {
     const Eigen::PlainObjectBase<DerivedM> &Handle_MMatch;
 
     Eigen::VectorXi F_visited;
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
     Eigen::PlainObjectBase<DerivedF> TT;
     Eigen::PlainObjectBase<DerivedF> TTi;
 

+ 2 - 2
include/igl/doublearea.cpp

@@ -25,7 +25,7 @@ IGL_INLINE void igl::doublearea(
   assert(F.cols() == 3);
   const size_t m = F.rows();
   // Compute edge lengths
-  Eigen::PlainObjectBase<DerivedV> l;
+  Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, 3> l;
   // "Lecture Notes on Geometric Robustness" Shewchuck 09, Section 3.1
   // http://www.cs.berkeley.edu/~jrs/meshpapers/robnotes.pdf
 
@@ -140,7 +140,7 @@ IGL_INLINE void igl::doublearea(
   assert(ul.cols() == 3);
   // Number of triangles
   const Index m = ul.rows();
-  Eigen::PlainObjectBase<Derivedl> l;
+  Eigen::Matrix<typename Derivedl::Scalar, Eigen::Dynamic, 3> l;
   MatrixXi _;
   sort(ul,2,false,l,_);
   // semiperimeters

+ 1 - 1
include/igl/find_cross_field_singularities.cpp

@@ -71,7 +71,7 @@ IGL_INLINE void igl::find_cross_field_singularities(const Eigen::PlainObjectBase
   // Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > Handle_MMatch;
   // Eigen::PlainObjectBase<Eigen::Matrix<int,  Eigen::Dynamic, 3> > Handle_MMatch;
   // Eigen::Matrix<int, Eigen::Dynamic, 3> Handle_MMatch;
-  Eigen::PlainObjectBase<DerivedF> Handle_MMatch;
+  Eigen::Matrix<typename DerivedF::Scalar, Eigen::Dynamic, 3> Handle_MMatch;
   // Eigen::Matrix<typename DerivedF::Scalar, Eigen::Dynamic, 3> Handle_MMatch;
   // Eigen::Matrix<typename DerivedF::Scalar, Eigen::Dynamic, Eigen::Dynamic> Handle_MMatch;
   igl::cross_field_missmatch<DerivedV, DerivedF>(V, F, PD1, PD2, isCombed, Handle_MMatch);

+ 2 - 3
include/igl/grad.cpp

@@ -14,9 +14,8 @@ IGL_INLINE void igl::grad(const Eigen::PlainObjectBase<DerivedV>&V,
                      const Eigen::PlainObjectBase<DerivedF>&F,
                     Eigen::SparseMatrix<typename DerivedV::Scalar> &G)
 {
-  Eigen::PlainObjectBase<DerivedV > eperp21, eperp13;
-  eperp21.resize(F.rows(),3);
-  eperp13.resize(F.rows(),3);
+  Eigen::Matrix<typename DerivedV::Scalar,Eigen::Dynamic,3> 
+    eperp21(F.rows(),3), eperp13(F.rows(),3);
 
   for (int i=0;i<F.rows();++i)
   {

+ 2 - 2
include/igl/is_border_vertex.cpp

@@ -15,8 +15,8 @@ IGL_INLINE std::vector<bool> igl::is_border_vertex(
     const Eigen::PlainObjectBase<DerivedV> &V, 
     const Eigen::PlainObjectBase<DerivedF> &F)
 {
-  Eigen::PlainObjectBase<DerivedF> FF;
-  igl::triangle_triangle_adjacency(V,F,FF);
+  DerivedF FF;
+  igl::triangle_triangle_adjacency(F,FF);
   std::vector<bool> ret(V.rows());
   for(unsigned i=0; i<ret.size();++i)
     ret[i] = false;

+ 1 - 0
include/igl/line_field_missmatch.cpp

@@ -31,6 +31,7 @@ public:
     const Eigen::PlainObjectBase<DerivedF> &F;
     const Eigen::PlainObjectBase<DerivedV> &PD1;
     const Eigen::PlainObjectBase<DerivedV> &PD2;
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
     Eigen::PlainObjectBase<DerivedV> N;
 
 private:

+ 16 - 27
include/igl/matlab/prepare_lhs.cpp

@@ -14,22 +14,17 @@ IGL_INLINE void igl::matlab::prepare_lhs_double(
 {
   using namespace std;
   using namespace Eigen;
-  plhs[0] = mxCreateDoubleMatrix(V.rows(),V.cols(), mxREAL);
+  const int m = V.rows();
+  const int n = V.cols();
+  plhs[0] = mxCreateDoubleMatrix(m,n, mxREAL);
   double * Vp = mxGetPr(plhs[0]);
-
-  typedef typename DerivedV::Scalar Scalar;
-  const Scalar * V_data;
-  Matrix<Scalar, DerivedV::ColsAtCompileTime, DerivedV::RowsAtCompileTime, RowMajor> VT;
-  if(DerivedV::IsRowMajor)
-  {
-    VT = V.transpose();
-    V_data = VT.data();
-  }else
+  for(int i = 0;i<m;i++)
   {
-    V_data = V.data();
+    for(int j = 0;j<n;j++)
+    {
+      Vp[i+m*j] = V(i,j);
+    }
   }
-
-  copy(V_data,V_data+V.size(),Vp);
 }
 
 template <typename DerivedV>
@@ -39,22 +34,17 @@ IGL_INLINE void igl::matlab::prepare_lhs_logical(
 {
   using namespace std;
   using namespace Eigen;
-  plhs[0] = mxCreateLogicalMatrix(V.rows(),V.cols());
+  const int m = V.rows();
+  const int n = V.cols();
+  plhs[0] = mxCreateLogicalMatrix(m,n);
   mxLogical * Vp = static_cast<mxLogical*>(mxGetData(plhs[0]));
-
-  typedef typename DerivedV::Scalar Scalar;
-  const Scalar * V_data;
-  Matrix<Scalar, DerivedV::ColsAtCompileTime, DerivedV::RowsAtCompileTime, RowMajor> VT;
-  if(DerivedV::IsRowMajor)
-  {
-    VT = V.transpose();
-    V_data = VT.data();
-  }else
+  for(int i = 0;i<m;i++)
   {
-    V_data = V.data();
+    for(int j = 0;j<n;j++)
+    {
+      Vp[i+m*j] = V(i,j);
+    }
   }
-
-  copy(V_data,V_data+V.size(),Vp);
 }
 
 template <typename DerivedV>
@@ -63,7 +53,6 @@ IGL_INLINE void igl::matlab::prepare_lhs_index(
   mxArray *plhs[])
 {
   // Treat indices as reals
-  
   const auto Vd = (V.template cast<double>().array()+1).eval();
   return prepare_lhs_double(Vd,plhs);
 }

+ 1 - 1
include/igl/min_quad_with_fixed.cpp

@@ -536,7 +536,7 @@ IGL_INLINE bool igl::min_quad_with_fixed_solve(
   const Eigen::PlainObjectBase<DerivedBeq> & Beq,
   Eigen::PlainObjectBase<DerivedZ> & Z)
 {
-  Eigen::PlainObjectBase<DerivedZ> sol;
+  Eigen::Matrix<typename DerivedZ::Scalar, Eigen::Dynamic, Eigen::Dynamic> sol;
   return min_quad_with_fixed_solve(data,B,Y,Beq,Z,sol);
 }
 

+ 1 - 0
include/igl/mod.cpp

@@ -23,6 +23,7 @@ template <typename DerivedA>
 IGL_INLINE Eigen::PlainObjectBase<DerivedA> igl::mod(
   const Eigen::PlainObjectBase<DerivedA> & A, const int base)
 {
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
   Eigen::PlainObjectBase<DerivedA> B;
   mod(A,base,B);
   return B;

+ 1 - 0
include/igl/n_polyvector.cpp

@@ -39,6 +39,7 @@ namespace igl {
     Eigen::VectorXi indInteriorToFull;
     Eigen::VectorXi indFullToInterior;
 
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
     Eigen::PlainObjectBase<DerivedV> B1, B2, FN;
 
     IGL_INLINE void computek();

+ 1 - 0
include/igl/n_polyvector_general.cpp

@@ -36,6 +36,7 @@ namespace igl {
     Eigen::VectorXi indInteriorToFull;
     Eigen::VectorXi indFullToInterior;
 
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
     Eigen::PlainObjectBase<DerivedV> B1, B2, FN;
 
     IGL_INLINE void computek();

+ 1 - 1
include/igl/per_corner_normals.cpp

@@ -20,7 +20,7 @@ IGL_INLINE void igl::per_corner_normals(
 {
   using namespace Eigen;
   using namespace std;
-  Eigen::PlainObjectBase<DerivedV> FN;
+  Eigen::Matrix<typename DerivedV::Scalar,Eigen::Dynamic,3> FN;
   per_face_normals(V,F,FN);
   vector<vector<int> > VF,VFi;
   vertex_triangle_adjacency(V,F,VF,VFi);

+ 1 - 1
include/igl/per_edge_normals.cpp

@@ -90,7 +90,7 @@ IGL_INLINE void igl::per_edge_normals(
   Eigen::PlainObjectBase<DerivedE> & E,
   Eigen::PlainObjectBase<DerivedEMAP> & EMAP)
 {
-  Eigen::PlainObjectBase<DerivedN> FN;
+  Eigen::Matrix<typename DerivedN::Scalar,Eigen::Dynamic,3> FN;
   per_face_normals(V,F,FN);
   return per_edge_normals(V,F,weighting,FN,N,E,EMAP);
 }

+ 1 - 1
include/igl/per_vertex_normals.cpp

@@ -19,7 +19,7 @@ IGL_INLINE void igl::per_vertex_normals(
   const igl::PerVertexNormalsWeightingType weighting,
   Eigen::PlainObjectBase<DerivedV> & N)
 {
-  Eigen::PlainObjectBase<DerivedV> PFN;
+  Eigen::Matrix<typename DerivedV::Scalar,Eigen::Dynamic,3> PFN;
   igl::per_face_normals(V,F,PFN);
   return per_vertex_normals(V,F,weighting,PFN,N);
 }

+ 2 - 2
include/igl/polar_dec.cpp

@@ -84,8 +84,8 @@ IGL_INLINE void igl::polar_dec(
   Eigen::PlainObjectBase<DerivedR> & R,
   Eigen::PlainObjectBase<DerivedT> & T)
 {
-  Eigen::PlainObjectBase<DerivedA> U;
-  Eigen::PlainObjectBase<DerivedA> V;
+  DerivedA U;
+  DerivedA V;
   Eigen::Matrix<typename DerivedA::Scalar,DerivedA::RowsAtCompileTime,1> S;
   return igl::polar_dec(A,R,T,U,S,V);
 }

+ 2 - 2
include/igl/polar_svd.cpp

@@ -20,8 +20,8 @@ IGL_INLINE void igl::polar_svd(
   Eigen::PlainObjectBase<DerivedR> & R,
   Eigen::PlainObjectBase<DerivedT> & T)
 {
-  Eigen::PlainObjectBase<DerivedA> U;
-  Eigen::PlainObjectBase<DerivedA> V;
+  DerivedA U;
+  DerivedA V;
   Eigen::Matrix<typename DerivedA::Scalar,DerivedA::RowsAtCompileTime,1> S;
   return igl::polar_svd(A,R,T,U,S,V);
 }

+ 1 - 1
include/igl/polyvector_field_matchings.cpp

@@ -168,7 +168,7 @@ IGL_INLINE typename DerivedC::Scalar igl::polyvector_field_matchings(
   Eigen::MatrixXi E, E2F, F2E;
   igl::edge_topology(V,F,E,F2E,E2F);
 
-  Eigen::PlainObjectBase<DerivedV> FN;
+  Eigen::Matrix<typename DerivedV::Scalar,Eigen::Dynamic,3> FN;
   igl::per_face_normals(V,F,FN);
 
   return igl::polyvector_field_matchings(sol3D, V, F, E, FN, E2F, match_with_curl, match_ab, match_ba, curl);

+ 2 - 0
include/igl/randperm.cpp

@@ -23,6 +23,8 @@ IGL_INLINE void igl::randperm(
 template <typename DerivedI>
 IGL_INLINE Eigen::PlainObjectBase<DerivedI> igl::randperm( const int n)
 {
+
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
   Eigen::PlainObjectBase<DerivedI> I;
   randperm(n,I);
   return I;

+ 1 - 1
include/igl/remove_duplicate_vertices.cpp

@@ -26,7 +26,7 @@ IGL_INLINE void igl::remove_duplicate_vertices(
 {
   if(epsilon > 0)
   {
-    Eigen::PlainObjectBase<DerivedV> rV,rSV;
+    DerivedV rV,rSV;
     round((V/(10.0*epsilon)).eval(),rV);
     unique_rows(rV,rSV,SVI,SVJ);
     slice(V,SVI,colon<int>(0,V.cols()-1),SV);

+ 2 - 0
include/igl/slice.cpp

@@ -229,6 +229,7 @@ IGL_INLINE Eigen::PlainObjectBase<DerivedX> igl::slice(
   const Eigen::PlainObjectBase<DerivedX> & X,
   const Eigen::Matrix<int,Eigen::Dynamic,1> & R)
 {
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
   Eigen::PlainObjectBase<DerivedX> Y;
   igl::slice(X,R,Y);
   return Y;
@@ -240,6 +241,7 @@ IGL_INLINE Eigen::PlainObjectBase<DerivedX> igl::slice(
   const Eigen::Matrix<int,Eigen::Dynamic,1> & R,
   const int dim)
 {
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
   Eigen::PlainObjectBase<DerivedX> Y;
   igl::slice(X,R,dim,Y);
   return Y;

+ 2 - 0
include/igl/slice_mask.cpp

@@ -99,6 +99,7 @@ IGL_INLINE Eigen::PlainObjectBase<DerivedX> igl::slice_mask(
   const Eigen::Array<bool,Eigen::Dynamic,1> & R,
   const Eigen::Array<bool,Eigen::Dynamic,1> & C)
 {
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
   Eigen::PlainObjectBase<DerivedX> Y;
   igl::slice_mask(X,R,C,Y);
   return Y;
@@ -110,6 +111,7 @@ IGL_INLINE Eigen::PlainObjectBase<DerivedX> igl::slice_mask(
   const Eigen::Array<bool,Eigen::Dynamic,1> & R,
   const int dim)
 {
+#warning "Constructing Eigen::PlainObjectBase directly is deprecated"
   Eigen::PlainObjectBase<DerivedX> Y;
   igl::slice_mask(X,R,dim,Y);
   return Y;

+ 3 - 4
include/igl/triangle_triangle_adjacency.h

@@ -45,10 +45,9 @@ namespace igl
     Eigen::PlainObjectBase<Index>& TTi);
 
   template <typename DerivedF, typename DerivedTT, typename DerivedTTi>
-  IGL_INLINE void triangle_triangle_adjacency(
-    const Eigen::PlainObjectBase<DerivedF>& F,
-    Eigen::PlainObjectBase<DerivedTT>& TT,
-    Eigen::PlainObjectBase<DerivedTTi>& TTi);
+    IGL_INLINE void triangle_triangle_adjacency( const
+        Eigen::PlainObjectBase<DerivedF>& F, Eigen::PlainObjectBase<DerivedTT>&
+        TT, Eigen::PlainObjectBase<DerivedTTi>& TTi);
 
 
   // Preprocessing

+ 1 - 1
include/igl/unique.cpp

@@ -209,7 +209,7 @@ IGL_INLINE void igl::unique_rows(
   using namespace std;
   using namespace Eigen;
   VectorXi IM;
-  Eigen::PlainObjectBase<DerivedA> sortA;
+  DerivedA sortA;
   sortrows(A,true,sortA,IM);
 
 

+ 1 - 1
include/igl/volume.cpp

@@ -46,7 +46,7 @@ IGL_INLINE void igl::volume(
   const auto & AmD = A-D;
   const auto & BmD = B-D;
   const auto & CmD = C-D;
-  Eigen::PlainObjectBase<DerivedA> BmDxCmD;
+  DerivedA BmDxCmD;
   cross(BmD.eval(),CmD.eval(),BmDxCmD);
   const auto & AmDdx = (AmD.array() * BmDxCmD.array()).rowwise().sum();
   vol = -AmDdx/6.;