Developer Documentation
RAVL, Recognition And Vision Library
USER HOME PAGE CLASS LIST CONTENTS
Ravl - Math - Linear Algebra - TVectorC<class DataT>
 

  PUBLIC
TVectorC::TVectorC(void)
TVectorC::TVectorC(const SArray1dC &)
TVectorC::TVectorC(const Slice1dC &,bool)
TVectorC::TVectorC(SizeT)
TVectorC::TVectorC(const TFVectorC &)
TVectorC::operator TFVectorC(void)
TVectorC::Sum(void) const
TVectorC::Product(void) const
TVectorC::SumOfSqr(void) const
TVectorC::SumOfAbs(void) const
TVectorC::MaxValue(void) const
TVectorC::MaxMagintude(void) const
TVectorC::MinValue(void) const
TVectorC::Reciprocal(void)
TVectorC::Modulus(void) const
TVectorC::TMul(const TVectorC &) const
TVectorC::Dot(const TVectorC &) const
TVectorC::SetSmallToBeZero(const DataT &)
TVectorC::OuterProduct(const TVectorC &) const
TVectorC::OuterProduct(const TVectorC &,RealT) const
TVectorC::OuterProduct(void) const
TVectorC::Unit(void) const
TVectorC::MakeUnit(void)
TVectorC::MaxIndex(void) const
TVectorC::MaxAbsIndex(void) const
SArray1dC::Copy(void) const
SArray1dC::Copy(UIntT) const
SArray1dC::CopyFrom(const Slice1dC &)
SArray1dC::operator =(const SArray1dC &)
SArray1dC::operator +(const SArray1dC &) const
SArray1dC::operator -(const SArray1dC &) const
SArray1dC::operator *(const SArray1dC &) const
SArray1dC::operator /(const SArray1dC &) const
SArray1dC::operator *(const DataT &) const
SArray1dC::operator /(const DataT &) const
SArray1dC::operator +(const DataT &) const
SArray1dC::operator -(const DataT &) const
SArray1dC::operator +=(const SArray1dC &)
SArray1dC::operator -=(const SArray1dC &)
SArray1dC::operator *=(const SArray1dC &)
SArray1dC::operator /=(const SArray1dC &)
SArray1dC::operator +=(const DataT &)
SArray1dC::operator -=(const DataT &)
SArray1dC::operator *=(const DataT &)
SArray1dC::operator /=(const DataT &)
SArray1dC::Sum(void) const
SArray1dC::SumSqr(void) const
SArray1dC::SArray1d(void) const
SArray1dC::SArray1d(void)
SArray1dC::Slice1d(void)
SArray1dC::Append(const SArray1dC &)
SArray1dC::Join(const SArray1dC &) const
SArray1dC::From(UIntT)
SArray1dC::From(UIntT,UIntT)
SArray1dC::After(UIntT)
SArray1dC::Buffer(void)
SArray1dC::Buffer(void) const
SArray1dC::Sort(void)
SArray1dC::operator ==(const SArray1dC &)
SArray1dC::Hash(void) const
SArray1dC::DataStart(void) const
SizeBufferAccessC::operator =(DataT *)
SizeBufferAccessC::DataStart(void) const
SizeBufferAccessC::Size(void) const
SizeBufferAccessC::Limits(void) const
SizeBufferAccessC::Range(void) const
SizeBufferAccessC::IMin(void) const
SizeBufferAccessC::IMax(void) const
SizeBufferAccessC::operator [](const IndexC) const
SizeBufferAccessC::operator [](const IndexC)
SizeBufferAccessC::SAccess(void) const
SizeBufferAccessC::IsEmpty(void) const
SizeBufferAccessC::Contains(IndexC) const
SizeBufferAccessC::ShrinkHigh(SizeT)
SizeBufferAccessC::Swap(SizeBufferAccessC &)
SizeBufferAccessC::Attach(const SizeBufferAccessC &)
SizeBufferAccessC::Attach(const BufferAccessC &,SizeT)
SizeBufferAccessC::operator +(SizeT) const
SizeBufferAccessC::Fill(const DataT &)
SizeBufferAccessC::CopyFrom(const SizeBufferAccessC &)
SizeBufferAccessC::Reverse(void)
SizeBufferAccessC::BufferFrom(UIntT)
SizeBufferAccessC::BufferFrom(UIntT,UIntT)
SizeBufferAccessC::operator ==(const SizeBufferAccessC &) const
SizeBufferAccessC::Copy(void) const
BufferAccessC::ReferenceElm(void) const
BufferAccessC::ReferenceVoid(void) const
BufferAccessC::IsValid(void) const
BufferAccessC::operator [](const IndexC) const
BufferAccessC::operator [](const IndexC)
BufferAccessC::operator +=(IndexC)
BufferAccessC::operator -=(IndexC)
BufferAccessC::operator -(IndexC) const
BufferAccessC::operator +(IndexC) const
BufferAccessC::operator ==(const BufferAccessC &) const
BufferAccessC::operator !=(const BufferAccessC &) const

   TVectorC<class DataT>   
 
