Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
CLHEP
CLHEP
Commits
96cce689
Commit
96cce689
authored
Jan 11, 2013
by
Lynn Garren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
protect against shadow warnings
parent
8f2649a9
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
843 additions
and
834 deletions
+843
-834
ChangeLog
ChangeLog
+5
-0
Matrix/ChangeLog
Matrix/ChangeLog
+5
-0
Matrix/Matrix/DiagMatrix.h
Matrix/Matrix/DiagMatrix.h
+33
-33
Matrix/Matrix/DiagMatrix.icc
Matrix/Matrix/DiagMatrix.icc
+1
-1
Matrix/Matrix/Matrix.h
Matrix/Matrix/Matrix.h
+59
-59
Matrix/Matrix/Matrix.icc
Matrix/Matrix/Matrix.icc
+5
-5
Matrix/Matrix/SymMatrix.h
Matrix/Matrix/SymMatrix.h
+35
-35
Matrix/Matrix/SymMatrix.icc
Matrix/Matrix/SymMatrix.icc
+2
-2
Matrix/Matrix/Vector.h
Matrix/Matrix/Vector.h
+10
-10
Matrix/src/DiagMatrix.cc
Matrix/src/DiagMatrix.cc
+181
-181
Matrix/src/GenMatrix.cc
Matrix/src/GenMatrix.cc
+20
-21
Matrix/src/Matrix.cc
Matrix/src/Matrix.cc
+116
-116
Matrix/src/MatrixEqRotation.cc
Matrix/src/MatrixEqRotation.cc
+12
-12
Matrix/src/MatrixLinear.cc
Matrix/src/MatrixLinear.cc
+35
-35
Matrix/src/SymMatrix.cc
Matrix/src/SymMatrix.cc
+212
-212
Matrix/src/Vector.cc
Matrix/src/Vector.cc
+112
-112
No files found.
ChangeLog
View file @
96cce689
2013-01-11 Lynn Garren <garren@fnal.gov>
* Matrix: change the names of more internal variables so -Wshadow does not complain
==============================
14.11.12 Release CLHEP-2.1.3.1
==============================
...
...
Matrix/ChangeLog
View file @
96cce689
2013-01-11 Lynn Garren <garren@fnal.gov>
* change the names of more internal variables so -Wshadow does not complain
==============================
14.11.12 Release CLHEP-2.1.3.1
==============================
...
...
Matrix/Matrix/DiagMatrix.h
View file @
96cce689
...
...
@@ -50,7 +50,7 @@ public:
HepDiagMatrix
(
int
p
,
HepRandom
&
r
);
HepDiagMatrix
(
const
HepDiagMatrix
&
m1
);
HepDiagMatrix
(
const
HepDiagMatrix
&
h
m1
);
// Copy constructor.
virtual
~
HepDiagMatrix
();
...
...
@@ -71,13 +71,13 @@ public:
// Must be row>=col;
// ** Note that indexing starts from (1,1). **
void
assign
(
const
HepMatrix
&
m2
);
// Assigns m2 to d, assuming m2 is a diagnal matrix.
void
assign
(
const
HepMatrix
&
h
m2
);
// Assigns
h
m2 to d, assuming
h
m2 is a diagnal matrix.
void
assign
(
const
HepSymMatrix
&
m2
);
// Assigns m2 to d, assuming m2 is a diagnal matrix.
void
assign
(
const
HepSymMatrix
&
h
m2
);
// Assigns
h
m2 to d, assuming
h
m2 is a diagnal matrix.
void
assign
(
const
HepDiagMatrix
&
m2
);
void
assign
(
const
HepDiagMatrix
&
h
m2
);
// Another form of assignment. For consistency.
HepDiagMatrix
&
operator
*=
(
double
t
);
...
...
@@ -86,11 +86,11 @@ public:
HepDiagMatrix
&
operator
/=
(
double
t
);
// Divide a DiagMatrix by a floating number
HepDiagMatrix
&
operator
+=
(
const
HepDiagMatrix
&
m2
);
HepDiagMatrix
&
operator
-=
(
const
HepDiagMatrix
&
m2
);
HepDiagMatrix
&
operator
+=
(
const
HepDiagMatrix
&
h
m2
);
HepDiagMatrix
&
operator
-=
(
const
HepDiagMatrix
&
h
m2
);
// Add or subtract a DiagMatrix.
HepDiagMatrix
&
operator
=
(
const
HepDiagMatrix
&
m2
);
HepDiagMatrix
&
operator
=
(
const
HepDiagMatrix
&
h
m2
);
// Assignment operator. To assign SymMatrix to DiagMatrix, use d<<s.
HepDiagMatrix
operator
-
()
const
;
...
...
@@ -103,10 +103,10 @@ public:
int
,
int
))
const
;
// Apply a function to all elements of the matrix.
HepSymMatrix
similarity
(
const
HepMatrix
&
m1
)
const
;
// Returns m1*s*m1.T().
HepSymMatrix
similarityT
(
const
HepMatrix
&
m1
)
const
;
// Returns m1.T()*s*m1.
HepSymMatrix
similarity
(
const
HepMatrix
&
h
m1
)
const
;
// Returns
h
m1*s*
h
m1.T().
HepSymMatrix
similarityT
(
const
HepMatrix
&
h
m1
)
const
;
// Returns
h
m1.T()*s*
h
m1.
double
similarity
(
const
HepVector
&
)
const
;
// Returns v.T()*s*v (This is a scaler).
...
...
@@ -117,8 +117,8 @@ public:
// SGI CC bug. I have to have both with/without const. I should not need
// one without const.
void
sub
(
int
row
,
const
HepDiagMatrix
&
m1
);
// Sub matrix of this SymMatrix is replaced with m1.
void
sub
(
int
row
,
const
HepDiagMatrix
&
h
m1
);
// Sub matrix of this SymMatrix is replaced with
h
m1.
HepDiagMatrix
inverse
(
int
&
ierr
)
const
;
// Invert a Matrix. The matrix is not changed
...
...
@@ -176,15 +176,15 @@ private:
friend
class
HepMatrix
;
friend
class
HepSymMatrix
;
friend
HepDiagMatrix
operator
*
(
const
HepDiagMatrix
&
m1
,
const
HepDiagMatrix
&
m2
);
friend
HepDiagMatrix
operator
+
(
const
HepDiagMatrix
&
m1
,
const
HepDiagMatrix
&
m2
);
friend
HepDiagMatrix
operator
-
(
const
HepDiagMatrix
&
m1
,
const
HepDiagMatrix
&
m2
);
friend
HepMatrix
operator
*
(
const
HepDiagMatrix
&
m1
,
const
HepMatrix
&
m2
);
friend
HepMatrix
operator
*
(
const
HepMatrix
&
m1
,
const
HepDiagMatrix
&
m2
);
friend
HepVector
operator
*
(
const
HepDiagMatrix
&
m1
,
const
HepVector
&
m2
);
friend
HepDiagMatrix
operator
*
(
const
HepDiagMatrix
&
h
m1
,
const
HepDiagMatrix
&
h
m2
);
friend
HepDiagMatrix
operator
+
(
const
HepDiagMatrix
&
h
m1
,
const
HepDiagMatrix
&
h
m2
);
friend
HepDiagMatrix
operator
-
(
const
HepDiagMatrix
&
h
m1
,
const
HepDiagMatrix
&
h
m2
);
friend
HepMatrix
operator
*
(
const
HepDiagMatrix
&
h
m1
,
const
HepMatrix
&
h
m2
);
friend
HepMatrix
operator
*
(
const
HepMatrix
&
h
m1
,
const
HepDiagMatrix
&
h
m2
);
friend
HepVector
operator
*
(
const
HepDiagMatrix
&
h
m1
,
const
HepVector
&
h
m2
);
#ifdef DISABLE_ALLOC
std
::
vector
<
double
>
m
;
...
...
@@ -205,25 +205,25 @@ private:
std
::
ostream
&
operator
<<
(
std
::
ostream
&
s
,
const
HepDiagMatrix
&
q
);
// Write out Matrix, SymMatrix, DiagMatrix and Vector into ostream.
HepMatrix
operator
*
(
const
HepMatrix
&
m1
,
const
HepDiagMatrix
&
m2
);
HepMatrix
operator
*
(
const
HepDiagMatrix
&
m1
,
const
HepMatrix
&
m2
);
HepMatrix
operator
*
(
const
HepMatrix
&
h
m1
,
const
HepDiagMatrix
&
h
m2
);
HepMatrix
operator
*
(
const
HepDiagMatrix
&
h
m1
,
const
HepMatrix
&
h
m2
);
HepDiagMatrix
operator
*
(
double
t
,
const
HepDiagMatrix
&
d1
);
HepDiagMatrix
operator
*
(
const
HepDiagMatrix
&
d1
,
double
t
);
// Multiplication operators
// Note that m *= m1 is always faster than m = m * m1
// Note that m *=
h
m1 is always faster than m = m *
h
m1
HepDiagMatrix
operator
/
(
const
HepDiagMatrix
&
m1
,
double
t
);
HepDiagMatrix
operator
/
(
const
HepDiagMatrix
&
h
m1
,
double
t
);
// d = d1 / t. (d /= t is faster if you can use it.)
HepMatrix
operator
+
(
const
HepMatrix
&
m1
,
const
HepDiagMatrix
&
d2
);
HepMatrix
operator
+
(
const
HepDiagMatrix
&
d1
,
const
HepMatrix
&
m2
);
HepDiagMatrix
operator
+
(
const
HepDiagMatrix
&
m1
,
const
HepDiagMatrix
&
d2
);
HepMatrix
operator
+
(
const
HepMatrix
&
h
m1
,
const
HepDiagMatrix
&
d2
);
HepMatrix
operator
+
(
const
HepDiagMatrix
&
d1
,
const
HepMatrix
&
h
m2
);
HepDiagMatrix
operator
+
(
const
HepDiagMatrix
&
h
m1
,
const
HepDiagMatrix
&
d2
);
HepSymMatrix
operator
+
(
const
HepSymMatrix
&
s1
,
const
HepDiagMatrix
&
d2
);
HepSymMatrix
operator
+
(
const
HepDiagMatrix
&
d1
,
const
HepSymMatrix
&
s2
);
// Addition operators
HepMatrix
operator
-
(
const
HepMatrix
&
m1
,
const
HepDiagMatrix
&
d2
);
HepMatrix
operator
-
(
const
HepDiagMatrix
&
d1
,
const
HepMatrix
&
m2
);
HepMatrix
operator
-
(
const
HepMatrix
&
h
m1
,
const
HepDiagMatrix
&
d2
);
HepMatrix
operator
-
(
const
HepDiagMatrix
&
d1
,
const
HepMatrix
&
h
m2
);
HepDiagMatrix
operator
-
(
const
HepDiagMatrix
&
d1
,
const
HepDiagMatrix
&
d2
);
HepSymMatrix
operator
-
(
const
HepSymMatrix
&
s1
,
const
HepDiagMatrix
&
d2
);
HepSymMatrix
operator
-
(
const
HepDiagMatrix
&
d1
,
const
HepSymMatrix
&
s2
);
...
...
Matrix/Matrix/DiagMatrix.icc
View file @
96cce689
...
...
@@ -57,7 +57,7 @@ inline const double & HepDiagMatrix::operator()(int row, int col) const
return fast(col,row);
}
inline void HepDiagMatrix::assign(const HepDiagMatrix &m2) {(*this)=m2;}
inline void HepDiagMatrix::assign(const HepDiagMatrix &
h
m2) {(*this)=
h
m2;}
inline HepDiagMatrix HepDiagMatrix::T() const {return HepDiagMatrix(*this);}
...
...
Matrix/Matrix/Matrix.h
View file @
96cce689
...
...
@@ -15,15 +15,15 @@
// You declare a Matrix by saying
//
// .ft B
// HepMatrix m1(n, m);
// HepMatrix
h
m1(n, m);
//
// To declare a Matrix as a copy of a Matrix m2, say
// To declare a Matrix as a copy of a Matrix
h
m2, say
//
// .ft B
// HepMatrix m1(m2);
// HepMatrix
h
m1(
h
m2);
// or
// .ft B
// HepMatrix m1 = m2;
// HepMatrix
h
m1 =
h
m2;
//
// You can declare initilizations of a Matrix, by giving it a third
// integer argument, either 0 or 1. 0 means initialize to 0, one means
...
...
@@ -31,7 +31,7 @@
// is not initialized.
//
// .ft B
// HepMatrix m1(n, m, 1);
// HepMatrix
h
m1(n, m, 1);
//
// ./"This code has been written by Mike Smyth, and the algorithms used are
// ./"described in the thesis "A Tracking Library for a Silicon Vertex Detector"
...
...
@@ -43,22 +43,22 @@
// To find the number of rows or number of columns, say
//
// .ft B
// nr = m1.num_row();
// nr =
h
m1.num_row();
//
// or
//
// .ft B
// nc = m1.num_col();
// nc =
h
m1.num_col();
//
// You can print a Matrix by
//
// .ft B
// cout << m1;
// cout <<
h
m1;
//
// You can add,
// subtract, and multiply two Matrices. You can multiply a Matrix by a
// scalar, on the left or the right. +=, *=, -= act in the obvious way.
// m1 *= m2 is as m1 = m1*m2. You can also divide by a scalar on the
//
h
m1 *=
h
m2 is as
h
m1 =
h
m1*
h
m2. You can also divide by a scalar on the
// right, or use /= to do the same thing.
//
// You can read or write a Matrix element by saying
...
...
@@ -117,20 +117,20 @@
// returns the transpose of m.
//
// .ft B
// ms = m2.sub(row_min, row_max, col_min, col_max);
// ms =
h
m2.sub(row_min, row_max, col_min, col_max);
//
// returns the subMatrix.
// m2(row_min:row_max, col_min:col_max) in matlab terminology.
//
h
m2(row_min:row_max, col_min:col_max) in matlab terminology.
// If instead you say
//
// .ft B
// m2.sub(row, col, m1);
//
h
m2.sub(row, col,
h
m1);
//
// then the subMatrix
// m2(row:row+m1.num_row()-1, col:col+m1.num_col()-1) is replaced with m1.
//
h
m2(row:row+
h
m1.num_row()-1, col:col+
h
m1.num_col()-1) is replaced with
h
m1.
//
// .ft B
// md = dsum(m1,m2);
// md = dsum(
h
m1,
h
m2);
//
// returns the direct sum of the two matrices.
//
...
...
@@ -173,9 +173,9 @@
// You can do things thinking of a Matrix as a list of numbers.
//
// .ft B
// m = m1.apply(HEP_MATRIX_ELEMENT (*f)(HEP_MATRIX_ELEMENT, int r, int c));
// m =
h
m1.apply(HEP_MATRIX_ELEMENT (*f)(HEP_MATRIX_ELEMENT, int r, int c));
//
// applies f to every element of m1 and places it in m.
// applies f to every element of
h
m1 and places it in m.
//
// .SS See Also:
// SymMatrix[DF].h, GenMatrix[DF].h, DiagMatrix[DF].h Vector[DF].h
...
...
@@ -222,12 +222,12 @@ public:
HepMatrix
(
int
p
,
int
q
,
HepRandom
&
r
);
// Constructor with a Random object.
HepMatrix
(
const
HepMatrix
&
m1
);
HepMatrix
(
const
HepMatrix
&
h
m1
);
// Copy constructor.
HepMatrix
(
const
HepSymMatrix
&
m1
);
HepMatrix
(
const
HepDiagMatrix
&
m1
);
HepMatrix
(
const
HepVector
&
m1
);
HepMatrix
(
const
HepSymMatrix
&
);
HepMatrix
(
const
HepDiagMatrix
&
);
HepMatrix
(
const
HepVector
&
);
// Constructors from SymMatrix, DiagMatrix and Vector.
virtual
~
HepMatrix
();
...
...
@@ -250,22 +250,22 @@ public:
HepMatrix
&
operator
/=
(
double
t
);
// Divide a Matrix by a floating number.
HepMatrix
&
operator
+=
(
const
HepMatrix
&
m2
);
HepMatrix
&
operator
+=
(
const
HepSymMatrix
&
m2
);
HepMatrix
&
operator
+=
(
const
HepDiagMatrix
&
m2
);
HepMatrix
&
operator
+=
(
const
HepVector
&
m2
);
HepMatrix
&
operator
-=
(
const
HepMatrix
&
m2
);
HepMatrix
&
operator
-=
(
const
HepSymMatrix
&
m2
);
HepMatrix
&
operator
-=
(
const
HepDiagMatrix
&
m2
);
HepMatrix
&
operator
-=
(
const
HepVector
&
m2
);
HepMatrix
&
operator
+=
(
const
HepMatrix
&
);
HepMatrix
&
operator
+=
(
const
HepSymMatrix
&
);
HepMatrix
&
operator
+=
(
const
HepDiagMatrix
&
);
HepMatrix
&
operator
+=
(
const
HepVector
&
);
HepMatrix
&
operator
-=
(
const
HepMatrix
&
);
HepMatrix
&
operator
-=
(
const
HepSymMatrix
&
);
HepMatrix
&
operator
-=
(
const
HepDiagMatrix
&
);
HepMatrix
&
operator
-=
(
const
HepVector
&
);
// Add or subtract a Matrix.
// When adding/subtracting Vector, Matrix must have num_col of one.
HepMatrix
&
operator
=
(
const
HepMatrix
&
m2
);
HepMatrix
&
operator
=
(
const
HepSymMatrix
&
m2
);
HepMatrix
&
operator
=
(
const
HepDiagMatrix
&
m2
);
HepMatrix
&
operator
=
(
const
HepVector
&
m2
);
HepMatrix
&
operator
=
(
const
HepRotation
&
m2
);
HepMatrix
&
operator
=
(
const
HepMatrix
&
);
HepMatrix
&
operator
=
(
const
HepSymMatrix
&
);
HepMatrix
&
operator
=
(
const
HepDiagMatrix
&
);
HepMatrix
&
operator
=
(
const
HepVector
&
);
HepMatrix
&
operator
=
(
const
HepRotation
&
);
// Assignment operators.
HepMatrix
operator
-
()
const
;
...
...
@@ -280,12 +280,12 @@ public:
HepMatrix
sub
(
int
min_row
,
int
max_row
,
int
min_col
,
int
max_col
)
const
;
// Returns a sub matrix of a Matrix.
// WARNING: rows and columns are numbered from 1
void
sub
(
int
row
,
int
col
,
const
HepMatrix
&
m1
);
// Sub matrix of this Matrix is replaced with m1.
void
sub
(
int
row
,
int
col
,
const
HepMatrix
&
h
m1
);
// Sub matrix of this Matrix is replaced with
h
m1.
// WARNING: rows and columns are numbered from 1
friend
inline
void
swap
(
HepMatrix
&
m1
,
HepMatrix
&
m2
);
// Swap m1 with m2.
friend
inline
void
swap
(
HepMatrix
&
h
m1
,
HepMatrix
&
h
m2
);
// Swap
h
m1 with
h
m2.
inline
HepMatrix
inverse
(
int
&
ierr
)
const
;
// Invert a Matrix. Matrix must be square and is not changed.
...
...
@@ -349,16 +349,16 @@ private:
friend
class
HepDiagMatrix
;
// Friend classes.
friend
HepMatrix
operator
+
(
const
HepMatrix
&
m1
,
const
HepMatrix
&
m2
);
friend
HepMatrix
operator
-
(
const
HepMatrix
&
m1
,
const
HepMatrix
&
m2
);
friend
HepMatrix
operator
*
(
const
HepMatrix
&
m1
,
const
HepMatrix
&
m2
);
friend
HepMatrix
operator
*
(
const
HepMatrix
&
m1
,
const
HepSymMatrix
&
m2
);
friend
HepMatrix
operator
*
(
const
HepMatrix
&
m1
,
const
HepDiagMatrix
&
m2
);
friend
HepMatrix
operator
*
(
const
HepSymMatrix
&
m1
,
const
HepMatrix
&
m2
);
friend
HepMatrix
operator
*
(
const
HepDiagMatrix
&
m1
,
const
HepMatrix
&
m2
);
friend
HepMatrix
operator
*
(
const
HepVector
&
m1
,
const
HepMatrix
&
m2
);
friend
HepVector
operator
*
(
const
HepMatrix
&
m1
,
const
HepVector
&
m2
);
friend
HepMatrix
operator
*
(
const
HepSymMatrix
&
m1
,
const
HepSymMatrix
&
m2
);
friend
HepMatrix
operator
+
(
const
HepMatrix
&
h
m1
,
const
HepMatrix
&
h
m2
);
friend
HepMatrix
operator
-
(
const
HepMatrix
&
h
m1
,
const
HepMatrix
&
h
m2
);
friend
HepMatrix
operator
*
(
const
HepMatrix
&
h
m1
,
const
HepMatrix
&
h
m2
);
friend
HepMatrix
operator
*
(
const
HepMatrix
&
h
m1
,
const
HepSymMatrix
&
h
m2
);
friend
HepMatrix
operator
*
(
const
HepMatrix
&
h
m1
,
const
HepDiagMatrix
&
h
m2
);
friend
HepMatrix
operator
*
(
const
HepSymMatrix
&
h
m1
,
const
HepMatrix
&
h
m2
);
friend
HepMatrix
operator
*
(
const
HepDiagMatrix
&
h
m1
,
const
HepMatrix
&
h
m2
);
friend
HepMatrix
operator
*
(
const
HepVector
&
h
m1
,
const
HepMatrix
&
h
m2
);
friend
HepVector
operator
*
(
const
HepMatrix
&
h
m1
,
const
HepVector
&
h
m2
);
friend
HepMatrix
operator
*
(
const
HepSymMatrix
&
h
m1
,
const
HepSymMatrix
&
h
m2
);
// Multiply a Matrix by a Matrix or Vector.
friend
HepVector
solve
(
const
HepMatrix
&
,
const
HepVector
&
);
...
...
@@ -407,22 +407,22 @@ private:
// Operations other than member functions for Matrix
// implemented in Matrix.cc and Matrix.icc (inline).
HepMatrix
operator
*
(
const
HepMatrix
&
m1
,
const
HepMatrix
&
m2
);
HepMatrix
operator
*
(
double
t
,
const
HepMatrix
&
m1
);
HepMatrix
operator
*
(
const
HepMatrix
&
m1
,
double
t
);
HepMatrix
operator
*
(
const
HepMatrix
&
,
const
HepMatrix
&
);
HepMatrix
operator
*
(
double
t
,
const
HepMatrix
&
);
HepMatrix
operator
*
(
const
HepMatrix
&
,
double
);
// Multiplication operators
// Note that m *= m1 is always faster than m = m * m1.
// Note that m *=
h
m1 is always faster than m = m *
h
m1.
HepMatrix
operator
/
(
const
HepMatrix
&
m1
,
double
t
);
// m = m1 / t. (m /= t is faster if you can use it.)
HepMatrix
operator
/
(
const
HepMatrix
&
,
double
);
// m =
h
m1 / t. (m /= t is faster if you can use it.)
HepMatrix
operator
+
(
const
HepMatrix
&
m1
,
const
HepMatrix
&
m2
);
// m = m1 + m2;
// Note that m += m1 is always faster than m = m + m1.
HepMatrix
operator
+
(
const
HepMatrix
&
h
m1
,
const
HepMatrix
&
h
m2
);
// m =
h
m1 +
h
m2;
// Note that m +=
h
m1 is always faster than m = m +
h
m1.
HepMatrix
operator
-
(
const
HepMatrix
&
m1
,
const
HepMatrix
&
m2
);
// m = m1 - m2;
// Note that m -= m1 is always faster than m = m - m1.
HepMatrix
operator
-
(
const
HepMatrix
&
h
m1
,
const
HepMatrix
&
h
m2
);
// m =
h
m1 -
h
m2;
// Note that m -=
h
m1 is always faster than m = m -
h
m1.
HepMatrix
dsum
(
const
HepMatrix
&
,
const
HepMatrix
&
);
// Direct sum of two matrices. The direct sum of A and B is the matrix
...
...
Matrix/Matrix/Matrix.icc
View file @
96cce689
...
...
@@ -66,12 +66,12 @@ inline HepMatrix::HepMatrix_row_const::HepMatrix_row_const
}
// This function swaps two Matrices without doing a full copy.
inline void swap(HepMatrix &m1,HepMatrix &m2) {
HepGenMatrix::swap(m1.m,m2.m);
inline void swap(HepMatrix &
h
m1,HepMatrix &
h
m2) {
HepGenMatrix::swap(
h
m1.m,
h
m2.m);
/*** commented
HepGenMatrix::swap(m1.nrow,m2.nrow);
HepGenMatrix::swap(m1.ncol,m2.ncol);
HepGenMatrix::swap(m1.size_,m2.size_);
HepGenMatrix::swap(
h
m1.nrow,
h
m2.nrow);
HepGenMatrix::swap(
h
m1.ncol,
h
m2.ncol);
HepGenMatrix::swap(
h
m1.size_,
h
m2.size_);
*/
}
...
...
Matrix/Matrix/SymMatrix.h
View file @
96cce689
...
...
@@ -100,10 +100,10 @@ public:
HepSymMatrix
(
int
p
,
HepRandom
&
r
);
HepSymMatrix
(
const
HepSymMatrix
&
m1
);
HepSymMatrix
(
const
HepSymMatrix
&
h
m1
);
// Copy constructor.
HepSymMatrix
(
const
HepDiagMatrix
&
m1
);
HepSymMatrix
(
const
HepDiagMatrix
&
h
m1
);
// Constructor from DiagMatrix
virtual
~
HepSymMatrix
();
...
...
@@ -124,10 +124,10 @@ public:
// Must be row>=col;
// ** Note that indexing starts from (1,1). **
void
assign
(
const
HepMatrix
&
m2
);
// Assigns m2 to s, assuming m2 is a symmetric matrix.
void
assign
(
const
HepMatrix
&
h
m2
);
// Assigns
h
m2 to s, assuming
h
m2 is a symmetric matrix.
void
assign
(
const
HepSymMatrix
&
m2
);
void
assign
(
const
HepSymMatrix
&
h
m2
);
// Another form of assignment. For consistency.
HepSymMatrix
&
operator
*=
(
double
t
);
...
...
@@ -136,14 +136,14 @@ public:
HepSymMatrix
&
operator
/=
(
double
t
);
// Divide a SymMatrix by a floating number.
HepSymMatrix
&
operator
+=
(
const
HepSymMatrix
&
m2
);
HepSymMatrix
&
operator
+=
(
const
HepDiagMatrix
&
m2
);
HepSymMatrix
&
operator
-=
(
const
HepSymMatrix
&
m2
);
HepSymMatrix
&
operator
-=
(
const
HepDiagMatrix
&
m2
);
HepSymMatrix
&
operator
+=
(
const
HepSymMatrix
&
h
m2
);
HepSymMatrix
&
operator
+=
(
const
HepDiagMatrix
&
h
m2
);
HepSymMatrix
&
operator
-=
(
const
HepSymMatrix
&
h
m2
);
HepSymMatrix
&
operator
-=
(
const
HepDiagMatrix
&
h
m2
);
// Add or subtract a SymMatrix.
HepSymMatrix
&
operator
=
(
const
HepSymMatrix
&
m2
);
HepSymMatrix
&
operator
=
(
const
HepDiagMatrix
&
m2
);
HepSymMatrix
&
operator
=
(
const
HepSymMatrix
&
h
m2
);
HepSymMatrix
&
operator
=
(
const
HepDiagMatrix
&
h
m2
);
// Assignment operators. Notice that there is no SymMatrix = Matrix.
HepSymMatrix
operator
-
()
const
;
...
...
@@ -155,21 +155,21 @@ public:
HepSymMatrix
apply
(
double
(
*
f
)(
double
,
int
,
int
))
const
;
// Apply a function to all elements of the matrix.
HepSymMatrix
similarity
(
const
HepMatrix
&
m1
)
const
;
HepSymMatrix
similarity
(
const
HepSymMatrix
&
m1
)
const
;
// Returns m1*s*m1.T().
HepSymMatrix
similarity
(
const
HepMatrix
&
h
m1
)
const
;
HepSymMatrix
similarity
(
const
HepSymMatrix
&
h
m1
)
const
;
// Returns
h
m1*s*
h
m1.T().
HepSymMatrix
similarityT
(
const
HepMatrix
&
m1
)
const
;
HepSymMatrix
similarityT
(
const
HepMatrix
&
h
m1
)
const
;
// temporary. test of new similarity.
// Returns m1.T()*s*m1.
// Returns
h
m1.T()*s*
h
m1.
double
similarity
(
const
HepVector
&
v
)
const
;
// Returns v.T()*s*v (This is a scaler).
HepSymMatrix
sub
(
int
min_row
,
int
max_row
)
const
;
// Returns a sub matrix of a SymMatrix.
void
sub
(
int
row
,
const
HepSymMatrix
&
m1
);
// Sub matrix of this SymMatrix is replaced with m1.
void
sub
(
int
row
,
const
HepSymMatrix
&
h
m1
);
// Sub matrix of this SymMatrix is replaced with
h
m1.
HepSymMatrix
sub
(
int
min_row
,
int
max_row
);
// SGI CC bug. I have to have both with/without const. I should not need
// one without const.
...
...
@@ -251,14 +251,14 @@ private:
friend
HepVector
house
(
const
HepSymMatrix
&
a
,
int
row
,
int
col
);
friend
void
house_with_update2
(
HepSymMatrix
*
a
,
HepMatrix
*
v
,
int
row
,
int
col
);
friend
HepSymMatrix
operator
+
(
const
HepSymMatrix
&
m1
,
const
HepSymMatrix
&
m2
);
friend
HepSymMatrix
operator
-
(
const
HepSymMatrix
&
m1
,
const
HepSymMatrix
&
m2
);
friend
HepMatrix
operator
*
(
const
HepSymMatrix
&
m1
,
const
HepSymMatrix
&
m2
);
friend
HepMatrix
operator
*
(
const
HepSymMatrix
&
m1
,
const
HepMatrix
&
m2
);
friend
HepMatrix
operator
*
(
const
HepMatrix
&
m1
,
const
HepSymMatrix
&
m2
);
friend
HepVector
operator
*
(
const
HepSymMatrix
&
m1
,
const
HepVector
&
m2
);
friend
HepSymMatrix
operator
+
(
const
HepSymMatrix
&
h
m1
,
const
HepSymMatrix
&
h
m2
);
friend
HepSymMatrix
operator
-
(
const
HepSymMatrix
&
h
m1
,
const
HepSymMatrix
&
h
m2
);
friend
HepMatrix
operator
*
(
const
HepSymMatrix
&
h
m1
,
const
HepSymMatrix
&
h
m2
);
friend
HepMatrix
operator
*
(
const
HepSymMatrix
&
h
m1
,
const
HepMatrix
&
h
m2
);
friend
HepMatrix
operator
*
(
const
HepMatrix
&
h
m1
,
const
HepSymMatrix
&
h
m2
);
friend
HepVector
operator
*
(
const
HepSymMatrix
&
h
m1
,
const
HepVector
&
h
m2
);
// Multiply a Matrix by a Matrix or Vector.
friend
HepSymMatrix
vT_times_v
(
const
HepVector
&
v
);
...
...
@@ -296,24 +296,24 @@ private:
std
::
ostream
&
operator
<<
(
std
::
ostream
&
s
,
const
HepSymMatrix
&
q
);
// Write out Matrix, SymMatrix, DiagMatrix and Vector into ostream.
HepMatrix
operator
*
(
const
HepMatrix
&
m1
,
const
HepSymMatrix
&
m2
);
HepMatrix
operator
*
(
const
HepSymMatrix
&
m1
,
const
HepMatrix
&
m2
);
HepMatrix
operator
*
(
const
HepSymMatrix
&
m1
,
const
HepSymMatrix
&
m2
);
HepMatrix
operator
*
(
const
HepMatrix
&
h
m1
,
const
HepSymMatrix
&
h
m2
);
HepMatrix
operator
*
(
const
HepSymMatrix
&
h
m1
,
const
HepMatrix
&
h
m2
);
HepMatrix
operator
*
(
const
HepSymMatrix
&
h
m1
,
const
HepSymMatrix
&
h
m2
);
HepSymMatrix
operator
*
(
double
t
,
const
HepSymMatrix
&
s1
);
HepSymMatrix
operator
*
(
const
HepSymMatrix
&
s1
,
double
t
);
// Multiplication operators.
// Note that m *= m1 is always faster than m = m * m1
// Note that m *=
h
m1 is always faster than m = m *
h
m1
HepSymMatrix
operator
/
(
const
HepSymMatrix
&
m1
,
double
t
);
HepSymMatrix
operator
/
(
const
HepSymMatrix
&
h
m1
,
double
t
);
// s = s1 / t. (s /= t is faster if you can use it.)
HepMatrix
operator
+
(
const
HepMatrix
&
m1
,
const
HepSymMatrix
&
s2
);
HepMatrix
operator
+
(
const
HepSymMatrix
&
s1
,
const
HepMatrix
&
m2
);
HepMatrix
operator
+
(
const
HepMatrix
&
h
m1
,
const
HepSymMatrix
&
s2
);
HepMatrix
operator
+
(
const
HepSymMatrix
&
s1
,
const
HepMatrix
&
h
m2
);
HepSymMatrix
operator
+
(
const
HepSymMatrix
&
s1
,
const
HepSymMatrix
&
s2
);
// Addition operators
HepMatrix
operator
-
(
const
HepMatrix
&
m1
,
const
HepSymMatrix
&
s2
);
HepMatrix
operator
-
(
const
HepSymMatrix
&
m1
,
const
HepMatrix
&
m2
);
HepMatrix
operator
-
(
const
HepMatrix
&
h
m1
,
const
HepSymMatrix
&
s2
);
HepMatrix
operator
-
(
const
HepSymMatrix
&
h
m1
,
const
HepMatrix
&
h
m2
);
HepSymMatrix
operator
-
(
const
HepSymMatrix
&
s1
,
const
HepSymMatrix
&
s2
);
// subtraction operators
...
...
Matrix/Matrix/SymMatrix.icc
View file @
96cce689
...
...
@@ -39,8 +39,8 @@ inline double & HepSymMatrix::operator()(int row, int col)
inline const double & HepSymMatrix::operator()(int row, int col) const
{return (row>=col? fast(row,col) : fast(col,row));}
inline void HepSymMatrix::assign(const HepSymMatrix &m2)
{(*this)=m2;}
inline void HepSymMatrix::assign(const HepSymMatrix &
h
m2)
{(*this)=
h
m2;}
inline HepSymMatrix HepSymMatrix::T() const {return HepSymMatrix(*this);}
...
...
Matrix/Matrix/Vector.h
View file @
96cce689
...
...
@@ -84,7 +84,7 @@ public:
HepVector
&
operator
-=
(
const
HepVector
&
v2
);
// Add or subtract a Vector.
HepVector
&
operator
=
(
const
HepVector
&
m2
);
HepVector
&
operator
=
(
const
HepVector
&
h
m2
);
// Assignment operators.
HepVector
&
operator
=
(
const
HepMatrix
&
);
...
...
@@ -143,10 +143,10 @@ private:
friend
HepVector
operator
+
(
const
HepVector
&
v1
,
const
HepVector
&
v2
);
friend
HepVector
operator
-
(
const
HepVector
&
v1
,
const
HepVector
&
v2
);
friend
HepVector
operator
*
(
const
HepSymMatrix
&
m1
,
const
HepVector
&
m2
);
friend
HepVector
operator
*
(
const
HepDiagMatrix
&
m1
,
const
HepVector
&
m2
);
friend
HepMatrix
operator
*
(
const
HepVector
&
m1
,
const
HepMatrix
&
m2
);
friend
HepVector
operator
*
(
const
HepMatrix
&
m1
,
const
HepVector
&
m2
);
friend
HepVector
operator
*
(
const
HepSymMatrix
&
h
m1
,
const
HepVector
&
h
m2
);
friend
HepVector
operator
*
(
const
HepDiagMatrix
&
h
m1
,
const
HepVector
&
h
m2
);
friend
HepMatrix
operator
*
(
const
HepVector
&
h
m1
,
const
HepMatrix
&
h
m2
);
friend
HepVector
operator
*
(
const
HepMatrix
&
h
m1
,
const
HepVector
&
h
m2
);
friend
HepVector
solve
(
const
HepMatrix
&
a
,
const
HepVector
&
v
);
friend
void
tridiagonal
(
HepSymMatrix
*
a
,
HepMatrix
*
hsm
);
...
...
@@ -177,7 +177,7 @@ private:
std
::
ostream
&
operator
<<
(
std
::
ostream
&
s
,
const
HepVector
&
v
);
// Write out Matrix, SymMatrix, DiagMatrix and Vector into ostream.
HepVector
operator
*
(
const
HepMatrix
&
m1
,
const
HepVector
&
m2
);
HepVector
operator
*
(
const
HepMatrix
&
h
m1
,
const
HepVector
&
h
m2
);
HepVector
operator
*
(
double
t
,
const
HepVector
&
v1
);
HepVector
operator
*
(
const
HepVector
&
v1
,
double
t
);
// Multiplication operators.
...
...
@@ -186,13 +186,13 @@ HepVector operator*(const HepVector &v1, double t);
HepVector
operator
/
(
const
HepVector
&
v1
,
double
t
);
// Divide by a real number.
HepVector
operator
+
(
const
HepMatrix
&
m1
,
const
HepVector
&
v2
);
HepVector
operator
+
(
const
HepVector
&
v1
,
const
HepMatrix
&
m2
);
HepVector
operator
+
(
const
HepMatrix
&
h
m1
,
const
HepVector
&
v2
);
HepVector
operator
+
(
const
HepVector
&
v1
,
const
HepMatrix
&
h
m2
);
HepVector
operator
+
(
const
HepVector
&
v1
,
const
HepVector
&
v2
);
// Addition operators
HepVector
operator
-
(
const
HepMatrix
&
m1
,
const
HepVector
&
v2
);
HepVector
operator
-
(
const
HepVector
&
v1
,
const
HepMatrix
&
m2
);
HepVector
operator
-
(
const
HepMatrix
&
h
m1
,
const
HepVector
&
v2
);
HepVector
operator
-
(
const
HepVector
&
v1
,
const
HepMatrix
&
h
m2
);
HepVector
operator
-
(
const
HepVector
&
v1
,
const
HepVector
&
v2
);
// subtraction operators
...
...
Matrix/src/DiagMatrix.cc
View file @
96cce689
This diff is collapsed.
Click to expand it.
Matrix/src/GenMatrix.cc
View file @
96cce689
...
...
@@ -14,7 +14,6 @@
#include <cmath>
#include <stdlib.h>
#include "CLHEP/Matrix/defs.h"
#include "CLHEP/Matrix/GenMatrix.h"
#include "CLHEP/Matrix/SymMatrix.h"
#include "CLHEP/Matrix/Matrix.h"
...
...
@@ -26,44 +25,44 @@
namespace
CLHEP
{
#ifdef HEP_THIS_FUNCTION_IS_NOT_NEEDED
static
void
dele