|
Developer Documentation |
|
Centre for Vision, Speech & Signal Processing |
Comments:
The class ShiftRegC adds some functions to the simple array type to
allow shifting of the array elements. It physically shifts the elements
rather than manipulating the indices; it is therefore suitable for
applications with a small shifting:access ratio.
The diagrams indicate the relationship between the register labelling and
the direction of data transfer through a 7-element
register for right and clockwise shifts:
.->-|0|1|2|3|4|5|6|->-.
-->-|0|1|2|3|4|5|6|->-- | |
`--<---------------<--'
right shift clockwise shift
Parent Classes:
Methods:
- ShiftRegC(const SizeT & dim)
-
Constructor: creates an uninitialized register with the range <0, 'dim'-1>.
- void ShiftR(const DataC ip)
-
"right shifts" register, attaching new element to position 0
- void ShiftL(const DataC ip)
-
"left shifts" register, attaching new element to position N-1
- void ShiftCW()
-
"clockwise" circular shift of elements, i.e. [0] -> [1] etc.
- void ShiftCCW()
-
"anticlockwise" circular shift of elements, i.e. [1] -> [0] etc.
- SArray1dC<DataC> Copy() const
-
Creates a new physical copy of the array.
- const SArray1dC<DataC> & operator=(const SArray1dC<DataC> & vv)
-
Assigment, as for a BIG_OBJECT.
Access to the object and its parts.
-----------------------------------
- const SArray1dC<DataC> & SArray1d() const
-
Access to the whole constant array.
- SArray1dC<DataC> & SArray1d()
-
Access to the whole array.
Modifications of the representation
-----------------------------------
- SArray1dC<DataC> Enlarge(const IntT factor = 2) const
-
Enlarges the array by item duplications. Every item is duplicated
'factor' times. The return array is extended by adding of higher
indexes.
- SArray1dC<DataC> & Append(const SArray1dC<DataC> & a)
-
This array is extended by the length of the array 'a' and the contents
of both arrays are copied to it. The function supports empty arrays.
- SArray1dC<DataC> Join(const SArray1dC<DataC> & Oth) const
-
Join this Array and another into a new Array which
is returned. This does not change either of its arguments.
This is placed in the array first, followed by 'Oth'.
Special operations
------------------
- void DebugAddresses() const
-
Prints addresses into 'cerrAMMA'.
- const BodyRefCounterC & RefCounter() const
-
Returns access to reference counter.
- BufferRC<DataC> & Buffer()
-
Access base data buffer.
Experts only.
- const BufferRC<DataC> & Buffer() const
-
Constant access base data buffer.
Experts only.
- DataC * DataStart() const
-
Returns the address of the first item if exists.
- const SizeBufferAccessC<DataC> & operator=(DataC * bp)
-
Changes the reference element to the element pointed by 'bp'.
Access to the object
--------------------
- DataC * ReferenceElm(void) const
-
Returns the pointer to the reference element of the attached buffer.
The reference element need not to be the valid element of the buffer.
- void * ReferenceVoid(void) const
-
Returns the pointer to the reference element of the attached buffer.
The reference element need not to be the valid element of the buffer.
The function is intended to be used in printing.
- const BufferAccessC<DataC> & Access(void) const
-
Returns this object.
- DataC * DataStart() const
-
Returns the address of the first element of the buffer.
- SizeT N() const
-
Returns the number of elements of the array.
- SizeT Size() const
-
Returns the number of elements of the array.
- const BufferSizeC & Limits() const
-
Returns the usable range of indeces expressed by this object.
- const BufferSizeC & Range() const
-
Returns the usable range of indeces expressed by this object.
- IndexT IMin() const
-
Returns the minimum index of the range of this access.
- IndexT IMax() const
-
Returns the maximum index of the range of this access.
- const DataC & operator[](const IndexT i) const
-
Read-only access to the ('i'+1)-th element of the buffer.
- DataC & operator[](const IndexT i)
-
Read-write access to the ('i'+1)-th element of the buffer.
- const SizeBufferAccessC<DataC> & SAccess(void) const
-
Returns this object.
Logical functions
-----------------
- BooleanT IsEmpty() const
-
Returns TRUE if the size of the array is zero.
- BooleanT Contains(const IndexT i) const
-
Returns TRUE if the array contains an item with the index 'i'.
Modifications of the access
---------------------------
- const BufferSizeC & ShrinkHigh(const SizeT k)
-
Changes the number of elements by subtracting the last 'k' elements.
- const SizeBufferAccessC<DataC> & Swap(SizeBufferAccessC<DataC> & a)
-
Exchanges the contents of this buffer with buffer 'a'.
- void Attach(const SizeBufferAccessC<DataC> & b)
-
Changes this buffer access to have the same access rights as 'b'.
- void Attach(const BufferAccessC<DataC> & b,const SizeT size)
-
Changes this buffer access to have the access rights as 'b' limited
for 'size' elements.
- SizeBufferAccessC<DataC> operator+(const SizeT i) const
-
Creates the new access object shifted 'i' elements to the right
(towards next elements). The size is descreased to fit the
the original range of this access.
Modifications of the buffer contents
------------------------------------
- void Fill(const DataC & d)
-
'd' value is assigned to all elements of the buffer.
- void CopyFrom(const SizeBufferAccessC<DataC> & oth)
-
Copy contents of another buffer into this one.
NB. Buffers MUST be the same length.
- SizeBufferAccessC<DataC> Copy(void) const
-
Returns a physical copy of this access pointing to the physical
copy of the accessed buffer in the range accessible by this access.
The new copy is necessary to attach to reference counted buffer
or to delete at the end of the life of this object.
|
Programmer:Bill Christmas, Documentation by CxxDoc: Tue Mar 20 10:49:27 2001
|