max_size.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 "max_size.h"
  9. template <typename T>
  10. IGL_INLINE int igl::max_size(const std::vector<T> & V)
  11. {
  12. int max_size = -1;
  13. for(
  14. typename std::vector<T>::const_iterator iter = V.begin();
  15. iter != V.end();
  16. iter++)
  17. {
  18. int size = (int)iter->size();
  19. max_size = (max_size > size ? max_size : size);
  20. }
  21. return max_size;
  22. }
  23. #ifdef IGL_STATIC_LIBRARY
  24. // Explicit template specialization
  25. // generated by autoexplicit.sh
  26. template int igl::max_size<std::vector<unsigned int, std::allocator<unsigned int> > >(std::vector<std::vector<unsigned int, std::allocator<unsigned int> >, std::allocator<std::vector<unsigned int, std::allocator<unsigned int> > > > const&);
  27. // generated by autoexplicit.sh
  28. template int igl::max_size<std::vector<int, std::allocator<int> > >(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&);
  29. // generated by autoexplicit.sh
  30. template int igl::max_size<std::vector<double, std::allocator<double> > >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&);
  31. template int igl::max_size<std::vector<bool, std::allocator<bool> > >(std::vector<std::vector<bool, std::allocator<bool> >, std::allocator<std::vector<bool, std::allocator<bool> > > > const&);
  32. template int igl::max_size<std::vector<float, std::allocator<float> > >(std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > > const&);
  33. #endif