* added some comments
This commit is contained in:
parent
f410026068
commit
15ae721cea
1 changed files with 19 additions and 3 deletions
|
|
@ -22,14 +22,23 @@ public:
|
|||
|
||||
CovMatrix( const eoPop< EOT >& pop )
|
||||
{
|
||||
unsigned int p_size = pop.size(); // population size
|
||||
//-------------------------------------------------------------
|
||||
// Some checks before starting to estimate covar
|
||||
//-------------------------------------------------------------
|
||||
|
||||
unsigned int p_size = pop.size(); // population size
|
||||
assert(p_size > 0);
|
||||
|
||||
unsigned int s_size = pop[0].size(); // solution size
|
||||
|
||||
assert(s_size > 0);
|
||||
|
||||
//-------------------------------------------------------------
|
||||
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Copy the population to an ublas matrix
|
||||
//-------------------------------------------------------------
|
||||
|
||||
ublas::matrix< AtomType > sample( p_size, s_size );
|
||||
|
||||
for (unsigned int i = 0; i < p_size; ++i)
|
||||
|
|
@ -40,6 +49,9 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------
|
||||
|
||||
|
||||
_varcovar.resize(s_size, s_size);
|
||||
|
||||
|
||||
|
|
@ -52,6 +64,8 @@ public:
|
|||
|
||||
ublas::symmetric_matrix< AtomType, ublas::lower > var = ublas::prod( ublas::trans( sample ), sample );
|
||||
|
||||
// Be sure that the symmetric matrix got the good size
|
||||
|
||||
assert(var.size1() == s_size);
|
||||
assert(var.size2() == s_size);
|
||||
assert(var.size1() == _varcovar.size1());
|
||||
|
|
@ -60,6 +74,8 @@ public:
|
|||
//-------------------------------------------------------------
|
||||
|
||||
|
||||
// TODO: to remove the comment below
|
||||
|
||||
// for (unsigned int i = 0; i < s_size; ++i)
|
||||
// {
|
||||
// // triangular LOWER matrix, thus j is not going further than i
|
||||
|
|
@ -72,7 +88,7 @@ public:
|
|||
|
||||
_varcovar = var / p_size;
|
||||
|
||||
_mean.resize(s_size);
|
||||
_mean.resize(s_size); // FIXME: check if it is really used because of the assignation below
|
||||
|
||||
// unit vector
|
||||
ublas::scalar_vector< AtomType > u( p_size, 1 );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue