// 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 "list_to_matrix.h" #include #include #include #include "max_size.h" #include "min_size.h" template IGL_INLINE bool igl::list_to_matrix(const std::vector > & V,Mat & M) { // number of rows int m = V.size(); if(m == 0) { //fprintf(stderr,"Error: list_to_matrix() list is empty()\n"); //return false; M.resize(0,0); return true; } // number of columns int n = igl::min_size(V); if(n != igl::max_size(V)) { fprintf(stderr,"Error: list_to_matrix()" " list elements are not all the same size: (min: %d, max: %d)\n", n,igl::max_size(V)); return false; } assert(n != -1); // Resize output M.resize(m,n); // Loop over rows for(int i = 0;i IGL_INLINE bool igl::list_to_matrix(const std::vector & V,Mat & M) { // number of rows int m = V.size(); if(m == 0) { //fprintf(stderr,"Error: list_to_matrix() list is empty()\n"); //return false; if(Mat::ColsAtCompileTime == 1) { M.resize(0,1); }else if(Mat::RowsAtCompileTime == 1) { M.resize(1,0); }else { M.resize(0,0); } return true; } // Resize output if(Mat::RowsAtCompileTime == 1) { M.resize(1,m); }else { M.resize(m,1); } // Loop over rows for(int i = 0;i >(std::vector > const&, Eigen::Matrix&); // generated by autoexplicit.sh template bool igl::list_to_matrix > >(std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase >&); // generated by autoexplicit.sh template bool igl::list_to_matrix > >(std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase >&); // generated by autoexplicit.sh template bool igl::list_to_matrix > >(std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase >&); // generated by autoexplicit.sh template bool igl::list_to_matrix >(std::vector >, std::allocator > > > const&, Eigen::Matrix&); // generated by autoexplicit.sh template bool igl::list_to_matrix >(std::vector >, std::allocator > > > const&, Eigen::Matrix&); // generated by autoexplicit.sh template bool igl::list_to_matrix >(std::vector >, std::allocator > > > const&, Eigen::Matrix&); template bool igl::list_to_matrix > >(std::vector > const&, Eigen::PlainObjectBase >&); template bool igl::list_to_matrix > >(std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase >&); template bool igl::list_to_matrix > >(std::vector > const&, Eigen::PlainObjectBase >&); template bool igl::list_to_matrix >(std::vector >, std::allocator > > > const&, Eigen::Matrix&); template bool igl::list_to_matrix >(std::vector > const&, Eigen::Matrix&); template bool igl::list_to_matrix > >(std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase >&); template bool igl::list_to_matrix > >(std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase >&); template bool igl::list_to_matrix > >(std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase >&); template bool igl::list_to_matrix >(std::vector > const&, Eigen::Matrix&); template bool igl::list_to_matrix > >(std::vector > const&, Eigen::PlainObjectBase >&); template bool igl::list_to_matrix > >(std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase >&); template bool igl::list_to_matrix > >(std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase >&); template bool igl::list_to_matrix >(std::vector > const&, Eigen::Matrix&); template bool igl::list_to_matrix > >(std::vector > const&, Eigen::PlainObjectBase >&); #endif