예제 #1
0
void
Matrix<T>::UpdateDiagonal( const Matrix<T>& d, Int offset )
{ 
#ifndef RELEASE
    CallStackEntry entry("Matrix::UpdateDiagonal");
    if( d.Height() != DiagonalLength(offset) || d.Width() != 1 )
        LogicError("d is not a column-vector of the right length");
#endif
    const Int diagLength = DiagonalLength(offset);
    if( offset >= 0 )
        for( Int j=0; j<diagLength; ++j )
            Set_( j, j+offset ) += d.Get(j,0);
    else
        for( Int j=0; j<diagLength; ++j )
            Set_( j-offset, j ) += d.Get(j,0);
}
예제 #2
0
void
Matrix<T>::Update( Int i, Int j, T alpha ) 
{
#ifndef RELEASE
    CallStackEntry entry("Matrix::Update");
    AssertValidEntry( i, j );
    if( Locked() )
        LogicError("Cannot modify data of locked matrices");
#endif
    Set_( i, j ) += alpha;
}
예제 #3
0
 const HiResTimer& HiResTimer::Mark() {
   Set_(sec1_, nsec1_);
   return *this;
 }
예제 #4
0
 void HiResTimer::Reset() {
   Set_(sec0_, nsec0_);
 }