DistMultiVec<T> DistMultiVec<T>::operator()( const vector<Int>& I, const vector<Int>& J ) const { DEBUG_ONLY(CSE cse("DistMultiVec::operator()")) DistMultiVec<T> ASub(this->Comm()); GetSubmatrix( *this, I, J, ASub ); return ASub; }
void DruinskyToledo( ElementalMatrix<F>& A, Int k ) { EL_DEBUG_CSE const Int n = 2*k; Zeros( A, n, n ); if( k == 0 ) return; if( k == 1 ) { Ones( A, n, n ); return; } typedef Base<F> Real; const Real phi = Real(1) + 4*limits::Epsilon<Real>(); const Real alphaPhi = LDLPivotConstant<Real>(BUNCH_KAUFMAN_A)*phi; vector<Real> d( k-2 ); Real sigma(1); for( Int i=0; i<k-2; ++i ) { d[i] = -alphaPhi/sigma; sigma -= 1/d[i]; } unique_ptr<ElementalMatrix<F>> ASub( A.Construct(A.Grid(),A.Root()) ); View( *ASub, A, IR(k-2,k), IR(0,k) ); Ones( *ASub, 2, k ); View( *ASub, A, IR(0,k), IR(k-2,k) ); Ones( *ASub, k, 2 ); View( *ASub, A, IR(0,k-2), IR(0,k-2) ); Diagonal( *ASub, d ); View( *ASub, A, IR(k,n), IR(0,k) ); Identity( *ASub, k, k ); View( *ASub, A, IR(k,n), IR(k,n) ); Identity( *ASub, k, k ); View( *ASub, A, IR(0,k), IR(k,n) ); Identity( *ASub, k, k ); }
static AValue TestC_ASub(AThread *t, AValue *frame) { return ASub(t, frame[0], frame[1]); }