Templated vectors.
 
include "Ravl/TVector.hh"
Created:10/09/1998 
Source file:Ravl/Math/LinearAlgebra/General/TVector.hh
User Level:Advanced
Library:RavlMath
In Scope:RavlN

Parent Classes: Derived Classes: Methods:
TVectorC()
Default constructor.

TVectorC(const SArray1dC<DataT> & oth)
Constructor for array of DataT's.

TVectorC(const Slice1dC<DataT> & oth,bool alwaysCopy = true)
Construct from a slice.

explicit TVectorC(SizeT n)
Constructor.

TVectorC(const TFVectorC<DataT,N> & dat)
Create from a fixed size vector.

operator TFVectorC<RealT,N>()
Convert to a fixed size vector.

DataT Sum() const
Returns the sum all elements of the vector.

DataT Product() const
Returns the product of all elements of the vector.

DataT SumOfSqr() const
Returns the sum of the squares of all the elements of the vector.

DataT SumOfAbs() const
Returns the sum of the absolute values of all the elements of the vector.

DataT MaxValue() const
Largest value in the array.

DataT MaxMagintude() const
Value of the largest magnitude in the vector.

DataT MinValue() const
Smalleset value in the array.

const TVectorC<DataT> & Reciprocal()
All elements of the vector are changed to their reciprocal values. It is assumed that all elements of the vector differs from zero.

DataT Modulus() const
Returns the modulus of the vector.
The Sqrt(SumOfSqr()).

DataT TMul(const TVectorC<DataT> & b) const
multiplication 'DataT' = (*this).T() * b

DataT Dot(const TVectorC<DataT> & v) const
scalar product of vectors

const TVectorC<DataT> & SetSmallToBeZero(const DataT & min)
Set values smaller than 'min' to zero in vector.

TMatrixC<DataT> OuterProduct(const TVectorC<DataT> & a) const
Calculate the outer product of this vector and a.
To use the function you must also include 'Ravl/Matrix.hh'.

TMatrixC<DataT> OuterProduct(const TVectorC<DataT> & a,RealT b) const
Calculate the outer product of this vector and a multiplied by b.
To use the function you must also include 'Ravl/Matrix.hh'.

TMatrixC<DataT> OuterProduct() const
Calculate the outer product of this vector with itself.
To use the function you must also include 'Ravl/Matrix.hh'.

TVectorC<DataT> Unit() const
Return a unit vector

const TVectorC<DataT> & MakeUnit()
Make this a unit vector.

IndexC MaxIndex() const
Find the index with the most positive valued index.

IndexC MaxAbsIndex() const
Find the index with the absolute maximum valued index.

Constructors, assigment, and destructor

#include "Ravl/SArray1d.hh"
SArray1dC<DataT> Copy() const
Creates a new physical copy of the array.

