Block<type> class public functions

Block
~Block
getSize
operator[]
operator=
operator+=
operator-=
operator*=
operator/=
operator+
operator-
operator*
operator/
zero

Block<type>(void);
Creates a Block with 0 size.
Block<type>(int blockSize);
Creates an array of blockSize. Contents are uninitialized; see the zero() function.
Block<type>(Block& aBlock);
Copies the size and contents of aBlock to create a new object.
Block<type>(const type *anArray, int arraySize);
Copies the given array size and contents when creating a new object.

~Block();
Deletes the internally stored array.

int getSize(void) const;
Returns the size of the Block.

type& operator[](int arrayIndex);
Array access to the block. Both for l-values and r-values. Error if array index is too large. Offset is from 0.

Block& operator=(const Block& aBlock);
Destroys the original contents of the object and copies the internal array of aBlock.

Block& operator+=(const Block& aBlock);
Block& operator-=(const Block& aBlock);
Block& operator*=(const Block& aBlock);
Block& operator/=(const Block& aBlock);
Element-wise arithmetic operators which modify the Block. The sizes of the two blocks must be equal.

Block operator+(const Block& aBlock) const;
Adds two blocks together element by element and returns a newly created block. The size of the two blocks being added must be equal.
Block operator+(type aNumber) const;
Adds a constant value to every element in a block and returns a newly created block with the results.

Block operator-(const Block& aBlock) const;
Subtracts two blocks from each other element by element and returns a newly created block with the result of the addition. The size of the two blocks being added must be equal.
Block operator-(void) const;
The unary - operator. Equivalent to multiplying each element by -1.
Block operator-(type aNumber) const;
Subtracts a constant value from every element in a block and returns a newly created block with the result of the subtraction.

Block operator*(const Block& aBlock) const;
Multiplies two blocks together element by element and returns a newly created block. The sizes of the two blocks being multiplied must be equal.
Block operator*(type aNumber) const;
Multiplies a constant value to every element in a block and returns a newly created block with the results.

Block operator*(const Block& aBlock) const;
Divides two blocks element by element and returns a newly created block. The sizes of the two blocks must be equal.

void zero(int minIndex = -1, int maxIndex = -1);
Zeros the specified range of values in the Block. Error if any index is out of range. Use minIndex = -1 if you want the zeroing to start at the beginning of the Block (or 0, of course). Use maxIndex = -1 if you want to zero to the end of the Block (or use getSize() - 1 ).