Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

MatKeepSpecificRows.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Matrix_MatKeepSpecificRows_h
00002 #define Impala_Core_Matrix_MatKeepSpecificRows_h
00003 
00004 #include "Core/Matrix/MatFunc.h"
00005 #include "Core/Matrix/Mat.h"
00006 
00007 namespace Impala
00008 {
00009 namespace Core
00010 {
00011 namespace Matrix
00012 {
00013 
00014 
00015 Mat*
00016 MatKeepSpecificRows(Mat* data, std::vector<int>& keepers)
00017 {
00018     // we have the indices; now copy vectors
00019     int d = MatNrCol(data);
00020     Mat* res = MatCreate<Mat>(keepers.size(), d);
00021     for(int j = 0; j < keepers.size(); j++)
00022     {
00023         int k = keepers[j];
00024         for(int i = 0; i < d; i++)
00025             *MatE(res, j, i) = *MatE(data, k, i);
00026     }
00027     return res;
00028 }
00029 
00030 
00031 } // namespace Matrix
00032 } // namespace Core
00033 } // namespace Impala
00034 
00035 #endif

Generated on Fri Mar 19 09:31:15 2010 for ImpalaSrc by  doxygen 1.5.1