tools.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * NICE-Core - efficient algebra and computer vision methods
  3. * - libfbasics - library of some basic tools
  4. * See file License for license information.
  5. */
  6. #ifndef _FBASICS_TOOLS_H
  7. #define _FBASICS_TOOLS_H
  8. #include <core/basics/numerictools.h>
  9. #include <vector>
  10. #include <string>
  11. #include <ostream>
  12. #define UNUSED_PARAMETER(parameter) {(void)parameter;};
  13. namespace NICE {
  14. /**
  15. * Delete elements in an STL container in the range [begin, end).
  16. */
  17. template<class T>
  18. void deleteElements(const T& begin, const T& end) {
  19. for (T iter = begin; iter != end; ++iter) {
  20. delete *iter;
  21. }
  22. }
  23. /**
  24. * Output a string matrix as latex tabular on an \c std::ostream.
  25. * @param out target stream
  26. * @param data data matrix, row major (a list of lines, each has columns)
  27. */
  28. void writeLatexTabular(std::ostream& out,
  29. std::vector<std::vector<std::string> >& data,
  30. bool heading = false,
  31. bool hlines = false,
  32. bool vlines = false);
  33. };
  34. #endif // _FBASICS_TOOLS_H