Commit 75e0d5ec77c8dba1c2af68eabb5af881dbd8e6d7

Authored by Jürgen Knödlseder
1 parent 41f76ab4

Use GMatrix instead of GMatrixSpare (#3203)

include/GResponse.hpp
... ... @@ -113,7 +113,8 @@ public:
113 113 const GObservation& obs) const;
114 114 virtual GVector irf_spatial(const GModelSky& model,
115 115 const GObservation& obs,
116   - GMatrixSparse* gradients = NULL) const;
  116 + //GMatrixSparse* gradients = NULL) const;
  117 + GMatrix* gradients = NULL) const;
117 118 virtual void remove_response_cache(const std::string& name);
118 119  
119 120 protected:
... ... @@ -149,19 +150,24 @@ protected:
149 150 const GObservation& obs) const;
150 151 virtual GVector irf_ptsrc(const GModelSky& model,
151 152 const GObservation& obs,
152   - GMatrixSparse* gradients = NULL) const;
  153 + //GMatrixSparse* gradients = NULL) const;
  154 + GMatrix* gradients = NULL) const;
153 155 virtual GVector irf_radial(const GModelSky& model,
154 156 const GObservation& obs,
155   - GMatrixSparse* gradients = NULL) const;
  157 + //GMatrixSparse* gradients = NULL) const;
  158 + GMatrix* gradients = NULL) const;
156 159 virtual GVector irf_elliptical(const GModelSky& model,
157 160 const GObservation& obs,
158   - GMatrixSparse* gradients = NULL) const;
  161 + //GMatrixSparse* gradients = NULL) const;
  162 + GMatrix* gradients = NULL) const;
159 163 virtual GVector irf_diffuse(const GModelSky& model,
160 164 const GObservation& obs,
161   - GMatrixSparse* gradients = NULL) const;
  165 + //GMatrixSparse* gradients = NULL) const;
  166 + GMatrix* gradients = NULL) const;
162 167 virtual GVector irf_composite(const GModelSky& model,
163 168 const GObservation& obs,
164   - GMatrixSparse* gradients = NULL) const;
  169 + //GMatrixSparse* gradients = NULL) const;
  170 + GMatrix* gradients = NULL) const;
165 171  
166 172 // Protected classes
167 173 class edisp_kerns : public GFunctions {
... ...
inst/cta/include/GCTAResponseCube.hpp
... ... @@ -155,7 +155,8 @@ private:
155 155 // New methods
156 156 GVector irf_radial(const GModelSky& model,
157 157 const GObservation& obs,
158   - GMatrixSparse* gradients = NULL) const;
  158 + //GMatrixSparse* gradients = NULL) const;
  159 + GMatrix* gradients = NULL) const;
159 160 GVector psf_radial(const GModelSpatialRadial* model,
160 161 const double& zeta,
161 162 const GSkyDir& obsDir,
... ...
inst/cta/src/GCTAResponseCube.cpp
... ... @@ -1750,7 +1750,8 @@ double GCTAResponseCube::irf_diffuse(const GEvent& event,
1750 1750 ***************************************************************************/
1751 1751 GVector GCTAResponseCube::irf_radial(const GModelSky& model,
1752 1752 const GObservation& obs,
1753   - GMatrixSparse* gradients) const
  1753 +// GMatrixSparse* gradients) const
  1754 + GMatrix* gradients) const
1754 1755 {
1755 1756 // Get number of events
1756 1757 int nevents = obs.events()->size();
... ... @@ -1868,7 +1869,7 @@ GVector GCTAResponseCube::irf_radial(const GModelSky& model,
1868 1869 // matrix
1869 1870 if (grad) {
1870 1871 for (int ipar = 0; ipar < npars; ++ipar) {
1871   - gradients->add_to_column(ipar, gradient[ipar]);
  1872 + gradients->column(ipar, gradient[ipar]);
1872 1873 }
1873 1874 }
1874 1875  
... ...
src/obs/GResponse.cpp
... ... @@ -668,7 +668,8 @@ double GResponse::irf_spatial(const GEvent&amp; event,
668 668 ***************************************************************************/
669 669 GVector GResponse::irf_spatial(const GModelSky& model,
670 670 const GObservation& obs,
671   - GMatrixSparse* gradients) const
  671 + //GMatrixSparse* gradients) const
  672 + GMatrix* gradients) const
672 673 {
673 674 // Get number of model parameters and number of events
674 675 int npars = model.size();
... ... @@ -1253,7 +1254,8 @@ double GResponse::irf_composite(const GEvent&amp; event,
1253 1254 ***************************************************************************/
1254 1255 GVector GResponse::irf_ptsrc(const GModelSky& model,
1255 1256 const GObservation& obs,
1256   - GMatrixSparse* gradients) const
  1257 + //GMatrixSparse* gradients) const
  1258 + GMatrix* gradients) const
1257 1259 {
1258 1260 // Get number of events
1259 1261 int nevents = obs.events()->size();
... ... @@ -1296,7 +1298,8 @@ GVector GResponse::irf_ptsrc(const GModelSky&amp; model,
1296 1298 ***************************************************************************/
1297 1299 GVector GResponse::irf_radial(const GModelSky& model,
1298 1300 const GObservation& obs,
1299   - GMatrixSparse* gradients) const
  1301 +// GMatrixSparse* gradients) const
  1302 + GMatrix* gradients) const
1300 1303 {
1301 1304 // Get number of events
1302 1305 int nevents = obs.events()->size();
... ... @@ -1339,7 +1342,8 @@ GVector GResponse::irf_radial(const GModelSky&amp; model,
1339 1342 ***************************************************************************/
1340 1343 GVector GResponse::irf_elliptical(const GModelSky& model,
1341 1344 const GObservation& obs,
1342   - GMatrixSparse* gradients) const
  1345 + //GMatrixSparse* gradients) const
  1346 + GMatrix* gradients) const
1343 1347 {
1344 1348 // Get number of events
1345 1349 int nevents = obs.events()->size();
... ... @@ -1382,7 +1386,8 @@ GVector GResponse::irf_elliptical(const GModelSky&amp; model,
1382 1386 ***************************************************************************/
1383 1387 GVector GResponse::irf_diffuse(const GModelSky& model,
1384 1388 const GObservation& obs,
1385   - GMatrixSparse* gradients) const
  1389 + //GMatrixSparse* gradients) const
  1390 + GMatrix* gradients) const
1386 1391 {
1387 1392 // Get number of events
1388 1393 int nevents = obs.events()->size();
... ... @@ -1425,7 +1430,8 @@ GVector GResponse::irf_diffuse(const GModelSky&amp; model,
1425 1430 ***************************************************************************/
1426 1431 GVector GResponse::irf_composite(const GModelSky& model,
1427 1432 const GObservation& obs,
1428   - GMatrixSparse* gradients) const
  1433 + //GMatrixSparse* gradients) const
  1434 + GMatrix* gradients) const
1429 1435 {
1430 1436 // Get number of events
1431 1437 int nevents = obs.events()->size();
... ... @@ -1631,7 +1637,8 @@ GVector GResponse::eval_probs(const GModelSky&amp; model,
1631 1637 if (model.spatial() != NULL) {
1632 1638  
1633 1639 // Initialise sparse matrix to hold spatial gradients
1634   - GMatrixSparse spat_gradients(nevents, model.spatial()->size());
  1640 + //GMatrixSparse spat_gradients(nevents, model.spatial()->size());
  1641 + GMatrix spat_gradients(nevents, model.spatial()->size());
1635 1642  
1636 1643 // Compute IRF value
1637 1644 //probs = irf_spatial(model, obs);
... ...