本文整理汇总了C++中DistMatrix::LockedLocalMatrix方法的典型用法代码示例。如果您正苦于以下问题:C++ DistMatrix::LockedLocalMatrix方法的具体用法?C++ DistMatrix::LockedLocalMatrix怎么用?C++ DistMatrix::LockedLocalMatrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DistMatrix
的用法示例。
在下文中一共展示了DistMatrix::LockedLocalMatrix方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: logic_error
inline T
DotuHelper( const DistMatrix<T,U,V>& x, const DistMatrix<T,STAR,STAR>& y )
{
#ifndef RELEASE
PushCallStack("internal::DotuHelper");
if( x.Grid() != y.Grid() )
throw std::logic_error("{x,y} must be distributed over the same grid");
if( (x.Height() != 1 && x.Width() != 1) ||
(y.Height() != 1 && y.Width() != 1) )
throw std::logic_error("Dotu requires x and y to be vectors");
int xLength = ( x.Width() == 1 ? x.Height() : x.Width() );
int yLength = ( y.Width() == 1 ? y.Height() : y.Width() );
if( xLength != yLength )
throw std::logic_error("Dotu requires x and y to be the same length");
#endif
const Grid& g = x.Grid();
DistMatrix<T,STAR,STAR> xRedist(g);
xRedist = x;
T globalDotu =
Dotu( xRedist.LockedLocalMatrix(), y.LockedLocalMatrix() );
#ifndef RELEASE
PopCallStack();
#endif
return globalDotu;
}
示例2: PushCallStack
inline void
LocalTwoSidedTrsm
( UpperOrLower uplo, UnitOrNonUnit diag,
DistMatrix<F,STAR,STAR>& A, const DistMatrix<F,STAR,STAR>& B )
{
#ifndef RELEASE
PushCallStack("internal::LocalTwoSidedTrsm");
#endif
TwoSidedTrsm( uplo, diag, A.LocalMatrix(), B.LockedLocalMatrix() );
#ifndef RELEASE
PopCallStack();
#endif
}
示例3: PushCallStack
inline const DistMatrix<T,MD,STAR,Int>&
DistMatrix<T,MD,STAR,Int>::operator=( const DistMatrix<T,MD,STAR,Int>& A )
{
#ifndef RELEASE
PushCallStack("[MD,* ] = [MD,* ]");
this->AssertNotLockedView();
this->AssertSameGrid( A );
if( this->Viewing() )
this->AssertSameSize( A );
#endif
if( !this->Viewing() )
{
if( !this->ConstrainedColAlignment() )
{
this->diagPath_ = A.diagPath_;
this->colAlignment_ = A.colAlignment_;
if( this->Participating() )
this->colShift_ = A.ColShift();
}
this->ResizeTo( A.Height(), A.Width() );
}
if( this->diagPath_ == A.diagPath_ &&
this->colAlignment_ == A.colAlignment_ )
{
this->localMatrix_ = A.LockedLocalMatrix();
}
else
{
#ifdef UNALIGNED_WARNINGS
if( this->Grid().Rank() == 0 )
std::cerr << "Unaligned [MD,* ] <- [MD,* ]." << std::endl;
#endif
throw std::logic_error
("Unaligned [MD,* ] = [MD,* ] not yet implemented");
}
#ifndef RELEASE
PopCallStack();
#endif
return *this;
}