CDVectorBasic

Class Description

The CDVectorBasic class provides double-precision matrix/vector operations. It contains different basic vector operations.

Constructors/Destructor

CDVectorBasic (void)
Creates a vector instance, but does not initialize it.

CDVectorBasic
    (int length,
     double *storage = 0)
Creates a dynamically sized double-precision vector with length elements.

If storage is zero, new memory is allocated. If storage is not zero, use the memory pointed to by storage.

CDVectorBasic (const CDVectorBasic &vec)
Creates a vector instance with the number of elements and element values of vector vec.
 
Argument Description
length number of elements in vector
storage pointer to previously allocated memory
vec reference to a vector

~CDVectorBasic (void)
Destructor.

Top

Methods

Vector Manipulations 

CDVectorBasic::ElementDivide

void ElementDivide(const CDVectorBasic& vector)

Divide each element in the vector with the corresponding element of the input vector.
 
Argument Description
vector reference to the input vector

Top


CDVectorBasic::ElementMultiply

void ElementMultiply(const CDVectorBasic& vector)

Multiply each element in the vector with the corresponding element of the input vector.
 
Argument Description
vector reference to the input vector

Top
 

CDVectorBasic::Normalize2
void Normed2()

Normalize the vector to unit length, using the 2-norm.

Top
 

CDVectorBasic::Norm2
double Norm2()

Calculates the 2-norm of a vector

Top
 

CDVectorBasic::Pow
void Pow(double dP)

Take the power of each pixel
 
Argument Description
dP power

Top


CDVectorBasic::Sqr

void Sqr()

Square each element

Top


CDVectorBasic::Sqrt

double Sqrt()

Take the square root of each element

Top

Miscellaneous 

CDVectorBasic::ToString

void ToString(CString& strOut)

This function returns a string representing the vector.
 
Argument Description
strOut reference to the string

Overloaded Operators 

CDVectorBasic::operator=

CDVectorBasic& operator= (double value)
Assigns value to all elements of this vector.

CDVectorBasic& operator= (const CDVectorBasic& vec)
Copies the values of another vector to the corresponding elements of this vector.
 
Argument Description
value value to be assigned to this vector's elements
vec reference to vector with values to be copied


Copyright, 1999
Section for Image Analysis
Department of Mathematical Modelling
Technical University of Denmark
DK-2800 Lyngby

Authors: Rune Fisker

Last updated: 03-05-1999