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); }
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; }
const HiResTimer& HiResTimer::Mark() { Set_(sec1_, nsec1_); return *this; }
void HiResTimer::Reset() { Set_(sec0_, nsec0_); }