Tapkee
features.hpp
Go to the documentation of this file.
00001 /* This software is distributed under BSD 3-clause license (see LICENSE file).
00002  *
00003  * Copyright (c) 2012-2013 Vladyslav Gorbatiuk
00004  */
00005 
00006 #ifndef TAPKEE_FEATURES_H_
00007 #define TAPKEE_FEATURES_H_
00008 
00009 /* Tapkee includes */
00010 #include <tapkee/defines.hpp>
00011  /* End of Tapkee includes */
00012 
00013 namespace tapkee 
00014 {
00015 namespace tapkee_internal
00016 {
00017 
00018 template<class RandomAccessIterator, class FeaturesCallback>
00019 DenseMatrix dense_matrix_from_features(FeaturesCallback features,
00020                                        IndexType dimension,
00021                                        RandomAccessIterator begin, 
00022                                        RandomAccessIterator end)
00023 {
00024     DenseMatrix matrix(dimension, end-begin);
00025     DenseVector feature_vector(dimension);
00026 
00027     for (RandomAccessIterator iter=begin; iter!=end; ++iter)
00028     {
00029         features.vector(*iter,feature_vector);
00030         matrix.col(iter-begin).array() = feature_vector;
00031     }
00032 
00033     return matrix;
00034 }
00035 
00036 }
00037 }
00038 
00039 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines