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::Precompute::ComputeMatrix(), and Impala::Core::Training::ApplyConceptsHelperKernels::LoadFeatures(). 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 for(int row=0 ; row<size2 ; ++row) 00032 { 00033 double *ptr = m->CPB(0, row); 00034 #pragma omp parallel for 00035 for(int col=0 ; col<size1 ; ++col) 00036 { 00037 VectorTem<double> v1(horizontal->GetVector(col, true)); 00038 VectorTem<double> v2(vertical->GetVector(row, true)); 00039 ptr[col] = (*fn)(v1, v2); 00040 } 00041 } 00042 00043 return m; 00044 }
Here is the call graph for this function:
|