CMS 3D CMS Logo

Functions
PulseChiSqSNNLS.cc File Reference
#include "RecoLocalCalo/EcalRecAlgos/interface/PulseChiSqSNNLS.h"
#include <cmath>
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include <iostream>

Go to the source code of this file.

Functions

void eigen_solve_submatrix (PulseMatrix &mat, PulseVector &invec, PulseVector &outvec, unsigned NP)
 

Function Documentation

void eigen_solve_submatrix ( PulseMatrix mat,
PulseVector invec,
PulseVector outvec,
unsigned  NP 
)

Definition at line 6 of file PulseChiSqSNNLS.cc.

References Exception, and groupFilesInBlocks::temp.

Referenced by PulseChiSqSNNLS::NNLS().

6  {
7  using namespace Eigen;
8  switch( NP ) { // pulse matrix is always square.
9  case 10:
10  {
11  Matrix<double,10,10> temp = mat.topLeftCorner<10,10>();
12  outvec.head<10>() = temp.ldlt().solve(invec.head<10>());
13  }
14  break;
15  case 9:
16  {
17  Matrix<double,9,9> temp = mat.topLeftCorner<9,9>();
18  outvec.head<9>() = temp.ldlt().solve(invec.head<9>());
19  }
20  break;
21  case 8:
22  {
23  Matrix<double,8,8> temp = mat.topLeftCorner<8,8>();
24  outvec.head<8>() = temp.ldlt().solve(invec.head<8>());
25  }
26  break;
27  case 7:
28  {
29  Matrix<double,7,7> temp = mat.topLeftCorner<7,7>();
30  outvec.head<7>() = temp.ldlt().solve(invec.head<7>());
31  }
32  break;
33  case 6:
34  {
35  Matrix<double,6,6> temp = mat.topLeftCorner<6,6>();
36  outvec.head<6>() = temp.ldlt().solve(invec.head<6>());
37  }
38  break;
39  case 5:
40  {
41  Matrix<double,5,5> temp = mat.topLeftCorner<5,5>();
42  outvec.head<5>() = temp.ldlt().solve(invec.head<5>());
43  }
44  break;
45  case 4:
46  {
47  Matrix<double,4,4> temp = mat.topLeftCorner<4,4>();
48  outvec.head<4>() = temp.ldlt().solve(invec.head<4>());
49  }
50  break;
51  case 3:
52  {
53  Matrix<double,3,3> temp = mat.topLeftCorner<3,3>();
54  outvec.head<3>() = temp.ldlt().solve(invec.head<3>());
55  }
56  break;
57  case 2:
58  {
59  Matrix<double,2,2> temp = mat.topLeftCorner<2,2>();
60  outvec.head<2>() = temp.ldlt().solve(invec.head<2>());
61  }
62  break;
63  case 1:
64  {
65  Matrix<double,1,1> temp = mat.topLeftCorner<1,1>();
66  outvec.head<1>() = temp.ldlt().solve(invec.head<1>());
67  }
68  break;
69  default:
70  throw cms::Exception("MultFitWeirdState")
71  << "Weird number of pulses encountered in multifit, module is configured incorrectly!";
72  }
73 }