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

template<class C>
CxMatrixTem<C> CxMatrixTem< C >::setRow ( long  r,
CxVector< C >  v,
bool  makeCopy = false 
) [inline]

Definition at line 271 of file Matrix.h.

References CxMatrixTem< C >::_nc, and CxMatrixTem< C >::_nr.

00272 {
00273 
00274         if(r>= _nr || r<0){
00275         CX_CERR << "setRow: rownr exceeded the number of rows in CxMatrixTem."
00276                                 << CX_ENDL;
00277         return CxMatrixTem<C>(0,0) ;
00278     }
00279         if(_nc != v.Size()){
00280         CX_CERR << "setRow: v.nElem not equal to matrix dimension" << CX_ENDL;
00281         return CxMatrixTem<C>(0,0) ;
00282     }
00283 
00284         CxMatrixTem<C> tmp(0,0);
00285 
00286         if(makeCopy) {
00287 
00288                 tmp = CxMatrixTem<C>(_nr,_nc);
00289 
00290                 for(int row = 0; row<_nr; row++)
00291                         for(int col = 0; col<_nc; col++)
00292                                 if(row!=r) tmp[row][col] = (*this)[row][col] ;
00293                                 else tmp[row][col] = v[col] ;
00294         } 
00295         else { // only change the original, faster
00296 
00297                 for(int col = 0; col<_nc; col++)
00298                         (*this)[r][col] = v[col] ;
00299         }
00300 
00301 
00302         return tmp;
00303 
00304 }


Generated on Fri Mar 19 10:32:13 2010 for ImpalaSrc by  doxygen 1.5.1