intblas::IntervalVector Class Reference

This class represents a vector whose elements are intervals. More...

#include <IntBLAS.h>

Inheritance diagram for intblas::IntervalVector:

intblas::IntervalVectorT< d > List of all members.

Public Member Functions

 IntervalVector (unsigned int dimension, bool is_ir=false)
 This constructor creates a vector with the given dimension.
 IntervalVector (const IntervalVector &v)
 IntervalVector (double *l, double *u, int len)
 This constructs a vector from two vectors of type double, creating intervals of l and u.
 IntervalVector (int *l, int *u, int len)
 This constructs a vector from two vectors of type double, creating intervals of l and u.
 ~IntervalVector ()
 Standard destructor.
unsigned int getDimension () const
 This method returns the dimension of this vector.
Intervaloperator[] (int index) const
 This operator returns the interval of the element at the given index.
void operator= (const IntervalVector &v)
 This operator copies the value of v into this vector.
Interval getAt (unsigned int index) const
 This method returns the value of the interval at the given index.
void setAt (const Interval &v, unsigned int index)
 This method sets the element at index to the given value.
void swap (IntervalVector &b)
 This method swaps this vector with another efficiently.
bool isEmpty ()
 This method tells whether the vector contains an empty element.
IntervalVectorlowerBounds ()
 This method returns a vector whose elements are point intervals containing the lower bounds of this vector.
IntervalVectorupperBounds ()
 This method returns a vector whose elements are point intervals containing the upper bounds of this vector.
IntervalVectormidpoint ()
 This method returns a vector whose elements are point intervals containing the midpoints of this vector.
IntervalVectorwidths ()
 This method returns a vector whose elements are point intervals containing the widths of this vector.
IntervalVectoroperator+ (IntervalVector &b)
 This operator adds a vector to this vector.
IntervalVectoroperator+ (const Interval &scalar)
 This operator adds a vector and scalar value.
IntervalVectoroperator- (IntervalVector &b)
 This operator subtracts a vector from this vector.
IntervalVectoroperator- (const Interval &scalar)
 This operator subtracts a scalar value from this vector.
IntervalVectoroperator * (IntervalVector &b)
 This operator multiplies a vector to this vector.
IntervalVectoroperator * (const Interval &scalar)
 This operator multiplies a scalar to this vector.
Interval vectorSum ()
 The sum of all the elements of this vector.
Interval sumOfSquares ()
 The sum of all each element squared.
unsigned int max (double &result)
 This method finds the maximum magnitude and location of this vector.
unsigned int min (double &result)
 This method finds the minimum magnitude and location of this vector.
Interval dot (IntervalVector &b)
 This method returns the dot product of this vector and and another.
Interval scaledDot (IntervalVector &b, const Interval &r, double alpha=1.0, double beta=0.0)
 This method returns the dot product of this vector and and another.
IntervalVectorscaledAccumulation (IntervalVector &y, double alpha=1.0, double beta=1.0)
 This function performs a scaled vector accumulation using this vector.
IntervalVectorscaledCancelation (IntervalVector &y, double alpha=1.0, double beta=1.0)
 This function cancels the addition of y to the vector x.
IntervalVectorreciprocalScale (double alpha)
 This method implements the reciprocal scale of this interval vector.
double norm (NORMTYPE p)
 The norm of this vector.
void cancel (IntervalVector &y)
 This method cancels the addition of y to this vector.
IntervalVectorpermute (int p[])
 This function moves this vector's elements to the new addresses specified in p.
bool encloses (IntervalVector &y)
 This method test if each element in this vector encloses the corresponding element in y.
bool interior (IntervalVector &y)
 This method tests if each element in this vector contains the corresponding element in y.
bool disjoint (IntervalVector &y)
 This method tests if each element in this vector is disjoint with the corresponding element in y.
IntervalVectoroperator & (IntervalVector &y)
 This operator returns the intersection of this vector and another.
IntervalVectoroperator| (IntervalVector &y)
 This operator returns the union of this vector and another.
IntervalVectorintervalHull (IntervalVector &y)
 This method performs a convex interval hull on the elements of this vector and another.
IntervalVectorsolveLU (IntervalMatrix &lu, int p[])
 This function solves a system of equations using an LU matrix.

Static Public Member Functions

static void lowerBounds (IntervalVector &v, IntervalVector &result)
 This function returns a vector whose elements are point intervals containing the lower bounds of a vector.
static void upperBounds (IntervalVector &v, IntervalVector &result)
 This function returns a vector whose elements are point intervals containing the upper bounds of a vector.
static void midpoint (IntervalVector &v, IntervalVector &result)
 This function returns a vector whose elements are point intervals containing the midpoints of a vector.
static void widths (IntervalVector &v, IntervalVector &result)
 This function returns a vector whose elements are point intervals containing the widths of a vector.
static void add (IntervalVector &a, IntervalVector &b, IntervalVector &result)
 This method adds a vector to another.
static void add (IntervalVector &a, const Interval &scalar, IntervalVector &result)
 This operator adds a vector and scalar value.
static void sub (IntervalVector &a, IntervalVector &b, IntervalVector &result, bool right)
 This method subtracts a from b.
static void sub (IntervalVector &a, const Interval &scalar, IntervalVector &result, bool right)
 This method subtracts a scalar value from the vector.
static void mult (IntervalVector &a, IntervalVector &b, IntervalVector &result)
 This this multiplies a vector to another, and stores the result.
static void mult (IntervalVector &a, const Interval &scalar, IntervalVector &result)
 This operator multiplies a scalar to a vector.
static void scaledAccumulation (IntervalVector &x, IntervalVector &y, IntervalVector &result, double alpha=1.0, double beta=1.0)
 This function performs a scaled vector accumulation.
static void scaledCancelation (IntervalVector &x, IntervalVector &y, IntervalVector &result, double alpha=1.0, double beta=1.0)
 This function cancels the addition of y to the vector x.
static void reciprocalScale (IntervalVector &x, double alpha, IntervalVector &result)
 This method implements the reciprocal scale of an interval vector.
static void permute (IntervalVector &x, int p[], IntervalVector &result)
 This function moves the elements of x to the new addresses specified in p.
static void intervalIntersection (IntervalVector &x, IntervalVector &y, IntervalVector &result)
 This function returns the intersection of this vector and another.
static void intervalUnion (IntervalVector &x, IntervalVector &y, IntervalVector &result)
 This function returns the union of x and y.
static void intervalHull (IntervalVector &v, IntervalVector &y, IntervalVector &result)
 This function performs a convex interval hull on the elements of two vectors.
static IntervalVectorgetResult (IntervalVector *a, IntervalVector *b)
 This method returns an intermediary result vector.
static IntervalVectorgetResult (unsigned int dim)
 This method returns an intermediary result vector allocated off the heap and of the given dimension.
static void freeResult (IntervalVector *a, IntervalVector *b, IntervalVector &result)
 This method cleans up intermediary result vectors.
static void freeResult (IntervalVector *a)
 This method cleans up intermediary result vectors.

Protected Attributes

Intervala
 The array that stores the elements.
unsigned int dim
 The dimension of the vector.
unsigned int * dim_ptr
 This is a work around, ignore it.
bool ir

Friends

ostream & operator<< (ostream &out, const IntervalVector &v)
 This operator is a convenience operator for outputing vectors.
istream & operator>> (istream &in, IntervalVector &v)
 This operator reads a vector from the stream.
void swap (IntervalVector &a, IntervalVector &b)
 This method swaps two vectors efficiently.
bool isEmpty (IntervalVector &v)
 This function tells whether the vector contains an empty element.
IntervalVectorlowerBounds (IntervalVector &v)
 This function returns a vector whose elements are point intervals containing the lower bounds of a vector.
IntervalVectorupperBounds (IntervalVector &v)
 This function returns a vector whose elements are point intervals containing the upper bounds of a vector.
IntervalVectormidpoint (IntervalVector &v)
 This function returns a vector whose elements are point intervals containing the midpoints of a vector.
IntervalVectorwidths (IntervalVector &v)
 This function returns a vector whose elements are point intervals containing the widths of a vector.
IntervalVectoroperator+ (const Interval &scalar, IntervalVector &a)
 This operator adds a vector and scalar value.
IntervalVectoroperator- (const Interval &scalar, IntervalVector &a)
 This operator subtracts a scalar value from the vector.
IntervalVectoroperator * (const Interval &scalar, IntervalVector &a)
 This operator multiplies a scalar to a vector.
Interval dot (IntervalVector &a, IntervalVector &b)
 This function returns the dot product of a vector and and another.
Interval scaledDot (IntervalVector &a, IntervalVector &b, const Interval &r, double alpha=1.0, double beta=0.0)
 This function returns the dot product of a vector and and another.
IntervalVectorscaledAccumulation (IntervalVector &x, IntervalVector &y, double alpha=1.0, double beta=1.0)
 This function performs a scaled vector accumulation.
IntervalVectorscaledCancelation (IntervalVector &x, IntervalVector &y, double alpha=1.0, double beta=1.0)
 This function cancels the addition of y to the vector x.
IntervalVectorreciprocalScale (IntervalVector &x, double alpha)
 This funtion implements the reciprocal scale of an interval vector.
double norm (IntervalVector &a, NORMTYPE p)
 The norm of a vector.
IntervalVectorpermute (IntervalVector &x, int p[])
 This function moves the elements of x to the new addresses specified in p.
bool encloses (IntervalVector &v, IntervalVector &y)
 This function test if each element in v encloses the corresponding element in y.
bool interior (IntervalVector &v, IntervalVector &y)
 This function tests if each element in v contains the corresponding element in y.
bool disjoint (IntervalVector &v, IntervalVector &y)
 This function tests if each element in v is disjoint with the corresponding element in y.
IntervalVectorintervalIntersection (IntervalVector &x, IntervalVector &y)
 This function returns the intersection of this vector and another.
IntervalVectorintervalUnion (IntervalVector &x, IntervalVector &y)
 This function returns the union of x and y.
IntervalVectorintervalHull (IntervalVector &v, IntervalVector &y)
 This function performs a convex interval hull on the elements of two vectors.

Detailed Description

This class represents a vector whose elements are intervals.

Interval vectors can be treated similarly to a one-dimensional array. They are referenced using the bracket operator, e.g. the interval vector v's second element can be referenced like this, v[2]. The vectors are zero indexed which means the first element is at v[0].


Constructor & Destructor Documentation

intblas::IntervalVector::IntervalVector unsigned int  dimension,
bool  is_ir = false
 

This constructor creates a vector with the given dimension.

All the initial elements of the vector are set to [0.0,0.0].

Parameters:
dimension The dimension of the vector.
is_ir If true then this vector is an intermediary result vector.
Exceptions:
INTERVAL_EXCEPTION code = 290 msg = "Vector: out of memory." when = Allocation from heap fails.

intblas::IntervalVector::IntervalVector double *  l,
double *  u,
int  len
 

This constructs a vector from two vectors of type double, creating intervals of l and u.

For any given element in the vector l and u, the resulting element in this vector will be and interval whose bounds are l and u. The elements of l do not necessarily have to be less than u, the constructor creates proper intervals no matter what.

Parameters:
l A vector that contains one bound.
u A vector that contains one bound.
len The dimension of l and u.

intblas::IntervalVector::IntervalVector int *  l,
int *  u,
int  len
 

This constructs a vector from two vectors of type double, creating intervals of l and u.

For any given element in the vector l and u, the resulting element in this vector will be and interval whose bounds are l and u. The elements of l do not necessarily have to be less than u, the constructor creates proper intervals no matter what.

Parameters:
l A vector that contains one bound.
u A vector that contains one bound.
len The dimension of l and u.

intblas::IntervalVector::~IntervalVector  ) 
 

Standard destructor.


Member Function Documentation

void intblas::IntervalVector::add IntervalVector a,
const Interval scalar,
IntervalVector result
[static]
 

This operator adds a vector and scalar value.

Parameters:
a The vector to be added to.
scalar The value to add.
result Where to store the sum.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

void intblas::IntervalVector::add IntervalVector a,
IntervalVector b,
IntervalVector result
[static]
 

This method adds a vector to another.

Parameters:
a The vector to be added to.
b The vector to added to a vector.
result Where to store the sum.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

void intblas::IntervalVector::cancel IntervalVector y  ) 
 

This method cancels the addition of y to this vector.

Parameters:
y The vector to cancel.
See also:
scaledCancelation(), Interval::cancel()

bool intblas::IntervalVector::disjoint IntervalVector y  ) 
 

This method tests if each element in this vector is disjoint with the corresponding element in y.

Parameters:
y The vector to test against.
Returns:
True, if each element in y disjoint with the corresponding element in this vector.
See also:
Interval::disjoint()

Interval intblas::IntervalVector::dot IntervalVector b  ) 
 

This method returns the dot product of this vector and and another.

Parameters:
b The vector to dot product with.
Returns:
The dot product of this vector and b.
See also:
scaledDot()
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch."

bool intblas::IntervalVector::encloses IntervalVector y  ) 
 

This method test if each element in this vector encloses the corresponding element in y.

Parameters:
y The vector to test against.
Returns:
True, if each element encloses the corresponding element in y.
See also:
Interval::encloses()

void intblas::IntervalVector::freeResult IntervalVector a  )  [static]
 

This method cleans up intermediary result vectors.

The parameter a will be deleted given its ir attribute is true. This method is used when you know the operation required a new intermediary result vector or the result was not a vector, for example interior().

Parameters:
a A vector to check for deletion.

void intblas::IntervalVector::freeResult IntervalVector a,
IntervalVector b,
IntervalVector result
[static]
 

This method cleans up intermediary result vectors.

This method will delete a and b given that they are not the same memory as result, and their ir attribute is true.

