From 44542adf023315d60a8ffc4863f2b161b3c1eb90 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 15 Apr 2013 23:45:48 -0600 Subject: Addition, subtraction, and multiplication work now Division isn't working yet, there are too many options, I'll figure out something eventually :-P --- src/packedintarray.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'src/packedintarray.cpp') diff --git a/src/packedintarray.cpp b/src/packedintarray.cpp index 817a7ab..7654356 100644 --- a/src/packedintarray.cpp +++ b/src/packedintarray.cpp @@ -41,11 +41,28 @@ PackedIntArray::PackedIntArray( PackedIntArray::Unit iBitWidth, int iCount ): uMask |= (1< 0 ) + iCount--; +} + PackedIntArray::Unit PackedIntArray::get( int idx ) const { int iStore = idx*iBitWidth/StoreBits; @@ -121,12 +144,12 @@ void PackedIntArray::checkCapacity() { if( iCount > iCapacity ) { - Bu::println("!!! Resizing !!!"); +// Bu::println("!!! Resizing !!!"); Store *aOldData = aData; int iNewSize = StoreCount(iCapacity*2); int iSize = StoreCount(iCapacity); - Bu::println(" %1 => %2 (%3 bit words)").arg( iSize ).arg( iNewSize ) - .arg( StoreBits ); +// Bu::println(" %1 => %2 (%3 bit words)").arg( iSize ).arg( iNewSize ) +// .arg( StoreBits ); aData = new Store[iNewSize]; memset( aData, 0, iNewSize*sizeof(Store) ); memcpy( aData, aOldData, iSize*sizeof(Store) ); -- cgit v1.2.3