LCOV - code coverage report
Current view: top level - utils - matrix.hpp (source / functions) Hit Total Coverage
Test: clean.info Lines: 7 7 100.0 %
Date: 2013-05-24 Functions: 1 1 100.0 %
Branches: 10 20 50.0 %

           Branch data     Line data    Source code
       1                 :            : #ifndef TAPKEE_MATRIX_H_
       2                 :            : #define TAPKEE_MATRIX_H_
       3                 :            : 
       4                 :            : namespace tapkee 
       5                 :            : {
       6                 :            : namespace tapkee_internal
       7                 :            : {
       8                 :            : 
       9                 :        115 : void centerMatrix(DenseMatrix& matrix)
      10                 :            : {
      11 [ +  - ][ +  - ]:        115 :         DenseVector col_means = matrix.colwise().mean().transpose();
      12         [ +  - ]:        115 :         DenseMatrix::Scalar grand_mean = matrix.mean();
      13 [ +  - ][ +  - ]:        115 :         matrix.array() += grand_mean;
      14 [ +  - ][ +  - ]:        116 :         matrix.rowwise() -= col_means.transpose();
                 [ +  - ]
      15 [ +  - ][ +  - ]:        116 :         matrix.colwise() -= col_means;
      16                 :        116 : }
      17                 :            : 
      18                 :            : } // End of tapkee_internal
      19                 :            : } // End of tapkee
      20                 :            : #endif

Generated by: LCOV version 1.9