Parameters:
a A vector to check for deletion.
b A vector to check for deletion.
result Used to make sure a or b was not recycled for the operations result vector.

Interval intblas::IntervalVector::getAt unsigned int  index  )  const
 

This method returns the value of the interval at the given index.

The indexes are zero based, i.e. The first element is [0].

Parameters:
index The zero based index of the element to retrieve.
Returns:
The value of the interval at index.

unsigned int intblas::IntervalVector::getDimension  )  const [inline]
 

This method returns the dimension of this vector.

Returns:
The value of IntervalVector::dim.

IntervalVector & intblas::IntervalVector::getResult unsigned int  dim  )  [static]
 

This method returns an intermediary result vector allocated off the heap and of the given dimension.

Parameters:
dim The dimension of the new vector.
Returns:
A new intermediary result vector.
Exceptions:
INTERVAL_EXCEPTION code = 290 msg = "Vector: out of memory."

IntervalVector & intblas::IntervalVector::getResult IntervalVector a,
IntervalVector b
[static]
 

This method returns an intermediary result vector.

The vector is returned may be a, b, or a new vector. The method will attempt to recycle a and b if it is possible. This behavior may be undisirable for operations that require a and b to remain unaltered, for example multiplication. The parameters, a and b, are only recycled if their attribute ir is true.

Parameters:
a A vector.
b A vector.
Returns:
An intermediary result vector, which may be a or b.
Exceptions:
INTERVAL_EXCEPTION code = 290 msg = "Vector: out of memory."
INTERVAL_EXCEPTION code = 291 msg = "Vector: could not create vector, a and b is null."

bool intblas::IntervalVector::interior IntervalVector y  ) 
 

This method tests if each element in this vector contains the corresponding element in y.

Parameters:
y The vector to test against.
Returns:
True, if each element in y is on the interior of this vector.
See also:
Interval::interior()

void intblas::IntervalVector::intervalHull IntervalVector v,
IntervalVector y,
IntervalVector result
[static]
 

This function performs a convex interval hull on the elements of two vectors.

Parameters:
v The vector to interval hull with.
y The vector to interval hull with.
result Where to store the convex interval hull of y and v.
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch."

IntervalVector & intblas::IntervalVector::intervalHull IntervalVector y  ) 
 

This method performs a convex interval hull on the elements of this vector and another.

Parameters:
y The vector to interval hull with.
Returns:
A vector whose elements are the convex interval hull of y and this vector.
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch."

void intblas::IntervalVector::intervalIntersection IntervalVector x,
IntervalVector y,
IntervalVector result
[static]
 

This function returns the intersection of this vector and another.

Parameters:
x A vector to intersect with.
y A vector to intersect with.
result Where to store the intersection of x and y.
See also:
Interval::operator&()
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch."

void intblas::IntervalVector::intervalUnion IntervalVector x,
IntervalVector y,
IntervalVector result
[static]
 

This function returns the union of x and y.

Parameters:
x A vector to union against.
y A vector to union with.
result Where to store the union of x and y.
See also:
Interval::operator|()
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch."
INTERVAL_EXCEPTION code = 13, msg = "Disjoint intervals in set operation."

bool intblas::IntervalVector::isEmpty  ) 
 

This method tells whether the vector contains an empty element.

Returns:
True, if at least one element in the vector is equal to cEMTPY.

void intblas::IntervalVector::lowerBounds IntervalVector v,
IntervalVector result
[static]
 

This function returns a vector whose elements are point intervals containing the lower bounds of a vector.

Parameters:
v The vector to get the bounds of.
result Where to store the answer.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch."

IntervalVector & intblas::IntervalVector::lowerBounds  ) 
 

This method returns a vector whose elements are point intervals containing the lower bounds of this vector.

Returns:
A vector of point intervals of the lower bounds of this vector.

unsigned int intblas::IntervalVector::max double &  result  ) 
 

This method finds the maximum magnitude and location of this vector.

The maximum magnitude is found by finding the maximum value of each element using max($|\underline{a}|$ , $|\overline{a}|$ ) as the comparison.

Parameters:
result This parameter will contain the maximum magnitude of this vector.
Returns:
The location of the maximum element.

void intblas::IntervalVector::midpoint IntervalVector v,
IntervalVector result
[static]
 

This function returns a vector whose elements are point intervals containing the midpoints of a vector.

Parameters:
v The vector to get the midpoints of.
result Where to store the answer.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch."

IntervalVector & intblas::IntervalVector::midpoint  ) 
 

This method returns a vector whose elements are point intervals containing the midpoints of this vector.

Returns:
A vector of point intervals of the midpoints of this vector.

unsigned int intblas::IntervalVector::min double &  result  ) 
 

