#ifndef IGL_MAX_SIZE_H #define IGL_MAX_SIZE_H #include namespace igl { // Determine max size of lists in a vector // Template: // T some list type object that implements .size() // Inputs: // V vector of list types T // Returns max .size() found in V, returns -1 if V is empty template inline int max_size(const std::vector & V); } // Implementation template inline int igl::max_size(const std::vector & V) { int max_size = -1; for( typename std::vector::const_iterator iter = V.begin(); iter != V.end(); iter++) { int size = (int)iter->size(); max_size = (max_size > size ? max_size : size); } return max_size; } #endif