concat.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #ifndef IGL_CONCAT_H
  9. #define IGL_CONCAT_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. namespace igl
  13. {
  14. // Concatenates dense matrices
  15. // Templates:
  16. // T should be a eigen matrix primitive type like int or double
  17. // Inputs:
  18. // A first matrix
  19. // B second matrix
  20. // horiz if true, matrices are concatenated horizontally
  21. // Output:
  22. // O if horiz = false return [A;B] else [A,B]
  23. template <typename T>
  24. IGL_INLINE void concat(
  25. const T A,
  26. const T B,
  27. const bool horiz,
  28. T& O);
  29. template <typename T>
  30. IGL_INLINE T concat(
  31. const T A,
  32. const T B,
  33. bool horiz = false
  34. );
  35. }
  36. #ifdef IGL_HEADER_ONLY
  37. # include "concat.cpp"
  38. #endif
  39. #endif