model_server/edge/src/matrix.cxx
/*
 * barycenter_column
 * returns the weighted barycenter of column c
 * that means the upper barycenter of item on position c
 */
barycenter_column
returns the weighted barycenter of column c
that means the upper barycenter of item on position c
barycenter_column returns the weighted barycenter of column c that means the upper barycenter of item on position c
float 
matrix::barycenter_column(int c) 
{
  int b1=0;
  int b2=0;
  for (int k=0; k<rows; k++) {
    b1 += k * m[k].v[c];
    b2 += m[k].v[c];
  };
  if (b2) return float(b1) / b2; else return c;
}
float matrix :: barycenter_column ( int c ) { int b1 = 0 ; int b2 = 0 ; for ( int k = 0 ; k < rows ; k ++ ) { b1 += k * m [ k ] . v [ c ] ; b2 += m [ k ] . v [ c ] ; } ; if ( b2 ) return float ( b1 ) / b2 ; else return c ; }
barycenter_column
 returns the weighted barycenter of column c
 that means the upper barycenter of item on position c
barycenter_column returns the weighted barycenter of column c that means the upper barycenter of item on position c