Commit 90bf75e9dcb2edf5b8ce3f00f82d17d5e9b9e278
1 parent
61402473
add G_NAXIS definition
Showing
1 changed file
with
8 additions
and
7 deletions
src/obs/GEventCube.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GEventCube.cpp - Abstract event cube container class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright : (C) 2009 by Jurgen Knodlseder * | |
| 4 | + * copyright (C) 2009-2010 by Jurgen Knodlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software; you can redistribute it and/or modify * |
| ... | ... | @@ -23,7 +23,8 @@ |
| 23 | 23 | #include "GEventCube.hpp" |
| 24 | 24 | |
| 25 | 25 | /* __ Method name definitions ____________________________________________ */ |
| 26 | -#define G_COPY_MEMBERS "GEventCube::copy_members(const GEventCube&)" | |
| 26 | +#define G_COPY_MEMBERS "GEventCube::copy_members(GEventCube)" | |
| 27 | +#define G_NAXIS "GEventCube::naxis(int)" | |
| 27 | 28 | |
| 28 | 29 | /* __ Macros _____________________________________________________________ */ |
| 29 | 30 | |
| ... | ... | @@ -155,7 +156,7 @@ int GEventCube::naxis(int axis) const |
| 155 | 156 | if (m_naxis == NULL || axis < 0 || axis >= m_dim) |
| 156 | 157 | throw GException::out_of_range(G_NAXIS, axis, 0, m_dim-1); |
| 157 | 158 | #endif |
| 158 | - | |
| 159 | + | |
| 159 | 160 | // Return axis dimension |
| 160 | 161 | return m_naxis[axis]; |
| 161 | 162 | } |
| ... | ... | @@ -176,7 +177,7 @@ void GEventCube::init_members(void) |
| 176 | 177 | m_elements = 0; |
| 177 | 178 | m_dim = 0; |
| 178 | 179 | m_naxis = NULL; |
| 179 | - | |
| 180 | + | |
| 180 | 181 | // Return |
| 181 | 182 | return; |
| 182 | 183 | } |
| ... | ... | @@ -195,7 +196,7 @@ void GEventCube::copy_members(const GEventCube& cube) |
| 195 | 196 | |
| 196 | 197 | // If the cube is not empty then copy it |
| 197 | 198 | if (m_dim > 0 && cube.m_naxis != NULL) { |
| 198 | - | |
| 199 | + | |
| 199 | 200 | // Allocate memory |
| 200 | 201 | m_naxis = new int[m_dim]; |
| 201 | 202 | if (m_naxis == NULL) |
| ... | ... | @@ -251,11 +252,11 @@ std::ostream& operator<< (std::ostream& os, const GEventCube& cube) |
| 251 | 252 | os << " Number of cube elements ...: " << cube.elements() << std::endl; |
| 252 | 253 | os << " Cube dimension ............: " << cube.dim() << std::endl; |
| 253 | 254 | for (int axis = 0; axis < cube.m_dim; ++axis) { |
| 254 | - os << " Axis " << axis+1 << " dimension ..........: " | |
| 255 | + os << " Axis " << axis+1 << " dimension ..........: " | |
| 255 | 256 | << cube.naxis(axis) << std::endl; |
| 256 | 257 | } |
| 257 | 258 | } |
| 258 | - | |
| 259 | + | |
| 259 | 260 | // Return output stream |
| 260 | 261 | return os; |
| 261 | 262 | } | ... | ... |