apply a function to two vector sets, resulting in a matrix
Definition at line 21 of file Apply.h. References Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CPB(), Impala::Core::Vector::VectorSet< ArrayT >::GetVector(), ILOG_DEBUG, ILOG_VAR, and Impala::Core::Vector::VectorSet< ArrayT >::Size(). Referenced by Impala::Application::ComputeMatrix(), Impala::Core::Training::ApplyConceptsHelperKernels::LoadFeatures(), and Impala::Core::Training::PrecomputeKernelMatrix(). 00024 { 00025 ILOG_VAR(Core.Vector.Apply); 00026 00027 int size1 = horizontal->Size(), size2 = vertical->Size(); 00028 ILOG_DEBUG("s1 = " << size1 << ", s2 = " << size2); 00029 Matrix::Mat* m = new Matrix::Mat(size1, size2, 0, 0); 00030 00031 double *ptr = m->CPB(); 00032 for(int row=0 ; row<size2 ; ++row) 00033 { 00034 for(int col=0 ; col<size1 ; ++col) 00035 { 00036 VectorTem<double> v1(horizontal->GetVector(col, true)); 00037 VectorTem<double> v2(vertical->GetVector(row, true)); 00038 *ptr = (*fn)(v1, v2); 00039 ++ptr; 00040 } 00041 } 00042 00043 return m; 00044 }
Here is the call graph for this function:
|