votca 2024.2-dev
Loading...
Searching...
No Matches
datacollection.cc
Go to the documentation of this file.
1/*
2 * Copyright 2009-2020 The VOTCA Development Team (http://www.votca.org)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
18// Standard includes
19#include <sstream>
20
21// Local VOTCA includes
23
24namespace votca {
25namespace tools {
26
27std::ostream& operator<<(std::ostream& out,
29 if (sel.empty()) {
30 out << "-- empty selection --" << std::endl;
31 return out;
32 }
33
34 std::stringstream s;
35 for (size_t i = 0;; ++i) {
36 s.clear();
37 s.str("");
38 s.setf(std::ios::scientific);
39 Index written = 0;
40 for (auto& array : sel) {
41 if (i >= array->size()) {
42 s << " -";
43 continue;
44 }
45 written++;
46 s << " " << (*array)[i];
47 }
48 if (written == 0) {
49 return out;
50 }
51 out << i << s.str() << std::endl;
52 }
53 return out;
54}
55
56} // namespace tools
57} // namespace votca
std::ostream & operator<<(std::ostream &out, const Correlate &c)
Definition correlate.h:53
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26