This method finds the minimum magnitude and location of this vector.

The minimum magnitude is found by finding the minimum value of each element using min($|\underline{a}|$ , $|\overline{a}|$ ) as the comparison.

Parameters:
result This parameter will contain the minimum magnitude of this vector.
Returns:
The location of the minimum element.

void intblas::IntervalVector::mult IntervalVector a,
const Interval scalar,
IntervalVector result
[static]
 

This operator multiplies a scalar to a vector.

Parameters:
a The vector to multiply into the scalar.
scalar The value to multiply by a vector.
result Where to store the product.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

void intblas::IntervalVector::mult IntervalVector a,
IntervalVector b,
IntervalVector result
[static]
 

This this multiplies a vector to another, and stores the result.

Parameters:
a The vector to be multiplied to.
b The vector to multiply to a vector.
result Where to store the product.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

double intblas::IntervalVector::norm NORMTYPE  p  ) 
 

The norm of this vector.

Parameters:
p Either NORMTYPE::NORM1, NORMTYPE::NORM2, NORMTYPE::NORMINF.
Returns:
The norm of this vector.
Exceptions:
INTERVAL_EXCEPTION code = 204, msg = "Vector: Invalid normal type."

IntervalVector & intblas::IntervalVector::operator & IntervalVector y  ) 
 

This operator returns the intersection of this vector and another.

Parameters:
y The vector to intersect with.
Returns:
The intersection of y and this vector.
See also:
Interval::operator&()
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch."

IntervalVector & intblas::IntervalVector::operator * const Interval scalar  ) 
 

This operator multiplies a scalar to this vector.

Parameters:
scalar The value to multiply by this vector.
Returns:
The product of this vector and a scalar.

IntervalVector & intblas::IntervalVector::operator * IntervalVector b  ) 
 

This operator multiplies a vector to this vector.

Parameters:
b The vector to multiply by this vector.
Returns:
The product of this vector and b.

IntervalVector & intblas::IntervalVector::operator+ const Interval scalar  ) 
 

This operator adds a vector and scalar value.

Parameters:
scalar The value to add.
Returns:
A vector that has been added to scalar.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

IntervalVector & intblas::IntervalVector::operator+ IntervalVector b  ) 
 

This operator adds a vector to this vector.

Parameters:
b The vector to added to this vector.
Returns:
The sum of this vector and b.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

IntervalVector & intblas::IntervalVector::operator- const Interval scalar  ) 
 

This operator subtracts a scalar value from this vector.

Parameters:
scalar The value to subtract from this vector.
Returns:
The difference.

IntervalVector & intblas::IntervalVector::operator- IntervalVector b  ) 
 

This operator subtracts a vector from this vector.

Parameters:
b The vector to subtract from this vector.
Returns:
The difference of this vector and b.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

void intblas::IntervalVector::operator= const IntervalVector v  ) 
 

This operator copies the value of v into this vector.

Parameters:
v The vector to copy.

Interval & intblas::IntervalVector::operator[] int  index  )  const
 

This operator returns the interval of the element at the given index.

The indexes are zero based, i.e. The first element is [0].

Parameters:
index The zero based index of the element to retrieve.
Returns:
A reference to the interval at index.

IntervalVector & intblas::IntervalVector::operator| IntervalVector y  ) 
 

This operator returns the union of this vector and another.

Parameters:
y The vector to union with.
Returns:
The union of y and this vector.
See also:
Interval::operator|()
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch."
INTERVAL_EXCEPTION code = 13, msg = "Disjoint intervals in set operation."

void intblas::IntervalVector::permute IntervalVector x,
int  p[],
IntervalVector result
[static]
 

This function moves the elements of x to the new addresses specified in p.

Parameters:
x The vector to permute.
p[] The new addresses of the elements corresponding to each index.
result Where to store the permuted vector.

IntervalVector & intblas::IntervalVector::permute int  p[]  ) 
 

This function moves this vector's elements to the new addresses specified in p.

Parameters:
p[] The new addresses of the elements corresponding to each index.
Returns:
The permutated vector.

void intblas::IntervalVector::reciprocalScale IntervalVector x,
double  alpha,
IntervalVector result
[static]
 

This method implements the reciprocal scale of an interval vector.

The reciprocalScale is defined as

\[ {\bf x} / \alpha \]

Parameters:
x The vector to scale.
alpha The value to scale by.
result Where to store the quotiant.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

IntervalVector & intblas::IntervalVector::reciprocalScale double  alpha  ) 
 

This method implements the reciprocal scale of this interval vector.

The reciprocalScale is defined as

\[ {\bf x} / \alpha \]

Parameters:
alpha The value to scale by.
Returns:
The every element of x divided by alpha

