本文整理汇总了C++中RepartitionDownDiagonal函数的典型用法代码示例。如果您正苦于以下问题:C++ RepartitionDownDiagonal函数的具体用法?C++ RepartitionDownDiagonal怎么用?C++ RepartitionDownDiagonal使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RepartitionDownDiagonal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TrdtrmmLVar1
inline void
TrdtrmmLVar1( Orientation orientation, Matrix<F>& L )
{
#ifndef RELEASE
CallStackEntry entry("internal::TrdtrmmLVar1");
if( L.Height() != L.Width() )
LogicError("L must be square");
if( orientation == NORMAL )
LogicError("Orientation must be (conjugate-)transpose");
#endif
Matrix<F>
LTL, LTR, L00, L01, L02,
LBL, LBR, L10, L11, L12,
L20, L21, L22;
Matrix<F> d1, S10;
PartitionDownDiagonal
( L, LTL, LTR,
LBL, LBR, 0 );
while( LTL.Height() < L.Height() && LTL.Width() < L.Height() )
{
RepartitionDownDiagonal
( LTL, /**/ LTR, L00, /**/ L01, L02,
/*************/ /******************/
/**/ L10, /**/ L11, L12,
LBL, /**/ LBR, L20, /**/ L21, L22 );
//--------------------------------------------------------------------/
L11.GetDiagonal( d1 );
S10 = L10;
DiagonalSolve( LEFT, NORMAL, d1, L10, true );
Trrk( LOWER, orientation, NORMAL, F(1), S10, L10, F(1), L00 );
Trmm( LEFT, LOWER, orientation, UNIT, F(1), L11, L10 );
TrdtrmmLUnblocked( orientation, L11 );
//--------------------------------------------------------------------/
SlidePartitionDownDiagonal
( LTL, /**/ LTR, L00, L01, /**/ L02,
/**/ L10, L11, /**/ L12,
/*************/ /******************/
LBL, /**/ LBR, L20, L21, /**/ L22 );
}
}
示例2: LU
inline void
LU( Matrix<F>& A )
{
#ifndef RELEASE
PushCallStack("LU");
#endif
// Matrix views
Matrix<F>
ATL, ATR, A00, A01, A02,
ABL, ABR, A10, A11, A12,
A20, A21, A22;
// Start the algorithm
PartitionDownDiagonal
( A, ATL, ATR,
ABL, ABR, 0 );
while( ATL.Height() < A.Height() && ATL.Width() < A.Width() )
{
RepartitionDownDiagonal
( ATL, /**/ ATR, A00, /**/ A01, A02,
/*************/ /******************/
/**/ A10, /**/ A11, A12,
ABL, /**/ ABR, A20, /**/ A21, A22 );
//--------------------------------------------------------------------//
internal::LUUnb( A11 );
Trsm( RIGHT, UPPER, NORMAL, NON_UNIT, F(1), A11, A21 );
Trsm( LEFT, LOWER, NORMAL, UNIT, F(1), A11, A12 );
Gemm( NORMAL, NORMAL, F(-1), A21, A12, F(1), A22 );
//--------------------------------------------------------------------//
SlidePartitionDownDiagonal
( ATL, /**/ ATR, A00, A01, /**/ A02,
/**/ A10, A11, /**/ A12,
/*************/ /******************/
ABL, /**/ ABR, A20, A21, /**/ A22 );
}
#ifndef RELEASE
PopCallStack();
#endif
}
示例3: LVar2
inline void
LVar2( Matrix<F>& A )
{
#ifndef RELEASE
CallStackEntry entry("cholesky::LVar2");
if( A.Height() != A.Width() )
LogicError("Can only compute Cholesky factor of square matrices");
#endif
// Matrix views
Matrix<F>
ATL, ATR, A00, A01, A02,
ABL, ABR, A10, A11, A12,
A20, A21, A22;
// Start the algorithm
PartitionDownDiagonal
( A, ATL, ATR,
ABL, ABR, 0 );
while( ATL.Height() < A.Height() )
{
RepartitionDownDiagonal
( ATL, /**/ ATR, A00, /**/ A01, A02,
/*************/ /******************/
/**/ A10, /**/ A11, A12,
ABL, /**/ ABR, A20, /**/ A21, A22 );
//--------------------------------------------------------------------//
Herk( LOWER, NORMAL, F(-1), A10, F(1), A11 );
cholesky::LVar3Unb( A11 );
Gemm( NORMAL, ADJOINT, F(-1), A20, A10, F(1), A21 );
Trsm( RIGHT, LOWER, ADJOINT, NON_UNIT, F(1), A11, A21 );
//--------------------------------------------------------------------//
SlidePartitionDownDiagonal
( ATL, /**/ ATR, A00, A01, /**/ A02,
/**/ A10, A11, /**/ A12,
/*************/ /******************/
ABL, /**/ ABR, A20, A21, /**/ A22 );
}
}
示例4: UVar3
inline void
UVar3( Matrix<F>& A )
{
#ifndef RELEASE
CallStackEntry entry("cholesky::UVar3");
if( A.Height() != A.Width() )
throw std::logic_error
("Can only compute Cholesky factor of square matrices");
#endif
// Matrix views
Matrix<F>
ATL, ATR, A00, A01, A02,
ABL, ABR, A10, A11, A12,
A20, A21, A22;
// Start the algorithm
PartitionDownDiagonal
( A, ATL, ATR,
ABL, ABR, 0 );
while( ABR.Height() > 0 )
{
RepartitionDownDiagonal
( ATL, /**/ ATR, A00, /**/ A01, A02,
/*************/ /******************/
/**/ A10, /**/ A11, A12,
ABL, /**/ ABR, A20, /**/ A21, A22 );
//--------------------------------------------------------------------//
cholesky::UVar3Unb( A11 );
Trsm( LEFT, UPPER, ADJOINT, NON_UNIT, F(1), A11, A12 );
Herk( UPPER, ADJOINT, F(-1), A12, F(1), A22 );
//--------------------------------------------------------------------//
SlidePartitionDownDiagonal
( ATL, /**/ ATR, A00, A01, /**/ A02,
/**/ A10, A11, /**/ A12,
/*************/ /******************/
ABL, /**/ ABR, A20, A21, /**/ A22 );
}
}
示例5: UnbFLAME
inline void
UnbFLAME( Matrix<F>& A )
{
#ifndef RELEASE
CallStackEntry entry("lu::UnbFLAME");
#endif
// Matrix views
Matrix<F>
ATL, ATR, A00, a01, A02, alpha21T,
ABL, ABR, a10, alpha11, a12, a21B,
A20, a21, A22;
PartitionDownDiagonal
( A, ATL, ATR,
ABL, ABR, 0 );
while( ATL.Height() < A.Height() && ATL.Width() < A.Width() )
{
RepartitionDownDiagonal
( ATL, /**/ ATR, A00, /**/ a01, A02,
/*************/ /**********************/
/**/ a10, /**/ alpha11, a12,
ABL, /**/ ABR, A20, /**/ a21, A22, 1 );
//--------------------------------------------------------------------//
F alpha = alpha11.Get(0,0);
if( alpha == F(0) )
throw SingularMatrixException();
Scale( 1/alpha, a21 );
Geru( F(-1), a21, a12, A22 );
//--------------------------------------------------------------------//
SlidePartitionDownDiagonal
( ATL, /**/ ATR, A00, a01, /**/ A02,
/**/ a10, alpha11, /**/ a12,
/*************/ /**********************/
ABL, /**/ ABR, A20, a21, /**/ A22 );
}
}
示例6: TrtrmmUVar1
inline void
TrtrmmUVar1( Orientation orientation, Matrix<T>& U )
{
#ifndef RELEASE
PushCallStack("internal::TrtrmmUVar1");
#endif
Matrix<T>
UTL, UTR, U00, U01, U02,
UBL, UBR, U10, U11, U12,
U20, U21, U22;
PartitionDownDiagonal
( U, UTL, UTR,
UBL, UBR, 0 );
while( UTL.Height() < U.Height() && UTL.Width() < U.Height() )
{
RepartitionDownDiagonal
( UTL, /**/ UTR, U00, /**/ U01, U02,
/*************/ /******************/
/**/ U10, /**/ U11, U12,
UBL, /**/ UBR, U20, /**/ U21, U22 );
//--------------------------------------------------------------------/
Trrk( UPPER, NORMAL, orientation, T(1), U01, U01, T(1), U00 );
Trmm( RIGHT, UPPER, orientation, NON_UNIT, T(1), U11, U01 );
TrtrmmUUnblocked( orientation, U11 );
//--------------------------------------------------------------------/
SlidePartitionDownDiagonal
( UTL, /**/ UTR, U00, U01, /**/ U02,
/**/ U10, U11, /**/ U12,
/*************/ /******************/
UBL, /**/ UBR, U20, U21, /**/ U22 );
}
#ifndef RELEASE
PopCallStack();
#endif
}
示例7: TrtrmmLVar1
inline void
TrtrmmLVar1( Orientation orientation, Matrix<T>& L )
{
#ifndef RELEASE
CallStackEntry entry("internal::TrtrmmLVar1");
if( orientation == NORMAL )
LogicError("Must be (conjugate-)transposed");
#endif
Matrix<T>
LTL, LTR, L00, L01, L02,
LBL, LBR, L10, L11, L12,
L20, L21, L22;
PartitionDownDiagonal
( L, LTL, LTR,
LBL, LBR, 0 );
while( LTL.Height() < L.Height() && LTL.Width() < L.Height() )
{
RepartitionDownDiagonal
( LTL, /**/ LTR, L00, /**/ L01, L02,
/*************/ /******************/
/**/ L10, /**/ L11, L12,
LBL, /**/ LBR, L20, /**/ L21, L22 );
//--------------------------------------------------------------------/
Trrk( LOWER, orientation, NORMAL, T(1), L10, L10, T(1), L00 );
Trmm( LEFT, LOWER, orientation, NON_UNIT, T(1), L11, L10 );
TrtrmmLUnblocked( orientation, L11 );
//--------------------------------------------------------------------/
SlidePartitionDownDiagonal
( LTL, /**/ LTR, L00, L01, /**/ L02,
/**/ L10, L11, /**/ L12,
/*************/ /******************/
LBL, /**/ LBR, L20, L21, /**/ L22 );
}
}
示例8: TwoSidedTrsmUVar1
inline void
TwoSidedTrsmUVar1( UnitOrNonUnit diag, Matrix<F>& A, const Matrix<F>& U )
{
#ifndef RELEASE
CallStackEntry entry("internal::TwoSidedTrsmUVar1");
if( A.Height() != A.Width() )
LogicError("A must be square");
if( U.Height() != U.Width() )
LogicError("Triangular matrices must be square");
if( A.Height() != U.Height() )
LogicError("A and U must be the same size");
#endif
// Matrix views
Matrix<F>
ATL, ATR, A00, A01, A02,
ABL, ABR, A10, A11, A12,
A20, A21, A22;
Matrix<F>
UTL, UTR, U00, U01, U02,
UBL, UBR, U10, U11, U12,
U20, U21, U22;
// Temporary products
Matrix<F> Y01;
PartitionDownDiagonal
( A, ATL, ATR,
ABL, ABR, 0 );
LockedPartitionDownDiagonal
( U, UTL, UTR,
UBL, UBR, 0 );
while( ATL.Height() < A.Height() )
{
RepartitionDownDiagonal
( ATL, /**/ ATR, A00, /**/ A01, A02,
/*************/ /******************/
/**/ A10, /**/ A11, A12,
ABL, /**/ ABR, A20, /**/ A21, A22 );
LockedRepartitionDownDiagonal
( UTL, /**/ UTR, U00, /**/ U01, U02,
/*************/ /******************/
/**/ U10, /**/ U11, U12,
UBL, /**/ UBR, U20, /**/ U21, U22 );
//--------------------------------------------------------------------//
// Y01 := A00 U01
Zeros( Y01, A01.Height(), A01.Width() );
Hemm( LEFT, UPPER, F(1), A00, U01, F(0), Y01 );
// A01 := inv(U00)' A01
Trsm( LEFT, UPPER, ADJOINT, diag, F(1), U00, A01 );
// A01 := A01 - 1/2 Y01
Axpy( F(-1)/F(2), Y01, A01 );
// A11 := A11 - (U01' A01 + A01' U01)
Her2k( UPPER, ADJOINT, F(-1), U01, A01, F(1), A11 );
// A11 := inv(U11)' A11 inv(U11)
TwoSidedTrsmUUnb( diag, A11, U11 );
// A01 := A01 - 1/2 Y01
Axpy( F(-1)/F(2), Y01, A01 );
// A01 := A01 inv(U11)
Trsm( RIGHT, UPPER, NORMAL, diag, F(1), U11, A01 );
//--------------------------------------------------------------------//
SlidePartitionDownDiagonal
( ATL, /**/ ATR, A00, A01, /**/ A02,
/**/ A10, A11, /**/ A12,
/*************/ /******************/
ABL, /**/ ABR, A20, A21, /**/ A22 );
SlideLockedPartitionDownDiagonal
( UTL, /**/ UTR, U00, U01, /**/ U02,
/**/ U10, U11, /**/ U12,
/*************/ /******************/
UBL, /**/ UBR, U20, U21, /**/ U22 );
}
}
示例9: CholeskyUVar3
inline void
CholeskyUVar3( DistMatrix<F>& A )
{
#ifndef RELEASE
PushCallStack("internal::CholeskyUVar3");
if( A.Height() != A.Width() )
throw std::logic_error
("Can only compute Cholesky factor of square matrices");
#endif
const Grid& g = A.Grid();
// Matrix views
DistMatrix<F>
ATL(g), ATR(g), A00(g), A01(g), A02(g),
ABL(g), ABR(g), A10(g), A11(g), A12(g),
A20(g), A21(g), A22(g);
// Temporary matrix distributions
DistMatrix<F,STAR,STAR> A11_STAR_STAR(g);
DistMatrix<F,STAR,VR > A12_STAR_VR(g);
DistMatrix<F,STAR,MC > A12_STAR_MC(g);
DistMatrix<F,STAR,MR > A12_STAR_MR(g);
// Start the algorithm
PartitionDownDiagonal
( A, ATL, ATR,
ABL, ABR, 0 );
while( ABR.Height() > 0 )
{
RepartitionDownDiagonal
( ATL, /**/ ATR, A00, /**/ A01, A02,
/*************/ /******************/
/**/ A10, /**/ A11, A12,
ABL, /**/ ABR, A20, /**/ A21, A22 );
A12_STAR_MC.AlignWith( A22 );
A12_STAR_MR.AlignWith( A22 );
A12_STAR_VR.AlignWith( A22 );
//--------------------------------------------------------------------//
A11_STAR_STAR = A11;
LocalCholesky( UPPER, A11_STAR_STAR );
A11 = A11_STAR_STAR;
A12_STAR_VR = A12;
LocalTrsm
( LEFT, UPPER, ADJOINT, NON_UNIT, F(1), A11_STAR_STAR, A12_STAR_VR );
A12_STAR_MC = A12_STAR_VR;
A12_STAR_MR = A12_STAR_VR;
LocalTrrk
( UPPER, ADJOINT, F(-1), A12_STAR_MC, A12_STAR_MR, F(1), A22 );
A12 = A12_STAR_MR;
//--------------------------------------------------------------------//
A12_STAR_MC.FreeAlignments();
A12_STAR_MR.FreeAlignments();
A12_STAR_VR.FreeAlignments();
SlidePartitionDownDiagonal
( ATL, /**/ ATR, A00, A01, /**/ A02,
/**/ A10, A11, /**/ A12,
/*************/ /******************/
ABL, /**/ ABR, A20, A21, /**/ A22 );
}
#ifndef RELEASE
PopCallStack();
#endif
}
示例10: PanelHouseholder
inline void
PanelHouseholder( Matrix<F>& A, Matrix<F>& t )
{
#ifndef RELEASE
CallStackEntry entry("lq::PanelHouseholder");
if( t.Height() != Min(A.Height(),A.Width()) || t.Width() != 1 )
LogicError
("t must be a vector of height equal to the minimum dimension of A");
#endif
Matrix<F>
ATL, ATR, A00, a01, A02, aTopRow, ABottomPan,
ABL, ABR, a10, alpha11, a12,
A20, a21, A22;
Matrix<F>
tT, t0,
tB, tau1,
t2;
Matrix<F> z, aTopRowConj;
PartitionDownDiagonal
( A, ATL, ATR,
ABL, ABR, 0 );
PartitionDown
( t, tT,
tB, 0 );
while( ATL.Height() < A.Height() && ATL.Width() < A.Width() )
{
RepartitionDownDiagonal
( ATL, /**/ ATR, A00, /**/ a01, A02,
/*************/ /**********************/
/**/ a10, /**/ alpha11, a12,
ABL, /**/ ABR, A20, /**/ a21, A22, 1 );
RepartitionDown
( tT, t0,
/**/ /****/
tau1,
tB, t2, 1 );
View1x2( aTopRow, alpha11, a12 );
View1x2( ABottomPan, a21, A22 );
//--------------------------------------------------------------------//
// Compute the Householder reflector
const F tau = Reflector( alpha11, a12 );
tau1.Set( 0, 0, tau );
// Apply the Householder reflector
const F alpha = alpha11.Get(0,0);
alpha11.Set(0,0,1);
Conjugate( aTopRow, aTopRowConj );
Zeros( z, ABottomPan.Height(), 1 );
Gemv( NORMAL, F(1), ABottomPan, aTopRowConj, F(0), z );
Ger( -Conj(tau), z, aTopRowConj, ABottomPan );
alpha11.Set(0,0,alpha);
//--------------------------------------------------------------------//
SlidePartitionDown
( tT, t0,
tau1,
/**/ /****/
tB, t2 );
SlidePartitionDownDiagonal
( ATL, /**/ ATR, A00, a01, /**/ A02,
/**/ a10, alpha11, /**/ a12,
/*************/ /**********************/
ABL, /**/ ABR, A20, a21, /**/ A22 );
}
}
示例11: Householder
inline void
Householder( Matrix<F>& A, Matrix<F>& t )
{
#ifndef RELEASE
CallStackEntry entry("qr::Householder");
#endif
t.ResizeTo( Min(A.Height(),A.Width()), 1 );
// Matrix views
Matrix<F>
ATL, ATR, A00, A01, A02, ALeftPan, ARightPan,
ABL, ABR, A10, A11, A12,
A20, A21, A22;
Matrix<F>
tT, t0,
tB, t1,
t2;
PartitionDownDiagonal
( A, ATL, ATR,
ABL, ABR, 0 );
PartitionDown
( t, tT,
tB, 0 );
while( ATL.Height() < A.Height() && ATL.Width() < A.Width() )
{
RepartitionDownDiagonal
( ATL, /**/ ATR, A00, /**/ A01, A02,
/*************/ /******************/
/**/ A10, /**/ A11, A12,
ABL, /**/ ABR, A20, /**/ A21, A22 );
RepartitionDown
( tT, t0,
/**/ /**/
t1,
tB, t2 );
View2x1
( ALeftPan, A11,
A21 );
View2x1
( ARightPan, A12,
A22 );
//--------------------------------------------------------------------//
PanelHouseholder( ALeftPan, t1 );
ApplyQ( LEFT, ADJOINT, ALeftPan, t1, ARightPan );
//--------------------------------------------------------------------//
SlidePartitionDown
( tT, t0,
t1,
/**/ /**/
tB, t2 );
SlidePartitionDownDiagonal
( ATL, /**/ ATR, A00, A01, /**/ A02,
/**/ A10, A11, /**/ A12,
/*************/ /******************/
ABL, /**/ ABR, A20, A21, /**/ A22 );
}
}
示例12: LQ
inline void
LQ( DistMatrix<Complex<R>,MC,MR >& A,
DistMatrix<Complex<R>,MD,STAR>& t )
{
#ifndef RELEASE
PushCallStack("LQ");
if( A.Grid() != t.Grid() )
throw std::logic_error("{A,t} must be distributed over the same grid");
#endif
typedef Complex<R> C;
const Grid& g = A.Grid();
if( t.Viewing() )
{
if( !t.AlignedWithDiagonal( A ) )
throw std::logic_error("t was not aligned with A");
if( t.Height() != std::min(A.Height(),A.Width()) || t.Width() != 1 )
throw std::logic_error("t was not the appropriate shape");
}
else
{
t.AlignWithDiagonal( A );
t.ResizeTo( std::min(A.Height(),A.Width()), 1 );
}
// Matrix views
DistMatrix<C,MC,MR>
ATL(g), ATR(g), A00(g), A01(g), A02(g), ATopPan(g), ABottomPan(g),
ABL(g), ABR(g), A10(g), A11(g), A12(g),
A20(g), A21(g), A22(g);
DistMatrix<C,MD,STAR>
tT(g), t0(g),
tB(g), t1(g),
t2(g);
PartitionDownLeftDiagonal
( A, ATL, ATR,
ABL, ABR, 0 );
PartitionDown
( t, tT,
tB, 0 );
while( ATL.Height() < A.Height() && ATL.Width() < A.Width() )
{
RepartitionDownDiagonal
( ATL, /**/ ATR, A00, /**/ A01, A02,
/*************/ /******************/
/**/ A10, /**/ A11, A12,
ABL, /**/ ABR, A20, /**/ A21, A22 );
RepartitionDown
( tT, t0,
/**/ /**/
t1,
tB, t2 );
ATopPan.View1x2( A11, A12 );
ABottomPan.View1x2( A21, A22 );
//--------------------------------------------------------------------//
internal::PanelLQ( ATopPan, t1 );
ApplyPackedReflectors
( RIGHT, UPPER, HORIZONTAL, FORWARD, CONJUGATED,
0, ATopPan, t1, ABottomPan );
//--------------------------------------------------------------------//
SlidePartitionDown
( tT, t0,
t1,
/**/ /**/
tB, t2 );
SlidePartitionDownDiagonal
( ATL, /**/ ATR, A00, A01, /**/ A02,
/**/ A10, A11, /**/ A12,
/*************/ /******************/
ABL, /**/ ABR, A20, A21, /**/ A22 );
}
#ifndef RELEASE
PopCallStack();
#endif
}
示例13: LU
inline void
LU( Matrix<F>& A, Matrix<int>& p )
{
#ifndef RELEASE
CallStackEntry entry("LU");
if( p.Viewing() &&
(p.Height() != std::min(A.Height(),A.Width()) || p.Width() != 1) )
throw std::logic_error
("p must be a vector of the same height as the min dimension of A");
#endif
if( !p.Viewing() )
p.ResizeTo( std::min(A.Height(),A.Width()), 1 );
// Matrix views
Matrix<F>
ATL, ATR, A00, A01, A02, ABRL, ABRR,
ABL, ABR, A10, A11, A12,
A20, A21, A22;
Matrix<int>
pT, p0,
pB, p1,
p2;
// Pivot composition
std::vector<int> image, preimage;
// Start the algorithm
PartitionDownDiagonal
( A, ATL, ATR,
ABL, ABR, 0 );
PartitionDown
( p, pT,
pB, 0 );
while( ATL.Height() < A.Height() && ATL.Width() < A.Width() )
{
RepartitionDownDiagonal
( ATL, /**/ ATR, A00, /**/ A01, A02,
/*************/ /******************/
/**/ A10, /**/ A11, A12,
ABL, /**/ ABR, A20, /**/ A21, A22 );
RepartitionDown
( pT, p0,
/**/ /**/
p1,
pB, p2 );
PartitionRight( ABR, ABRL, ABRR, A11.Width() );
const int pivotOffset = A01.Height();
//--------------------------------------------------------------------//
lu::Panel( ABRL, p1, pivotOffset );
ComposePivots( p1, pivotOffset, image, preimage );
ApplyRowPivots( ABL, image, preimage );
ApplyRowPivots( ABRR, image, preimage );
Trsm( LEFT, LOWER, NORMAL, UNIT, F(1), A11, A12 );
Gemm( NORMAL, NORMAL, F(-1), A21, A12, F(1), A22 );
//--------------------------------------------------------------------//
SlidePartitionDownDiagonal
( ATL, /**/ ATR, A00, A01, /**/ A02,
/**/ A10, A11, /**/ A12,
/*************/ /******************/
ABL, /**/ ABR, A20, A21, /**/ A22 );
SlidePartitionDown
( pT, p0,
p1,
/**/ /**/
pB, p2 );
}
}
示例14: entry
inline void
TwoSidedTrsmUVar4
( UnitOrNonUnit diag, DistMatrix<F>& A, const DistMatrix<F>& U )
{
#ifndef RELEASE
CallStackEntry entry("internal::TwoSidedTrsmUVar4");
if( A.Height() != A.Width() )
LogicError("A must be square");
if( U.Height() != U.Width() )
LogicError("Triangular matrices must be square");
if( A.Height() != U.Height() )
LogicError("A and U must be the same size");
#endif
const Grid& g = A.Grid();
// Matrix views
DistMatrix<F>
ATL(g), ATR(g), A00(g), A01(g), A02(g),
ABL(g), ABR(g), A10(g), A11(g), A12(g),
A20(g), A21(g), A22(g);
DistMatrix<F>
UTL(g), UTR(g), U00(g), U01(g), U02(g),
UBL(g), UBR(g), U10(g), U11(g), U12(g),
U20(g), U21(g), U22(g);
// Temporary distributions
DistMatrix<F,VC, STAR> A01_VC_STAR(g);
DistMatrix<F,STAR,MC > A01Trans_STAR_MC(g);
DistMatrix<F,STAR,STAR> A11_STAR_STAR(g);
DistMatrix<F,STAR,VR > A12_STAR_VR(g);
DistMatrix<F,STAR,VC > A12_STAR_VC(g);
DistMatrix<F,STAR,MC > A12_STAR_MC(g);
DistMatrix<F,STAR,MR > A12_STAR_MR(g);
DistMatrix<F,STAR,STAR> U11_STAR_STAR(g);
DistMatrix<F,MR, STAR> U12Trans_MR_STAR(g);
DistMatrix<F,VR, STAR> U12Trans_VR_STAR(g);
DistMatrix<F,STAR,VR > U12_STAR_VR(g);
DistMatrix<F,STAR,VC > U12_STAR_VC(g);
DistMatrix<F,STAR,MC > U12_STAR_MC(g);
DistMatrix<F,STAR,VR > Y12_STAR_VR(g);
PartitionDownDiagonal
( A, ATL, ATR,
ABL, ABR, 0 );
LockedPartitionDownDiagonal
( U, UTL, UTR,
UBL, UBR, 0 );
while( ATL.Height() < A.Height() )
{
RepartitionDownDiagonal
( ATL, /**/ ATR, A00, /**/ A01, A02,
/*************/ /******************/
/**/ A10, /**/ A11, A12,
ABL, /**/ ABR, A20, /**/ A21, A22 );
LockedRepartitionDownDiagonal
( UTL, /**/ UTR, U00, /**/ U01, U02,
/*************/ /******************/
/**/ U10, /**/ U11, U12,
UBL, /**/ UBR, U20, /**/ U21, U22 );
A01_VC_STAR.AlignWith( A02 );
A01Trans_STAR_MC.AlignWith( A02 );
A12_STAR_VR.AlignWith( A22 );
A12_STAR_VC.AlignWith( A22 );
A12_STAR_MC.AlignWith( A22 );
A12_STAR_MR.AlignWith( A22 );
U12Trans_MR_STAR.AlignWith( A02 );
U12Trans_VR_STAR.AlignWith( A02 );
U12_STAR_VR.AlignWith( A02 );
U12_STAR_VC.AlignWith( A22 );
U12_STAR_MC.AlignWith( A22 );
Y12_STAR_VR.AlignWith( A12 );
//--------------------------------------------------------------------//
// A01 := A01 inv(U11)
A01_VC_STAR = A01;
U11_STAR_STAR = U11;
LocalTrsm
( RIGHT, UPPER, NORMAL, diag, F(1), U11_STAR_STAR, A01_VC_STAR );
A01 = A01_VC_STAR;
// A11 := inv(U11)' A11 inv(U11)
A11_STAR_STAR = A11;
LocalTwoSidedTrsm( UPPER, diag, A11_STAR_STAR, U11_STAR_STAR );
A11 = A11_STAR_STAR;
// A02 := A02 - A01 U12
A01Trans_STAR_MC.TransposeFrom( A01_VC_STAR );
U12Trans_MR_STAR.TransposeFrom( U12 );
LocalGemm
( TRANSPOSE, TRANSPOSE,
F(-1), A01Trans_STAR_MC, U12Trans_MR_STAR, F(1), A02 );
// Y12 := A11 U12
U12Trans_VR_STAR = U12Trans_MR_STAR;
Zeros( U12_STAR_VR, A12.Height(), A12.Width() );
Transpose( U12Trans_VR_STAR.Matrix(), U12_STAR_VR.Matrix() );
Zeros( Y12_STAR_VR, A12.Height(), A12.Width() );
Hemm
( LEFT, UPPER,
//.........这里部分代码省略.........
示例15: PushCallStack
inline void
internal::HegstLLVar4( DistMatrix<F,MC,MR>& A, const DistMatrix<F,MC,MR>& L )
{
#ifndef RELEASE
PushCallStack("internal::HegstLLVar4");
if( A.Height() != A.Width() )
throw std::logic_error("A must be square");
if( L.Height() != L.Width() )
throw std::logic_error("Triangular matrices must be square");
if( A.Height() != L.Height() )
throw std::logic_error("A and L must be the same size");
#endif
const Grid& g = A.Grid();
// Matrix views
DistMatrix<F,MC,MR>
ATL(g), ATR(g), A00(g), A01(g), A02(g),
ABL(g), ABR(g), A10(g), A11(g), A12(g),
A20(g), A21(g), A22(g);
DistMatrix<F,MC,MR>
LTL(g), LTR(g), L00(g), L01(g), L02(g),
LBL(g), LBR(g), L10(g), L11(g), L12(g),
L20(g), L21(g), L22(g);
// Temporary distributions
DistMatrix<F,STAR,VR > A10_STAR_VR(g);
DistMatrix<F,STAR,MR > A10_STAR_MR(g);
DistMatrix<F,STAR,MC > A10_STAR_MC(g);
DistMatrix<F,STAR,STAR> A11_STAR_STAR(g);
DistMatrix<F,VC, STAR> A21_VC_STAR(g);
DistMatrix<F,MC, STAR> A21_MC_STAR(g);
DistMatrix<F,STAR,VR > L10_STAR_VR(g);
DistMatrix<F,STAR,MR > L10_STAR_MR(g);
DistMatrix<F,STAR,MC > L10_STAR_MC(g);
DistMatrix<F,STAR,STAR> L11_STAR_STAR(g);
DistMatrix<F,STAR,VR > Y10_STAR_VR(g);
PartitionDownDiagonal
( A, ATL, ATR,
ABL, ABR, 0 );
LockedPartitionDownDiagonal
( L, LTL, LTR,
LBL, LBR, 0 );
while( ATL.Height() < A.Height() )
{
RepartitionDownDiagonal
( ATL, /**/ ATR, A00, /**/ A01, A02,
/*************/ /******************/
/**/ A10, /**/ A11, A12,
ABL, /**/ ABR, A20, /**/ A21, A22 );
LockedRepartitionDownDiagonal
( LTL, /**/ LTR, L00, /**/ L01, L02,
/*************/ /******************/
/**/ L10, /**/ L11, L12,
LBL, /**/ LBR, L20, /**/ L21, L22 );
A10_STAR_VR.AlignWith( A00 );
A10_STAR_MR.AlignWith( A00 );
A10_STAR_MC.AlignWith( A00 );
A21_MC_STAR.AlignWith( A20 );
L10_STAR_VR.AlignWith( A00 );
L10_STAR_MR.AlignWith( A00 );
L10_STAR_MC.AlignWith( A00 );
Y10_STAR_VR.AlignWith( A10 );
//--------------------------------------------------------------------//
// Y10 := A11 L10
A11_STAR_STAR = A11;
L10_STAR_VR = L10;
Y10_STAR_VR.ResizeTo( A10.Height(), A10.Width() );
Zero( Y10_STAR_VR );
Hemm
( LEFT, LOWER,
(F)0.5, A11_STAR_STAR.LockedLocalMatrix(),
L10_STAR_VR.LockedLocalMatrix(),
(F)0, Y10_STAR_VR.LocalMatrix() );
// A10 := A10 + 1/2 Y10
A10_STAR_VR = A10;
Axpy( (F)1, Y10_STAR_VR, A10_STAR_VR );
// A00 := A00 + (A10' L10 + L10' A10)
A10_STAR_MR = A10_STAR_VR;
A10_STAR_MC = A10_STAR_VR;
L10_STAR_MR = L10_STAR_VR;
L10_STAR_MC = L10_STAR_VR;
internal::LocalTrr2k
( LOWER, ADJOINT, ADJOINT,
(F)1, A10_STAR_MC, L10_STAR_MR,
L10_STAR_MC, A10_STAR_MR,
(F)1, A00 );
// A10 := A10 + 1/2 Y10
Axpy( (F)1, Y10_STAR_VR, A10_STAR_VR );
// A10 := L11' A10
L11_STAR_STAR = L11;
internal::LocalTrmm
( LEFT, LOWER, ADJOINT, NON_UNIT, (F)1, L11_STAR_STAR, A10_STAR_VR );
//.........这里部分代码省略.........