Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
FITL1DT Namespace Reference

Functions

JMatrixNS removeRowColumn (const JMatrixNS &A, int C)
 
vector< double > dotprod (const JMatrixNS &A, const vector< double > &x)
 

Function Documentation

◆ removeRowColumn()

JMatrixNS FITL1DT::removeRowColumn ( const JMatrixNS & A,
int C )

Definition at line 26 of file JFitL1dt.cc.

26 {
27 const int N = A.size() - 1;
28 JMatrixNS ret(N);
29 int k = 0;
30 for (int i = 0; i < N+1; i++) {
31 if (i == C) {
32 continue;
33 }
34 int l = 0;
35 for (int j = 0; j < N+1; j++) {
36 if (j == C) {
37 continue;
38 }
39 ret.at(k,l) = A.at(i,j);
40 l++;
41 }
42 k++;
43 }
44 return ret;
45 }
N x N symmetric matrix.
Definition JMatrixNS.hh:30

◆ dotprod()

vector< double > FITL1DT::dotprod ( const JMatrixNS & A,
const vector< double > & x )

Definition at line 48 of file JFitL1dt.cc.

48 {
49 if (A.size() != x.size()) {
50 cout << "Can not evaluate dot product: dimensions dont match" << endl;
51 return vector<double>(0, 0.0);
52 }
53 vector<double> ret(A.size(), 0.0);
54 for (unsigned int i = 0; i < A.size(); ++i) {
55 for (unsigned int j = 0; j < A.size(); ++j) {
56 ret.at(i) += A.at(i,j) * x.at(j);
57 }
58 }
59 return ret;
60 }