SArray1dC<DataT> Copy(UIntT extend) const
Creates a new physical copy of the array.
'extend' extra elements initalised by the default constuctor are appended to the end of the array.

void CopyFrom(const Slice1dC<DataT> & slice)
Copy contents of slice into array.
The first element of the slice is copied to element 0 of this array, second to 1 etc. If this array isn't large enough an exception is thrown.

const SArray1dC<DataT> & operator =(const SArray1dC<DataT> & vv)
Assign this handle to the data in VV.

SArray1dC<DataT> operator +(const SArray1dC<DataT> & arr) const
Sums 2 numerical arrays.
The operator returns the result as a new array.

SArray1dC<DataT> operator -(const SArray1dC<DataT> & arr) const
Subtract 2 numerical arrays.
The operator returns the result as a new array.

SArray1dC<DataT> operator *(const SArray1dC<DataT> & arr) const
Mutliplies 2 numerical arrays.
The operator returns the result as a new array.

SArray1dC<DataT> operator /(const SArray1dC<DataT> & arr) const
Divides 2 numerical arrays.
The operator returns the result as a new array.

SArray1dC<DataT> operator *(const DataT & number) const
Multiplys the array by the 'number'.
The operator returns the result as a new array.

SArray1dC<DataT> operator /(const DataT & number) const
Divides all array items by the 'number'.
The operator returns the result as a new array.

SArray1dC<DataT> operator +(const DataT & number) const
Adds 'number' to the array.
The operator returns the result as a new array.

SArray1dC<DataT> operator -(const DataT & number) const
Subtracts 'number' from all array items.
The operator returns the result as a new array.

const SArray1dC<DataT> & operator +=(const SArray1dC<DataT> & arr)
Adds the 2nd array to this array.

const SArray1dC<DataT> & operator -=(const SArray1dC<DataT> & arr)
Subtracts the 2nd array from this array.

const SArray1dC<DataT> & operator *=(const SArray1dC<DataT> & arr)
Multiplies the 2nd array to this array.

const SArray1dC<DataT> & operator /=(const SArray1dC<DataT> & arr)
Divides the 2nd array from this array.

const SArray1dC<DataT> & operator +=(const DataT & number)
Adds 'number' to all array items.

const SArray1dC<DataT> & operator -=(const DataT & number)
Subtracts 'number' from all array items.

const SArray1dC<DataT> & operator *=(const DataT & number)
Multiplies the array by the 'number'.

const SArray1dC<DataT> & operator /=(const DataT & number)
Divides the array elements by the 'number'.

DataT Sum() const
Calculate the sum of all elements in the array

DataT SumSqr() const
Calculate the sum of the squares of all elements in the array

Access to the object and its parts.
const SArray1dC<DataT> & SArray1d() const
Access to the whole constant array.

SArray1dC<DataT> & SArray1d()
Access to the whole array.

Slice1dC<DataT> Slice1d()
Access array as a slice.

Modifications of the representation
SArray1dC<DataT> & Append(const SArray1dC<DataT> & a)
This array is extended by the length of the array 'a' and the contents of both arrays are copied to it. Empty arrays are handled correctly.

