User Documentation
RAVL, Recognition And Vision Library
DEVELOP HOME PAGE CLASS LIST CONTENTS
Ravl - Math - Linear Algebra - VectorC
 

  PUBLIC
VectorC::VectorC(void)
VectorC::VectorC(UIntT)
VectorC::VectorC(const TVectorC &)
VectorC::VectorC(const SArray1dC &)
VectorC::VectorC(const Slice1dC &,bool)
VectorC::VectorC(const TFVectorC &)
VectorC::VectorC(RealT,RealT)
VectorC::VectorC(RealT,RealT,RealT)
VectorC::VectorC(RealT,RealT,RealT,RealT)
VectorC::VectorC(RealT,RealT,RealT,RealT,RealT)
VectorC::VectorC(RealT,RealT,RealT,RealT,RealT,RealT)
VectorC::IsReal(void) const
TVectorC::TVectorC(SizeT)
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
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

   VectorC   
 
Vector of real values.
 
include "Ravl/Vector.hh"
Created:24/01/2001 
User Level:Normal
Library:RavlMath
In Scope:RavlN

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

explicit VectorC(UIntT size)
Constructor.
Create a vector of 'size' elements

VectorC(const TVectorC<RealT> & oth)
Base class constructor.

VectorC(const SArray1dC<RealT> & oth)
Base class constructor.

VectorC(const Slice1dC<RealT> & oth,bool alwaysCopy = true)
Construct from a slice

VectorC(const TFVectorC<RealT,N> & dat)
Construct from a fixed size array.

VectorC(RealT v1,RealT v2)
Create a vector with two real values.

VectorC(RealT v1,RealT v2,RealT v3)
Create a vector with three real values.

VectorC(RealT v1,RealT v2,RealT v3,RealT v4)
Create a vector with four real values.

VectorC(RealT v1,RealT v2,RealT v3,RealT v4,RealT v5)
Create a vector with five real values.

VectorC(RealT v1,RealT v2,RealT v3,RealT v4,RealT v5,RealT v6)
Create a vector with six real values.

bool IsReal() const
Test if vector only contains real values.
This will return false if either nan's (Not an number) or infinite values are found.

#include "Ravl/TVector.hh"
explicit TVectorC(SizeT n)
Constructor.

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

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

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

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

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

RealT MaxValue() const
Largest value in the array.

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

RealT MinValue() const
Smalleset value in the array.

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

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

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

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

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

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

TMatrixC<RealT> OuterProduct(const TVectorC<RealT> & 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<RealT> OuterProduct() const
Calculate the outer product of this vector with itself.
To use the function you must also include 'Ravl/Matrix.hh'.

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

const TVectorC<RealT> & 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<RealT> Copy() const
Creates a new physical copy of the array.

SArray1dC<RealT> 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<RealT> & 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<RealT> & operator =(const SArray1dC<RealT> & vv)
Assign this handle to the data in VV.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Modifications of the representation
SArray1dC<RealT> & Append(const SArray1dC<RealT> & 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<RealT> Join(const SArray1dC<RealT> & 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<RealT> 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<RealT> 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<RealT> 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<RealT> & Buffer()
Access base data buffer.
Experts only.

const BufferC<RealT> & 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<RealT> & 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.

RealT * 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<RealT> & operator =(RealT * bp)
Changes the reference element to the element pointed by 'bp'. Access to the object --------------------

RealT * 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 RealT & operator [](const IndexC i) const
Read-only access to the ('i'+1)-th element of the buffer.

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

const SizeBufferAccessC<RealT> & 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<RealT> & Swap(SizeBufferAccessC<RealT> & a)
Exchanges the contents of this buffer with buffer 'a'.

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

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

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

void CopyFrom(const SizeBufferAccessC<RealT> & 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<RealT> BufferFrom(UIntT first)
Get an access for this buffer starting from the 'first' element to the end of the buffer.

SizeBufferAccessC<RealT> 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<RealT> & ba) const
Are two accesses the same ?

#include "Ravl/BufferAccess.hh"
RealT * 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 RealT & operator [](const IndexC i) const
Read-only access to the ('i'+1)-th element of the buffer.

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

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

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

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

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

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

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


Maintainer:Charles Galambos, Created: 24/01/2001, Documentation by CxxDoc: Tue Aug 13 09:59:02 2002