BlockSolver

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#ifndef __CINT__
#ifndef BlockSolver_H
#define BlockSolver_H

#include <map>
#include <string>
#include <vector>

#include "CLHEP/Matrix/GenMatrix.h"
#include "CLHEP/Matrix/Matrix.h"
#include "CLHEP/Matrix/Vector.h"
#include "CLHEP/Random/RandGaussQ.h"

#include "Calibration/Tools/interface/InvMatrixCommonDefs.h"

/** \class BlockSolver
 
    \brief solves at best the matrix invertion for calibration 

*/
struct BlockSolver {
  int operator()(const CLHEP::HepMatrix& matrix, const CLHEP::HepVector& vector, CLHEP::HepVector& result);

private:
  //! eliminate empty columns and rows
  void shrink(const CLHEP::HepMatrix& matrix,
              CLHEP::HepMatrix& solution,
              const CLHEP::HepVector& result,
              CLHEP::HepVector& input,
              const std::vector<int>& where);
  //! pour results in bigger vector
  void pour(CLHEP::HepVector& result, const CLHEP::HepVector& output, const std::vector<int>& where);
};

#endif
#endif