* changed some comments sentences
This commit is contained in:
parent
9ac22d7515
commit
36ec42d362
1 changed files with 19 additions and 9 deletions
|
|
@ -145,13 +145,26 @@ public:
|
||||||
|
|
||||||
_varcovar.resize(s_size, s_size);
|
_varcovar.resize(s_size, s_size);
|
||||||
|
|
||||||
// variance-covariance matrix are symmetric (and semi-definite positive),
|
|
||||||
// thus a triangular storage is sufficient
|
//-------------------------------------------------------------
|
||||||
|
// variance-covariance matrix are symmetric (and semi-definite
|
||||||
|
// positive), thus a triangular storage is sufficient
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
ublas::symmetric_matrix< AtomType, ublas::lower > var(s_size, s_size);
|
ublas::symmetric_matrix< AtomType, ublas::lower > var(s_size, s_size);
|
||||||
|
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------
|
||||||
// variance-covariance matrix computation : A * transpose(A)
|
// variance-covariance matrix computation : A * transpose(A)
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
var = ublas::prod( sample, ublas::trans( sample ) );
|
var = ublas::prod( sample, ublas::trans( sample ) );
|
||||||
|
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < s_size; ++i)
|
for (unsigned int i = 0; i < s_size; ++i)
|
||||||
{
|
{
|
||||||
// triangular LOWER matrix, thus j is not going further than i
|
// triangular LOWER matrix, thus j is not going further than i
|
||||||
|
|
@ -162,8 +175,6 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//_varcovar = varcovar;
|
|
||||||
|
|
||||||
_mean.resize(s_size);
|
_mean.resize(s_size);
|
||||||
|
|
||||||
// unit vector
|
// unit vector
|
||||||
|
|
@ -219,8 +230,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// end of the matrix
|
// end of the matrix
|
||||||
for ( i = 1; i < Vl; ++i )
|
for ( i = 1; i < Vl; ++i ) // each column
|
||||||
{ // each column
|
{
|
||||||
|
|
||||||
// diagonal
|
// diagonal
|
||||||
double sum = 0.0;
|
double sum = 0.0;
|
||||||
|
|
@ -234,9 +245,8 @@ public:
|
||||||
|
|
||||||
_L(i, i) = sqrt( V(i, i) - sum );
|
_L(i, i) = sqrt( V(i, i) - sum );
|
||||||
|
|
||||||
for ( j = i + 1; j < Vl; ++j )
|
for ( j = i + 1; j < Vl; ++j ) // rows
|
||||||
{ // rows
|
{
|
||||||
|
|
||||||
// one element
|
// one element
|
||||||
sum = 0.0;
|
sum = 0.0;
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue