CMS 3D CMS Logo

Grid3D.cc
Go to the documentation of this file.
1 #include "Grid3D.h"
2 #include <iostream>
3 
4 /*
5 Grid3D::Grid3D( const Grid1D& ga, const Grid1D& gb, const Grid1D& gc,
6  std::vector<ValueType> const & data) :
7  grida_(ga), gridb_(gb), gridc_(gc) {
8  data_.reserve(data.size());
9  //FIXME use a std algo
10  for (size_t i=0; i<=data.size(); ++i)
11  data_.push_back(ValueType(data[i].x(),data[i].y(),data[i].z()));
12  stride1_ = gridb_.nodes() * gridc_.nodes();
13  stride2_ = gridc_.nodes();
14 }
15 */
16 
17 void Grid3D::dump() const {
18  for (int j = 0; j < gridb().nodes(); ++j) {
19  for (int k = 0; k < gridc().nodes(); ++k) {
20  for (int i = 0; i < grida().nodes(); ++i) {
21  std::cout << grida().node(i) << " " << gridb().node(j) << " " << gridc().node(k) << " " << operator()(i, j, k)
22  << std::endl;
23  }
24  }
25  }
26 }
const Grid1D & grida() const
Definition: Grid3D.h:59
void dump() const
Definition: Grid3D.cc:17
Scalar node(int i) const
Definition: Grid1D.h:24
int nodes() const
Definition: Grid1D.h:21
const Grid1D & gridb() const
Definition: Grid3D.h:60
const Grid1D & gridc() const
Definition: Grid3D.h:61
ValueType operator()(int i) const
Definition: Grid3D.h:55