inline void DistMatrix<T,MD,STAR,Int>::LockedAttach ( Int height, Int width, Int colAlignmentVC, const T* buffer, Int ldim, const elem::Grid& grid ) { #ifndef RELEASE PushCallStack("[MD,* ]::LockedAttach"); #endif this->Empty(); this->grid_ = &grid; this->height_ = height; this->width_ = width; this->diagPath_ = grid.DiagPath(colAlignmentVC); this->colAlignment_ = grid.DiagPathRank(colAlignmentVC); this->viewing_ = true; this->lockedView_ = true; if( this->Participating() ) { this->colShift_ = Shift( grid.DiagPathRank(), this->colAlignment_, grid.LCM() ); const Int localHeight = LocalLength(height,this->colShift_,grid.LCM()); this->localMatrix_.LockedAttach( localHeight, width, buffer, ldim ); } else this->colShift_ = 0; #ifndef RELEASE PopCallStack(); #endif }
DistMatrix<T,MD,STAR>::DistMatrix ( Int height, Int width, Int colAlignmentVC, Int ldim, const elem::Grid& g ) : AbstractDistMatrix<T>(g), diagPath_(g.DiagPath(colAlignmentVC)) { this->Align( g.DiagPathRank(colAlignmentVC), 0 ); this->ResizeTo( height, width, ldim ); }
inline DistMatrix<T,MD,STAR,Int>::DistMatrix( const elem::Grid& g ) : AbstractDistMatrix<T,Int> (0,0,false,false,0,0, (g.InGrid() && g.DiagPath()==0 ? g.DiagPathRank() : 0),0, 0,0,g), diagPath_(0) { }
inline DistMatrix<T,MD,STAR,Int>::DistMatrix ( Int height, Int width, const elem::Grid& g ) : AbstractDistMatrix<T,Int> (height,width,false,false,0,0, (g.InGrid() && g.DiagPath()==0 ? g.DiagPathRank() : 0),0, (g.InGrid() && g.DiagPath()==0 ? LocalLength(height,g.DiagPathRank(),0,g.LCM()) : 0),width,g), diagPath_(0) { }
inline void DistMatrix<T,MD,STAR,Int>::SetGrid( const elem::Grid& g ) { this->Empty(); this->grid_ = &g; this->diagPath_ = 0; this->colAlignment_ = 0; if( g.InGrid() && g.DiagPath()==0 ) this->colShift_ = g.DiagPathRank(); else this->colShift_ = 0; }
inline DistMatrix<T,MD,STAR,Int>::DistMatrix ( bool constrainedColAlignment, Int colAlignmentVC, const elem::Grid& g ) : AbstractDistMatrix<T,Int> (0,0,constrainedColAlignment,false,g.DiagPathRank(colAlignmentVC),0, (g.InGrid() && g.DiagPath()==g.DiagPath(colAlignmentVC) ? Shift(g.DiagPathRank(),g.DiagPathRank(colAlignmentVC),g.LCM()) : 0),0, 0,0,g), diagPath_(g.DiagPath(colAlignmentVC)) { }
void DistMatrix<T,MD,STAR>::LockedAttach ( Int height, Int width, Int colAlignmentVC, const T* buffer, Int ldim, const elem::Grid& grid ) { #ifndef RELEASE CallStackEntry entry("[MD,* ]::LockedAttach"); #endif this->Empty(); this->grid_ = &grid; this->height_ = height; this->width_ = width; this->diagPath_ = grid.DiagPath(colAlignmentVC); this->colAlignment_ = grid.DiagPathRank(colAlignmentVC); this->viewType_ = LOCKED_VIEW; this->SetColShift(); if( this->Participating() ) { const Int localHeight = Length(height,this->colShift_,grid.LCM()); this->matrix_.LockedAttach_( localHeight, width, buffer, ldim ); } }
DistMatrix<T,MD,STAR>::DistMatrix ( Int height, Int width, Int colAlignmentVC, T* buffer, Int ldim, const elem::Grid& g ) : AbstractDistMatrix<T>(g), diagPath_(g.DiagPath(colAlignmentVC)) { this->Attach(height,width,colAlignmentVC,buffer,ldim,g); }
inline DistMatrix<T,MD,STAR,Int>::DistMatrix ( Int height, Int width, Int colAlignmentVC, T* buffer, Int ldim, const elem::Grid& g ) : AbstractDistMatrix<T,Int> (height,width,g.DiagPathRank(colAlignmentVC),0, (g.InGrid() && g.DiagPath()==g.DiagPath(colAlignmentVC) ? Shift(g.DiagPathRank(),g.DiagPathRank(colAlignmentVC),g.LCM()) : 0),0, (g.InGrid() && g.DiagPath()==g.DiagPath(colAlignmentVC) ? LocalLength(height,g.DiagPathRank(),g.DiagPathRank(colAlignmentVC),g.LCM()) : 0),width,buffer,ldim,g), diagPath_(g.DiagPath(colAlignmentVC)) { }