SArray1dC<DataT> Join(const SArray1dC<DataT> & 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'.

SArray1dC<DataT> From(UIntT offset)
Return array from offset to the end of the array.
If offset is larger than the array an empty array is returned,

SArray1dC<DataT> From(UIntT offset,UIntT size)
Return array from offset to the end of the array.
If offset is larger than the array an empty array is returned,

SArray1dC<DataT> After(UIntT offset)
Return array after offset to the end of the array.
If offset is larger than the array an empty array is returned,

Special operations
BufferC<DataT> & Buffer()
Access base data buffer.
Experts only.

const BufferC<DataT> & Buffer() const
Constant access base data buffer.
Experts only.

void Sort()
Sort the array in place.
This does a simple bubble sort. FIXME:- we could do with something better!

bool operator ==(const SArray1dC<DataT> & vv)
Comparison operator
Returns true if the two arrays are the same length and their contents are identical.

UIntT Hash() const
Compute a hash value for the array.

DataT * DataStart() const
Returns the address of element 0.
If the array has zero length a null pointer may be returned.

#include "Ravl/SBfAcc.hh"
const SizeBufferAccessC<DataT> & operator =(DataT * bp)
Changes the reference element to the element pointed by 'bp'. Access to the object --------------------

DataT * DataStart() const
Returns the address of the first element of the buffer.

SizeT Size() const
Returns the number of elements of the array.

IndexRangeC Limits() const
Returns the usable range of indeces expressed by this object.

IndexRangeC Range() const
Returns the usable range of indeces expressed by this object.

IndexC IMin() const
Returns the minimum index of the range of this access.

IndexC IMax() const
Returns the maximum index of the range of this access.

const DataT & operator [](const IndexC i) const
Read-only access to the ('i'+1)-th element of the buffer.

DataT & operator [](const IndexC i)
Read-write access to the ('i'+1)-th element of the buffer.

const SizeBufferAccessC<DataT> & SAccess(void) const
Returns this object. Logical functions -----------------

bool IsEmpty() const
Returns TRUE if the size of the array is zero.

bool Contains(IndexC i) const
Returns TRUE if the array contains an item with the index 'i'. Modifications of the access ---------------------------

SizeT ShrinkHigh(SizeT k)
Changes the number of elements by subtracting the last 'k' elements.

const SizeBufferAccessC<DataT> & Swap(SizeBufferAccessC<DataT> & a)
Exchanges the contents of this buffer with buffer 'a'.

void Attach(const SizeBufferAccessC<DataT> & b)
Changes this buffer access to have the same access rights as 'b'.

void Attach(const BufferAccessC<DataT> & b,SizeT size)
Changes this buffer access to have the access rights as 'b' limited for 'size' elements.

SizeBufferAccessC<DataT> operator +(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 DataT & d)
'd' value is assigned to all elements of the buffer.

void CopyFrom(const SizeBufferAccessC<DataT> & oth)
Copy contents of another buffer into this one.
NB. Buffers MUST be the same length.

void Reverse()
Reverse the order of elements in this array in place.

SizeBufferAccessC<DataT> BufferFrom(UIntT first)
Get an access for this buffer starting from the 'first' element to the end of the buffer.

SizeBufferAccessC<DataT> BufferFrom(UIntT first,UIntT len)
Get an access for this buffer starting from the 'first' element for 'len' elements.
An error will be generated if the requested buffer isn't contains within this one.

bool operator ==(const SizeBufferAccessC<DataT> & ba) const
Are two accesses the same ?

SizeBufferAccessC<DataT> 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.

#include "Ravl/BufferAccess.hh"
DataT * ReferenceElm() 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() 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.

bool IsValid() const
Returns TRUE if this buffer access is not a default access object.

const DataT & operator [](const IndexC i) const
Read-only access to the ('i'+1)-th element of the buffer.

DataT & operator [](const IndexC i)
Read-write access to the ('i'+1)-th element of the buffer.

const BufferAccessC<DataT> & operator +=(IndexC ind)
Inplace Add index to start position.

const BufferAccessC<DataT> & operator -=(IndexC ind)
Inplace Subtract index from start position.

BufferAccessC<DataT> operator -(IndexC ind) const
Substract value from position, and return it as a new value.

BufferAccessC<DataT> operator +(IndexC ind) const
Substract value from position, and return it as a new value.

bool operator ==(const BufferAccessC<DataT> & ba) const
Are two accesses the same ?

bool operator !=(const BufferAccessC<DataT> & ba) const
Are two accesses the same ?


Maintainer:Charles Galambos, Created: 10/09/1998, Documentation by CxxDoc: Tue Aug 13 09:59:30 2002