示例#1
0
void Fill( DistSparseMatrix<T>& A, T alpha )
{
    EL_DEBUG_CSE
    const Int m = A.Height();
    const Int n = A.Width();
    A.Resize( m, n );
    Zero( A );
    if( alpha != T(0) ) 
    {
        const Int localHeight = A.LocalHeight();
        A.Reserve( localHeight*n );
        for( Int iLoc=0; iLoc<localHeight; ++iLoc )
            for( Int j=0; j<n; ++j ) 
                A.QueueLocalUpdate( iLoc, j, alpha );
        A.ProcessLocalQueues();
    }
}
示例#2
0
void Zeros( DistSparseMatrix<T>& A, Int m, Int n )
{
    DEBUG_ONLY(CSE cse("Zeros"))
    A.Resize( m, n );
    Zero( A );
}