CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/MagneticField/Interpolation/src/Grid3D.cc

Go to the documentation of this file.
00001 #include "Grid3D.h"
00002 #include <iostream>
00003 
00004 
00005 /*
00006 Grid3D::Grid3D( const Grid1D& ga, const Grid1D& gb, const Grid1D& gc,
00007                 std::vector<ValueType> const & data) : 
00008   grida_(ga), gridb_(gb), gridc_(gc) {
00009   data_.reserve(data.size());
00010   //FIXME use a std algo
00011   for (size_t i=0; i<=data.size(); ++i)
00012     data_.push_back(ValueType(data[i].x(),data[i].y(),data[i].z()));
00013   stride1_ = gridb_.nodes() * gridc_.nodes();
00014   stride2_ = gridc_.nodes();
00015 }
00016 */
00017 
00018 void Grid3D::dump() const
00019 {
00020   for (int j=0; j<gridb().nodes(); ++j) {
00021     for (int k=0; k<gridc().nodes(); ++k) {
00022       for (int i=0; i<grida().nodes(); ++i) {
00023         std::cout << grida().node(i) << " " << gridb().node(j) << " " << gridc().node(k) << " " 
00024                   << operator()(i,j,k) << std::endl;
00025       }
00026     }
00027   }
00028 }
00029 
00030