LCOV - code coverage report
Current view: top level - utils - features.hpp (source / functions) Hit Total Coverage
Test: clean.info Lines: 7 7 100.0 %
Date: 2013-05-24 Functions: 3 4 75.0 %
Branches: 13 48 27.1 %

           Branch data     Line data    Source code
       1                 :            : /* This software is distributed under BSD 3-clause license (see LICENSE file).
       2                 :            :  *
       3                 :            :  * Copyright (c) 2012-2013 Vladyslav Gorbatiuk
       4                 :            :  */
       5                 :            : 
       6                 :            : #ifndef TAPKEE_FEATURES_H_
       7                 :            : #define TAPKEE_FEATURES_H_
       8                 :            : 
       9                 :            : /* Tapkee includes */
      10                 :            : #include <tapkee/defines.hpp>
      11                 :            :  /* End of Tapkee includes */
      12                 :            : 
      13                 :            : namespace tapkee 
      14                 :            : {
      15                 :            : namespace tapkee_internal
      16                 :            : {
      17                 :            : 
      18                 :            : template<class RandomAccessIterator, class FeaturesCallback>
      19                 :          6 : DenseMatrix dense_matrix_from_features(FeaturesCallback features,
      20                 :            :                                        IndexType dimension,
      21                 :            :                                        RandomAccessIterator begin, 
      22                 :            :                                        RandomAccessIterator end)
      23                 :            : {
      24 [ +  - ][ #  # ]:          6 :         DenseMatrix matrix(dimension, end-begin);
                 [ +  - ]
      25 [ +  - ][ #  # ]:          6 :         DenseVector feature_vector(dimension);
                 [ +  - ]
      26                 :            : 
      27 [ +  + ][ #  # ]:        136 :         for (RandomAccessIterator iter=begin; iter!=end; ++iter)
                 [ -  + ]
      28                 :            :         {
      29 [ +  - ][ #  # ]:        130 :                 features.vector(*iter,feature_vector);
                 [ #  # ]
      30 [ +  - ][ +  - ]:        130 :                 matrix.col(iter-begin).array() = feature_vector;
         [ +  - ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
      31                 :            :         }
      32                 :            : 
      33 [ +  - ][ #  # ]:          6 :         return matrix;
                 [ +  - ]
      34                 :            : }
      35                 :            : 
      36                 :            : }
      37                 :            : }
      38                 :            : 
      39                 :            : #endif

Generated by: LCOV version 1.9