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

template<class ArrayT>
ArrayT* Impala::Core::Matrix::MatReplicateMatrix ( ArrayT *  m,
int  rowCount,
int  columnCount 
) [inline]

Definition at line 29 of file MatReplicateMatrix.h.

References MatE(), MatNrCol(), MatNrRow(), and MatReplicateMatrixOneRow().

Referenced by MatNorm2DistInternal().

00030 {
00031     if((rowCount == 1) && (MatNrCol(m) == 1))
00032     {
00033         // this operation has poor cache coherence 
00034         // (the mirror case does not need this optimization)
00035         return MatReplicateMatrixOneRow(m, columnCount);
00036     }
00037     ArrayT* res = MatCreate<ArrayT>(MatNrRow(m) * rowCount, MatNrCol(m) * columnCount);
00038     for (int a = 0; a < rowCount; a++)
00039     {
00040         for (int b = 0; b < columnCount; b++)
00041         {
00042             int c = MatNrRow(m) * a;
00043             int d = MatNrCol(m) * b;
00044             for (int i=0; i<MatNrRow(m); i++)
00045             {
00046                 for (int j=0; j<MatNrCol(m); j++)
00047                 {
00048                     *MatE(res, c+i, d+j) = *MatE(m, i, j);
00049                 }
00050             }
00051         }
00052     }
00053     return res;
00054 }

Here is the call graph for this function:


Generated on Fri Mar 19 11:16:10 2010 for ImpalaSrc by  doxygen 1.5.1