Debian Codegraph @

packages/tpetra/core/test/MPIAdvance/print_vec.hpp

raw
1 // @HEADER
2 // *****************************************************************************
3 // Tpetra: Templated Linear Algebra Services Package
4 //
5 // Copyright 2008 NTESS and the Tpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9
10 #pragma once
11
12 #include <iostream>
13
14 template <typename V>
15 void print_vec(const std::string &label, const V &vec) {
16 std::stringstream ss;
17 ss << label << ":";
18 for (const auto &e : vec) {
19 ss << " " << e;
20 }
21 std::cerr << ss.str() << std::endl;
22 }
23
24 template <typename V>
25 void print_vec(const int rank, const std::string &label, const V &vec) {
26 std::stringstream ss;
27 ss << "[" << rank << "]" << label;
28 print_vec(ss.str(), vec);
29 }