File: Histogram2D.cpp

package info (click to toggle)
ausaxs 1.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 72,592 kB
  • sloc: cpp: 49,853; ansic: 6,901; python: 730; makefile: 18
file content (19 lines) | stat: -rw-r--r-- 678 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// SPDX-License-Identifier: LGPL-3.0-or-later
// Author: Kristian Lytje

#include <hist/Histogram2D.h>

using namespace ausaxs::hist;

std::string Histogram2D::to_string() const {
    std::string str;
    str += "x_axis: " + std::to_string(x_axis.bins) + " " + std::to_string(x_axis.min) + " " + std::to_string(x_axis.max) + "\n";
    str += "x_axis: " + std::to_string(y_axis.bins) + " " + std::to_string(y_axis.min) + " " + std::to_string(y_axis.max) + "\n";
    for (unsigned int i = 0; i < x_axis.bins; i++) {
        for (unsigned int j = 0; j < y_axis.bins; j++) {
            str += std::to_string(data[i][j]) + " ";
        }
        str += "\n";
    }
    return str;
}