void intblas::IntervalVector::scaledAccumulation IntervalVector x,
IntervalVector y,
IntervalVector result,
double  alpha = 1.0,
double  beta = 1.0
[static]
 

This function performs a scaled vector accumulation.

This operation is defined by

\[ \alpha*{\bf x}+\beta*{\bf y} \]

Parameters:
x A vector to accumulate with.
y A vector to accumulate with.
result Where to store the sum.
alpha A scaling factor (default 1.0).
beta A scaling factor (default 1.0).
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

IntervalVector & intblas::IntervalVector::scaledAccumulation IntervalVector y,
double  alpha = 1.0,
double  beta = 1.0
 

This function performs a scaled vector accumulation using this vector.

This operation is defined by

\[ (\alpha*{\bf this}) + (\beta*{\bf y}) \]

Parameters:
y A vector to accumulate with.
alpha A scaling factor (default 1.0).
beta A scaling factor (default 1.0).
Returns:
The sum of the scaled vectors.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

void intblas::IntervalVector::scaledCancelation IntervalVector x,
IntervalVector y,
IntervalVector result,
double  alpha = 1.0,
double  beta = 1.0
[static]
 

This function cancels the addition of y to the vector x.

Scaled cancellation is calculated in the following way:

\[ \alpha{\bf x}\ominus\beta{\bf y} \]

Parameters:
x The sum.
y The addend to cancel.
result Where to store the canceled vector.
alpha A scaling factor.
beta A scaling factor.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

IntervalVector & intblas::IntervalVector::scaledCancelation IntervalVector y,
double  alpha = 1.0,
double  beta = 1.0
 

This function cancels the addition of y to the vector x.

Scaled cancellation is calculated in the following way:

\[ \alpha{\bf this}\ominus\beta{\bf y} \]

Parameters:
y The addend to cancel.
alpha A scaling factor.
beta A scaling factor.
Returns:
The cancelation of y from x.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

Interval intblas::IntervalVector::scaledDot IntervalVector b,
const Interval r,
double  alpha = 1.0,
double  beta = 0.0
 

This method returns the dot product of this vector and and another.

The scaled vector is found using the following formula (where x is this vector):

\[ \beta{\bf r}+\alpha{\bf x}^{T}{\bf y} \]

Parameters:
b The vector to dot product with.
r A scalar to add to the result.
beta A scaling value
alpha A scaling value.
Returns:
The dot product of this vector and b.
See also:
scaledDot()
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch."

void intblas::IntervalVector::setAt const Interval v,
unsigned int  index
 

This method sets the element at index to the given value.

Parameters:
v The value to set the element to.
index The index of the element to set.

IntervalVector & intblas::IntervalVector::solveLU IntervalMatrix lu,
int  p[]
 

This function solves a system of equations using an LU matrix.

This function solves the equation ${\bf A}*x = b$ . You need the LU matrix found by lu(). You will now need a vector that represents b. The LU matrix is permutated, however, b must match the row order of the original A.

Parameters:
lu The LU matrix previously found by lu().
p The permutation array previously found by lu().
Returns:
The solution vector.
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch"
INTERVAL_EXCEPTION code = 303, msg = "Matrix: dimension mismatch"
See also:
IntervalMatrix::lu()

void intblas::IntervalVector::sub IntervalVector a,
const Interval scalar,
IntervalVector result,
bool  right
[static]
 

This method subtracts a scalar value from the vector.

Parameters:
a The vector to be subtracted from.
scalar The value to subtract from this vector.
result Where to store the difference.
right If true then a-scalar, otherwise scalar-a.
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch"

void intblas::IntervalVector::sub IntervalVector a,
IntervalVector b,
IntervalVector result,
bool  right
[static]
 

This method subtracts a from b.

Parameters:
a The vector to be subtracted from.
b The vector to subtract from this vector.
result Where to store the difference.
right If true then perform a-b, otherwise b-a.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

Interval intblas::IntervalVector::sumOfSquares  ) 
 

The sum of all each element squared.

Returns:
The sum of all each element squared.

void intblas::IntervalVector::swap IntervalVector b  ) 
 

This method swaps this vector with another efficiently.

This method reassigns the pointers IntervalVector::a to each other. This is markedly more efficient than the elementwise copy that would occur if you used the assignment operator.

Note:
This function will swap the the vector irrespective of their dimensions. Hence after swaping this vector will have b's dimension and visa versa.
Parameters:
b A vector to swap.

void intblas::IntervalVector::upperBounds IntervalVector v,
IntervalVector result
[static]
 

This function returns a vector whose elements are point intervals containing the upper bounds of a vector.

Parameters:
v The vector to get the bounds of.
result Where to store the answer.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch."

