本文整理匯總了C++中DistMatrix::LocalMatrix方法的典型用法代碼示例。如果您正苦於以下問題:C++ DistMatrix::LocalMatrix方法的具體用法?C++ DistMatrix::LocalMatrix怎麽用?C++ DistMatrix::LocalMatrix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DistMatrix
的用法示例。
在下文中一共展示了DistMatrix::LocalMatrix方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: PushCallStack
inline void
Zero( DistMatrix<T,U,V>& A )
{
#ifndef RELEASE
PushCallStack("Zero");
#endif
Zero( A.LocalMatrix() );
#ifndef RELEASE
PopCallStack();
#endif
}
示例2: PushCallStack
inline void
Conjugate( DistMatrix<T,U,V>& A )
{
#ifndef RELEASE
PushCallStack("Conjugate (in-place)");
#endif
Conjugate( A.LocalMatrix() );
#ifndef RELEASE
PopCallStack();
#endif
}
示例3: PushCallStack
inline void
LocalLU( DistMatrix<F,STAR,STAR>& A )
{
#ifndef RELEASE
PushCallStack("internal::LocalLU");
#endif
LU( A.LocalMatrix() );
#ifndef RELEASE
PopCallStack();
#endif
}
示例4: PushCallStack
inline void
MakeReal( DistMatrix<T,U,V>& A )
{
#ifndef RELEASE
PushCallStack("MakeReal");
#endif
MakeReal( A.LocalMatrix() );
#ifndef RELEASE
PopCallStack();
#endif
}
示例5: 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
}
示例6: logic_error
inline void
Ger
( T alpha, const DistMatrix<T>& x,
const DistMatrix<T>& y,
DistMatrix<T>& A )
{
#ifndef RELEASE
PushCallStack("Ger");
if( A.Grid() != x.Grid() || x.Grid() != y.Grid() )
throw std::logic_error
("{A,x,y} must be distributed over the same grid");
if( ( x.Width() != 1 && x.Height() != 1 ) ||
( y.Width() != 1 && y.Height() != 1 ) )
throw std::logic_error("x and y are assumed to be vectors");
const int xLength = ( x.Width()==1 ? x.Height() : x.Width() );
const int yLength = ( y.Width()==1 ? y.Height() : y.Width() );
if( A.Height() != xLength || A.Width() != yLength )
{
std::ostringstream msg;
msg << "Nonconformal Ger: \n"
<< " A ~ " << A.Height() << " x " << A.Width() << "\n"
<< " x ~ " << x.Height() << " x " << x.Width() << "\n"
<< " y ~ " << y.Height() << " x " << y.Width() << "\n";
throw std::logic_error( msg.str() );
}
#endif
const Grid& g = A.Grid();
if( x.Width() == 1 && y.Width() == 1 )
{
// Temporary distributions
DistMatrix<T,MC,STAR> x_MC_STAR(g);
DistMatrix<T,MR,STAR> y_MR_STAR(g);
// Begin the algoritm
x_MC_STAR.AlignWith( A );
y_MR_STAR.AlignWith( A );
//--------------------------------------------------------------------//
x_MC_STAR = x;
y_MR_STAR = y;
Ger
( alpha, x_MC_STAR.LockedLocalMatrix(),
y_MR_STAR.LockedLocalMatrix(),
A.LocalMatrix() );
//--------------------------------------------------------------------//
x_MC_STAR.FreeAlignments();
y_MR_STAR.FreeAlignments();
}
else if( x.Width() == 1 )
{
// Temporary distributions
DistMatrix<T,MC, STAR> x_MC_STAR(g);
DistMatrix<T,STAR,MR > y_STAR_MR(g);
// Begin the algorithm
x_MC_STAR.AlignWith( A );
y_STAR_MR.AlignWith( A );
//--------------------------------------------------------------------//
x_MC_STAR = x;
y_STAR_MR = y;
Ger
( alpha, x_MC_STAR.LockedLocalMatrix(),
y_STAR_MR.LockedLocalMatrix(),
A.LocalMatrix() );
//--------------------------------------------------------------------//
x_MC_STAR.FreeAlignments();
y_STAR_MR.FreeAlignments();
}
else if( y.Width() == 1 )
{
// Temporary distributions
DistMatrix<T,STAR,MC > x_STAR_MC(g);
DistMatrix<T,MR, STAR> y_MR_STAR(g);
// Begin the algorithm
x_STAR_MC.AlignWith( A );
y_MR_STAR.AlignWith( A );
//--------------------------------------------------------------------//
x_STAR_MC = x;
y_MR_STAR = y;
Ger
( alpha, x_STAR_MC.LockedLocalMatrix(),
y_MR_STAR.LockedLocalMatrix(),
A.LocalMatrix() );
//--------------------------------------------------------------------//
x_STAR_MC.FreeAlignments();
y_MR_STAR.FreeAlignments();
}
else
{
// Temporary distributions
DistMatrix<T,STAR,MC> x_STAR_MC(g);
DistMatrix<T,STAR,MR> y_STAR_MR(g);
// Begin the algorithm
x_STAR_MC.AlignWith( A );
y_STAR_MR.AlignWith( A );
//--------------------------------------------------------------------//
x_STAR_MC = x;
y_STAR_MR = y;
Ger
//.........這裏部分代碼省略.........