IntervalVector & intblas::IntervalVector::upperBounds  ) 
 

This method returns a vector whose elements are point intervals containing the upper bounds of this vector.

Returns:
A vector of point intervals of the upper bounds of this vector.

Interval intblas::IntervalVector::vectorSum  ) 
 

The sum of all the elements of this vector.

Returns:
The sum of all the elements of this vector.

void intblas::IntervalVector::widths IntervalVector v,
IntervalVector result
[static]
 

This function returns a vector whose elements are point intervals containing the widths of a vector.

Parameters:
v The vector to get the widths of.
result Where to store the answer.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch."

IntervalVector & intblas::IntervalVector::widths  ) 
 

This method returns a vector whose elements are point intervals containing the widths of this vector.

Returns:
A vector of point intervals of the widths of this vector.


Friends And Related Function Documentation

bool disjoint IntervalVector v,
IntervalVector y
[friend]
 

This function tests if each element in v is disjoint with the corresponding element in y.

Parameters:
v The vector to test with.
y The vector to test against.
Returns:
True, if each element in y disjoint with the corresponding element in v.
See also:
Interval::disjoint()

Interval dot IntervalVector a,
IntervalVector b
[friend]
 

This function returns the dot product of a vector and and another.

Parameters:
a The vector to take the dot product of.
b The vector to dot product with.
Returns:
The dot product of a and b.
See also:
scaledDot()
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch."

bool encloses IntervalVector v,
IntervalVector y
[friend]
 

This function test if each element in v encloses the corresponding element in y.

Parameters:
v The vector to test with.
y The vector to test against.
Returns:
True, if each element in v encloses the corresponding element in y.
See also:
Interval::encloses()

bool interior IntervalVector v,
IntervalVector y
[friend]
 

This function tests if each element in v contains the corresponding element in y.

Parameters:
v The vector to test with.
y The vector to test against.
Returns:
True, if each element in y is on the interior of v.
See also:
Interval::interior()

IntervalVector& intervalHull IntervalVector v,
IntervalVector y
[friend]
 

This function performs a convex interval hull on the elements of two vectors.

Parameters:
v The vector to interval hull with.
y The vector to interval hull with.
Returns:
A vector whose elements are the convex interval hull of y and v.
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch."

IntervalVector& intervalIntersection IntervalVector x,
IntervalVector y
[friend]
 

This function returns the intersection of this vector and another.

Parameters:
x A vector to intersect with.
y A vector to intersect with.
Returns:
The intersection of x and y.
See also:
Interval::operator&()
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch."

IntervalVector& intervalUnion IntervalVector x,
IntervalVector y
[friend]
 

This function returns the union of x and y.

Parameters:
x A vector to union against.
y A vector to union with.
Returns:
The union of x and y.
See also:
Interval::operator|()
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch."
INTERVAL_EXCEPTION code = 13, msg = "Disjoint intervals in set operation."

bool isEmpty IntervalVector v  )  [friend]
 

This function tells whether the vector contains an empty element.

Parameters:
v The vector to check.
Returns:
True, if at least one element in the vector is equal to cEMTPY.

IntervalVector& lowerBounds IntervalVector v  )  [friend]
 

This function returns a vector whose elements are point intervals containing the lower bounds of a vector.

Parameters:
v The vector to get the bounds of.
Returns:
A vector of point intervals of the lower bounds of v.

IntervalVector& midpoint IntervalVector v  )  [friend]
 

This function returns a vector whose elements are point intervals containing the midpoints of a vector.

Parameters:
v The vector to get the midpoints from.
Returns:
A vector of point intervals of the midpoints of v.

double norm IntervalVector a,
NORMTYPE  p
[friend]
 

The norm of a vector.

Parameters:
a The vector to find the norm of.
p Either NORMTYPE::NORM1, NORMTYPE::NORM2, NORMTYPE::NORMINF.
Returns:
The norm of a vector.
Exceptions:
INTERVAL_EXCEPTION code = 204, msg = "Vector: Invalid normal type."

IntervalVector& operator * const Interval scalar,
IntervalVector a
[friend]
 

This operator multiplies a scalar to a vector.

Parameters:
scalar The value to multiply by a vector.
a The vector to multiply into the scalar.
Returns:
The product of a vector and a scalar.

IntervalVector& operator+ const Interval scalar,
IntervalVector a
[friend]
 

This operator adds a vector and scalar value.

Parameters:
a The vector to be added to.
scalar The value to add.
Returns:
A vector that has been added to scalar.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

IntervalVector& operator- const Interval scalar,
IntervalVector a
[friend]
 

This operator subtracts a scalar value from the vector.

Parameters:
scalar The value to subtract from this vector.
a The vector to be subtracted from.
Returns:
The difference.

ostream& operator<< ostream &  out,
const IntervalVector v
[friend]
 

This operator is a convenience operator for outputing vectors.

The outputed vector will have the following format.

  • The vector will begin with a '{' followed by the first element.
  • Every element of the vector will be displayed on a new line.
  • The last element of the vector will by followed by a '}' and a new line.
    Parameters:
    out The output stream to write to.
    v The vector to output.
    Returns:
    A reference to out.

istream& operator>> istream &  in,
IntervalVector v
[friend]
 

This operator reads a vector from the stream.

If the read vector is of a different dimension than v, then v is resized to the read vector's dimension. The read vector must be formated as follows:

  • The vector must begin with a '{'.
  • The elements of the vector can be separated with a ';', a ',' or just white space.
  • The vector must end with a '}'.
    Parameters:
    in The input stream to read from.
    v The vector to place the result into.
    Returns:
    A reference to in.
    Exceptions:
    INTERVAL_EXCEPTION code = 520, msg = "IntervalVector I/O: Could not read a vector from the stream"
    See also:
    operator>>(istream& in, Interval& i)

IntervalVector& permute IntervalVector x,
int  p[]
[friend]
 

This function moves the elements of x to the new addresses specified in p.

Parameters:
x The vector to permute.
p[] The new addresses of the elements corresponding to each index.
Returns:
The permutated vector.

IntervalVector& reciprocalScale IntervalVector x,
double  alpha
[friend]
 

This funtion implements the reciprocal scale of an interval vector.

The reciprocalScale is defined as

\[ {\bf x} / \alpha \]

Parameters:
x The vector to scale.
alpha The value to scale by.
Returns:
The every element of x divided by alpha

IntervalVector& scaledAccumulation IntervalVector x,
IntervalVector y,
double  alpha = 1.0,
double  beta = 1.0
[friend]
 

This function performs a scaled vector accumulation.

This operation is defined by

\[ \alpha*{\bf x}+\beta*{\bf y} \]

Parameters:
x A vector to accumulate with.
y A vector to accumulate with.
alpha A scaling factor (default 1.0).
beta A scaling factor (default 1.0).
Returns:
The sum of the scaled vectors x and y.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

IntervalVector& scaledCancelation IntervalVector x,
IntervalVector y,
double  alpha = 1.0,
double  beta = 1.0
[friend]
 

This function cancels the addition of y to the vector x.

Scaled cancellation is calculated in the following way:

\[ \alpha{\bf x}\ominus\beta{\bf y} \]

Parameters:
x The sum.
y The addend to cancel.
alpha A scaling factor.
beta A scaling factor.
Returns:
The cancelation of y from x.
Exceptions:
INTERVAL_EXCEPTION code = 203 msg = "Vector: dimension mismatch"

Interval scaledDot IntervalVector a,
IntervalVector b,
const Interval r,
double  alpha = 1.0,
double  beta = 0.0
[friend]
 

This function returns the dot product of a vector and and another.

The scaled vector is found using the following formula:

\[ \beta{\bf r}+\alpha{\bf a}^{T}{\bf y} \]

Parameters:
a The vector to find the dot product of.
b The vector to dot product with.
r A scalar to add to the result.
beta A scaling value
alpha A scaling value.
Returns:
The dot product of this vector and b.
See also:
scaledDot()
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch."

void swap IntervalVector a,
IntervalVector b
[friend]
 

This method swaps two vectors efficiently.

This method reassigns the pointers IntervalVector::a to each other. This is markedly more efficient than the elementwise copy that would occur if you used the assignment operator.

Note:
This function will swap the the vector irrespective of their dimensions. Hence, after swaping a will have b's dimension and visa versa.
Parameters:
a A vector to swap.
b A vector to swap.

IntervalVector& upperBounds IntervalVector v  )  [friend]
 

This function returns a vector whose elements are point intervals containing the upper bounds of a vector.

Parameters:
v The vector to get the bounds of.
Returns:
A vector of point intervals of the upper bounds of v.

IntervalVector& widths IntervalVector v  )  [friend]
 

This function returns a vector whose elements are point intervals containing the widths of a vector.

Parameters:
v The vector to get the widths from.
Returns:
A vector of point intervals of the widths of v.


Member Data Documentation

Interval* intblas::IntervalVector::a [protected]
 

The array that stores the elements.

unsigned int intblas::IntervalVector::dim [protected]
 

The dimension of the vector.

unsigned int* intblas::IntervalVector::dim_ptr [protected]
 

This is a work around, ignore it.


Generated on Wed Apr 26 16:12:04 2006 for IntBLAS by  doxygen 1.4.4