intblas::IntervalMatrix Class Reference

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

#include <IntBLAS.h>

Inheritance diagram for intblas::IntervalMatrix:

intblas::IntervalMatrixT< r, c > List of all members.

Public Member Functions

 IntervalMatrix ()
 This method creates an empty matrix.
 IntervalMatrix (unsigned int n, unsigned int m, bool is_ir=false)
 Creates a matrix with the given number of rows and columns.
 IntervalMatrix (const IntervalMatrix &m)
 Copy construtor, note this is equivelent to assignment.
 IntervalMatrix (double **l, double **u, unsigned int rows, unsigned int cols)
 This constructs a matrix from two matrices of type double, creating intervals of l and u.
int getRows () const
 Returns the number of rows in a matrix.
int getCols () const
 Returns the number of columns in a matrix.
IntervalgetAt (unsigned int r, unsigned int c) const
 Returns a reference to the element at row r and column c.
void setAt (unsigned int r, unsigned int c, const Interval &i)
 Sets the value of the element at row r and column c to i.
IntervalMatrix getIdentity ()
 This method returns an identity matrix of the current size.
Intervaloperator[] (unsigned int index) const
 This operator returns a reference to the row of the matrix.
void operator= (const IntervalMatrix &b)
 Copies the values of the matrix b into this matrix.
bool operator== (const IntervalMatrix &b) const
 This operator tests element wise to see if this matrix and b are equivalent.
IntervalMatrixoperator+ (IntervalMatrix &b)
 This operator adds b to this matrix.
IntervalMatrixoperator+ (const Interval &scalar)
 This operator adds a scalar value to this matrix.
IntervalMatrixoperator- (IntervalMatrix &b)
 This operator subtracts b from this matrix.
IntervalMatrixoperator- (const Interval &scalar)
 This operator subtracts a scalar value from a.
IntervalMatrixoperator * (IntervalMatrix &b)
 This operator multiplies b to this matrix.
IntervalMatrixoperator * (const Interval &scalar)
 This operator multiplies the scalar by this matrix.
IntervalVectoroperator * (IntervalVector &v)
 This operator multiplies this matrix by a vector.
IntervalMatrixoperator- ()
 This operator takes the unary negation of the matrix.
IntervalMatrixtranspose ()
 Transpose the this matrix.
double norm (NORMTYPE n)
 This method calculates the norm of this matrix.
IntervalMatrixdiagonalScale (IntervalMatrix &d, bool side=true)
 This method multiplies a by the diagonal matrix d.
IntervalMatrixpermute (int p[])
 This method moves rows from their original index to the index proveded in p.
bool encloses (IntervalMatrix &y)
 Tests to see if the elements of this matrix enclose the elements of y.
bool interior (IntervalMatrix &y)
 Tests to see if the elements of y are on the interior of this matrix.
bool disjoint (IntervalMatrix &y)
 Tests to see if the elements of y are disjoint to the elements in this matrix.
IntervalMatrixoperator & (IntervalMatrix &y)
 This operator calculates the intersection of this matrix and y.
IntervalMatrixoperator| (IntervalMatrix &y)
 This operator calculates the union of this matrix and y.
IntervalMatrixintervalHull (IntervalMatrix &y)
 This method calculates the convex interval hull of this matrix and y.
bool isEmpty ()
 This method returns true if any element is the empty interval.
IntervalMatrixlowerBounds ()
 This method returns a matrix containing point intervals of the lower bound of each element.
IntervalMatrixupperBounds ()
 This method returns a matrix containing point intervals of the upper bound of each element.
IntervalMatrixmidpoint ()
 This method returns a matrix containing point intervals of the midpoint of each element.
IntervalMatrixwidths ()
 This method returns a matrix containing point intervals of the width of each element.
void lu (IntervalMatrix &lu, int *p)
 This method calculates the LU decomposition of this matrix based on the elements' midpoint.
IntervalVectorsolveLU (IntervalVector &b, int p[])
 This function solves a system of equations using an LU matrix.
IntervalMatrixinverse ()
 This function will invert this matrix based on the elements midpoints.
IntervalVectortoVector (int index, bool row=true)
 This returns a vector representing a row or column of this matrix.
void fromVector (IntervalVector &v, int index, bool row=true)
 This method copies the values of a vector into the given row or column.

Static Public Member Functions

static IntervalMatrix getIdentity (unsigned int rows, unsigned int cols)
static void add (const IntervalMatrix &a, const IntervalMatrix &b, IntervalMatrix &result)
 This function adds a to b and stores the sum in result.
static void add (const IntervalMatrix &a, const Interval &scalar, IntervalMatrix &result)
 This operator adds a scalar value to a matrix, and stores the sum in result.
static void sub (const IntervalMatrix &a, const IntervalMatrix &b, IntervalMatrix &result)
 This operator subtracts two matrices and stores the difference in result.
static void sub (IntervalMatrix &a, const Interval &scalar, IntervalMatrix &result, bool right=true)
 This method subtracts a scalar value from a, and stores the difference in result.
static void mult (IntervalMatrix &a, IntervalMatrix &b, IntervalMatrix &result)
 This method mutliplys a by b, and stores the product in result.
static void mult (IntervalMatrix &a, const Interval &scalar, IntervalMatrix &result)
 This method multiplies a matrix by the scalar, and stores the product in result.
static void mult (IntervalMatrix &a, IntervalVector &v, IntervalVector &result, bool right)
 This method multiplies a matrix by a vector, storing the product in result.
static void neg (IntervalMatrix &a, IntervalMatrix &result)
 This function takes the negation of the matrix.
static void transpose (IntervalMatrix &a, IntervalMatrix &result)
 Transpose the matrix a and store the result.
static void diagonalScale (IntervalMatrix &a, IntervalMatrix &d, IntervalMatrix &result, bool side=true)
 This function multiplies a by the diagonal matrix d.
static void diagonalScale (IntervalMatrix &a, IntervalMatrix &b, IntervalMatrix &d, IntervalMatrix &result)
 This function multiplies b by the diagonal matrix d, and adds the result to a.
static void diagonalScale2 (IntervalMatrix &a, IntervalMatrix &d1, IntervalMatrix &d2, IntervalMatrix &result)
 This function efficiently performs two sided diagonal scaling on a matrix.
static void triangularMult (IntervalMatrix &a, IntervalMatrix &t, IntervalMatrix &result, const Interval &alpha=IntervalMatrix::one, TRIMAT_TYPE tt=LTR_TOP, bool side=false)
 This function efficently multiplies a matrix against a square triangular matrix of the same dimension.
static void scaledAccumulation (IntervalMatrix &a, IntervalMatrix &b, IntervalMatrix &result, const Interval &alpha=IntervalMatrix::one, const Interval &beta=IntervalMatrix::one)
 This function is provided to efficiently calculate the accumulate and scale formula.
static void accTranspose (IntervalMatrix &a, IntervalMatrix &b, IntervalMatrix &result, const Interval &alpha=IntervalMatrix::one, const Interval &beta=IntervalMatrix::one)
 This function is provided to efficiently calculate an accumulate and scale formula.
static void scaledVectorMult (IntervalMatrix &a, IntervalVector &x, IntervalVector &y, IntervalVector &result, const Interval &alpha=IntervalMatrix::one, const Interval &beta=IntervalMatrix::one, bool transpose_a=false)
 This function performs scaled vector multiplication.
static void scaledMatrixMult (IntervalMatrix &a, IntervalMatrix &b, IntervalMatrix &c, IntervalMatrix &result, bool a_transpose=false, bool b_transpose=false, const Interval &alpha=IntervalMatrix::one, const Interval &beta=IntervalMatrix::one)
 This function performs multiple scaled matrix multiplication formulas.
static void rankOneUpdate (IntervalMatrix &a, IntervalVector &x, IntervalVector &y, IntervalMatrix &result, const Interval &alpha=IntervalMatrix::one, const Interval &beta=IntervalMatrix::one)
 This function performs a rank one update on matrix a.
static void permute (IntervalMatrix &a, IntervalMatrix &result, int p[])
 This function moves rows from their original index to the index proveded in p.
static void intervalIntersection (IntervalMatrix &v, IntervalMatrix &y, IntervalMatrix &result)
 This method calculates the intersection of this matrix v and y and stores the result.
static void intervalUnion (IntervalMatrix &v, IntervalMatrix &y, IntervalMatrix &result)
 This operator calculates the union of v and y.
static void intervalHull (IntervalMatrix &v, IntervalMatrix &y, IntervalMatrix &result)
 This function calculates the convex interval hull of v and y, and stores the result.
static void lowerBounds (IntervalMatrix &v, IntervalMatrix &result)
 This function returns a matrix containing point intervals of the lower bound of each element.
static void upperBounds (IntervalMatrix &v, IntervalMatrix &result)
 This function returns a matrix containing point intervals of the upper bound of each element.
static void midpoint (IntervalMatrix &v, IntervalMatrix &result)
 This function returns a matrix containing point intervals of the midpoint of each element.
static void widths (IntervalMatrix &v, IntervalMatrix &result)
 This function returns a matrix containing point intervals of the width of each element.
static void lu (IntervalMatrix &a, IntervalMatrix &lu, int *p)
static void solveLU (IntervalVector &b, IntervalMatrix &lu, int p[], IntervalVector &result)
 This function solves a system of equations using an LU matrix.
static void inverse (IntervalMatrix &a, IntervalMatrix &result)
 This function will invert a matrix based on the elements midpoints.
static IntervalMatrixgetResult (IntervalMatrix *a, IntervalMatrix *b, bool force_new=false)
 This method returns an intermediary result matrix.
static void freeResult (IntervalMatrix *a, IntervalMatrix *b, IntervalMatrix &r)
 This method cleans up intermediary result matrices.
static void freeResult (IntervalMatrix *a, IntervalMatrix *b=NULL)
 This method cleans up intermediary result matrices.

Static Public Attributes

static const Interval one

Protected Member Functions

void alloc (unsigned int rows, unsigned int cols)
 This method correctly and efficiently allocates the underlying array.

Protected Attributes

Interval ** a
 The array that stores the elements.
unsigned int m_cols
 The number of columns.
unsigned int m_rows
 The number of rows.
bool ir
 True if this object is an intermediary result.
Interval *** a_ptr
 Work around, ignore it.
Intervalabase

Friends

IntervalMatrix getIdentity (unsigned int rows, unsigned int cols)
 This function returns an identity matrix of the size rows x cols.
void swap (IntervalMatrix &a, IntervalMatrix &b)
 This function efficiently swaps two matrices.
ostream & operator<< (ostream &out, const IntervalMatrix &mat)
 This is a convenience operator for outputing the matrix as a string.
istream & operator>> (istream &in, IntervalMatrix &m)
 This operator reads a matrix from an input stream The matrix must be formated as folows:
  • The matrix must begin and end with a '|' character
  • The elements can be seperated by spaces or commas.

IntervalMatrixoperator+ (const Interval &scalar, IntervalMatrix &a)
IntervalMatrixoperator- (const Interval &scalar, IntervalMatrix &a)
 This operator subtracts a scalar value from a.
IntervalMatrixoperator * (const Interval &scalar, IntervalMatrix &a)
 This operator multiplies the scalar by matrix a.
IntervalVectoroperator * (IntervalVector &v, IntervalMatrix &a)
 This operator multiplies this matrix by a vector.
IntervalMatrixneg (IntervalMatrix &a)
 This function takes the negation of the matrix.
IntervalMatrixtranspose (IntervalMatrix &a)
 Transpose the matrix a.
double norm (IntervalMatrix &a, NORMTYPE n)
 This function calculates the norm of matrix a.
IntervalMatrixdiagonalScale (IntervalMatrix &a, IntervalMatrix &d, bool side=true)
 This function multiplies a by the diagonal matrix d.
IntervalMatrixdiagonalScale (IntervalMatrix &a, IntervalMatrix &b, IntervalMatrix &d)
 This function multiplies b by the diagonal matrix d, and adds the result to a.
IntervalMatrixdiagonalScale2 (IntervalMatrix &a, IntervalMatrix &d1, IntervalMatrix &d2)
 This function efficiently performs two sided diagonal scaling on a matrix.
IntervalMatrixtriangularMult (IntervalMatrix &a, IntervalMatrix &t, const Interval &alpha=IntervalMatrix::one, TRIMAT_TYPE tt=LTR_TOP, bool side=false)
 This function efficently multiplies a matrix against a square triangular matrix of the same dimension.
IntervalMatrixscaledAccumulation (IntervalMatrix &a, IntervalMatrix &b, const Interval &alpha=IntervalMatrix::one, const Interval &beta=IntervalMatrix::one)
 This function is provided to efficiently calculate an accumulate and scale formula.
IntervalMatrixaccTranspose (IntervalMatrix &a, IntervalMatrix &b, const Interval &alpha=IntervalMatrix::one, const Interval &beta=IntervalMatrix::one)
 This function is provided to efficiently calculate an accumulate and scale formula.
IntervalVectorscaledVectorMult (IntervalMatrix &a, IntervalVector &x, IntervalVector &y, const Interval &alpha=IntervalMatrix::one, const Interval &beta=IntervalMatrix::one, bool transpose_a=false)
 This function performs scaled vector multiplication.
IntervalMatrixscaledMatrixMult (IntervalMatrix &a, IntervalMatrix &b, IntervalMatrix &c, bool a_transpose=false, bool b_transpose=false, const Interval &alpha=IntervalMatrix::one, const Interval &beta=IntervalMatrix::one)
 This function performs multiple scaled matrix multiplication formulas.
IntervalMatrixrankOneUpdate (IntervalMatrix &a, IntervalVector &x, IntervalVector &y, const Interval &alpha=IntervalMatrix::one, const Interval &beta=IntervalMatrix::one)
 This function performs a rank one update on matrix a.
IntervalMatrixpermute (IntervalMatrix &a, int p[])
 This function moves rows from their original index to the index proveded in p.
bool encloses (IntervalMatrix &v, IntervalMatrix &y)
 Tests to see if the elements of v enclose the elements of y.
bool interior (IntervalMatrix &v, IntervalMatrix &y)
 Tests to see if the elements of y are on the interior of v.
bool disjoint (IntervalMatrix &v, IntervalMatrix &y)
 Tests to see if the elements of y are disjoint to the elements of v.
IntervalMatrixintervalIntersection (IntervalMatrix &v, IntervalMatrix &y)
 This method calculates the intersection of this matrix v and y.
IntervalMatrixintervalUnion (IntervalMatrix &v, IntervalMatrix &y)
 This operator calculates the union of v and y.
IntervalMatrixintervalHull (IntervalMatrix &v, IntervalMatrix &y)
 This function calculates the convex interval hull of v and y.
bool isEmpty (IntervalMatrix &v)
 This method returns true if any element is the empty interval.
IntervalMatrixlowerBounds (IntervalMatrix &v)
 This function returns a matrix containing point intervals of the lower bound of each element.
IntervalMatrixupperBounds (IntervalMatrix &v)
 This function returns a matrix containing point intervals of the upper bound of each element.
IntervalMatrixmidpoint (IntervalMatrix &v)
 This function returns a matrix containing point intervals of the midpoint of each element.
IntervalMatrixwidths (IntervalMatrix &v)
 This function returns a matrix containing point intervals of the width of each element.
void lu (IntervalMatrix &a, IntervalMatrix &lu, int *p)
 This method calculates the LU decomposition of this matrix based on the elements' midpoint.
IntervalVectorsolveLU (IntervalVector &b, IntervalMatrix &lu, int p[])
 This function solves a system of equations using an LU matrix.
IntervalMatrixinverse (IntervalMatrix &a)
 This function will invert a matrix based on the elements midpoints.

Detailed Description

This class represents a matrix whose elements are intervals.

Interval matrices can be treated similarly to a two-dimensional array. They are referenced in row major order, e.g. the interval matrix m's element at the second row third column can be referenced like this, m[2][3]. The matrices are zero indexed which means the first element is at m[0][0].


Constructor & Destructor Documentation

intblas::IntervalMatrix::IntervalMatrix  )  [inline]
 

This method creates an empty matrix.

Empty matrices are only suitable for having other matrices assigned to them.

intblas::IntervalMatrix::IntervalMatrix unsigned int  rows,
unsigned int  cols,
bool  is_ir = false
 

Creates a matrix with the given number of rows and columns.

Matrices with rows and columns are called non-empty. All the elements of the matrix are initialized to [0.0,0.0].

Parameters:
rows The number of rows in the matrix.
cols The number of columns in the matrix.
is_ir If this prameter is true then the object is an intermediary result.
Exceptions:
INTERVAL_EXCEPTION code = 390, msg = "Matrix: Out of memory.", when = Allocation from the heap fails.

intblas::IntervalMatrix::IntervalMatrix const IntervalMatrix m  ) 
 

Copy construtor, note this is equivelent to assignment.

Parameters:
m What to assign to this matrix.

intblas::IntervalMatrix::IntervalMatrix double **  l,
double **  u,
unsigned int  rows,
unsigned int  cols
 

This constructs a matrix from two matrices of type double, creating intervals of l and u.

For any given row in the matrices l and u, the resulting element in this matrix 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 matrix that contains one bound.
u A matrix that contains one bound.
rows The number of rows in l and u.
cols The number of columns in l and u.


Member Function Documentation

void intblas::IntervalMatrix::accTranspose IntervalMatrix a,
IntervalMatrix b,
IntervalMatrix result,
const Interval alpha = IntervalMatrix::one,
const Interval beta = IntervalMatrix::one
[static]
 

This function is provided to efficiently calculate an accumulate and scale formula.

This method calculates the formula:

\[ \alpha*{\bf A}^{T} + \beta*{\bf B} \]

Parameters:
a The A matrix in the formula.
b The B matrix in the formula.
result The result of this calculation.
alpha The $\alpha$ in the formula.
beta The $\beta$ in the formula.
Returns:
The scaled accumulation.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
INTERVAL_EXCEPTION code = 303, msg = "Matrix: this operation is only valid on square matrices."

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

This operator adds a scalar value to a matrix, and stores the sum in result.

Parameters:
a The matrix to add the scalar to.
scalar The value add to the matrix.
result Where to store the sum.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

void intblas::IntervalMatrix::add const IntervalMatrix a,
const IntervalMatrix b,
IntervalMatrix result
[static]
 

This function adds a to b and stores the sum in result.

Note this function does not allocate new memory so a, b, and result must all be of the same dimensions.

Parameters:
a A matrix to add with.
b A matrix to add with.
result Where to place the resulting sum.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

void intblas::IntervalMatrix::alloc unsigned int  rows,
unsigned int  cols
[protected]
 

This method correctly and efficiently allocates the underlying array.

Parameters:
rows the number of rows in the matrix.
cols the number of columns in the matrix.

void intblas::IntervalMatrix::diagonalScale IntervalMatrix a,
IntervalMatrix b,
IntervalMatrix d,
IntervalMatrix result
[static]
 

This function multiplies b by the diagonal matrix d, and adds the result to a.

This function is faster than using the * operator. This function calculates the following formula:

\[ A + BD \]

Parameters:
a The scaling matrix to add by.
b The matrix to multiply into.
d The diagonal matrix to multiply a by.
result Where to store the diagonally scaled matrix.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

void intblas::IntervalMatrix::diagonalScale IntervalMatrix a,
IntervalMatrix d,
IntervalMatrix result,
bool  side = true
[static]
 

This function multiplies a by the diagonal matrix d.

This function is faster than using the * operator.

Parameters:
a The matrix to multiply into.
d The diagonal matrix to multiply a by.
result Where to store the result.
side False for d*a, or True for a*d.
Returns:
The diagonally scaled matrix.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
INTERVAL_EXCEPTION code = 304, msg = "Matrix: the side parameter must be 1 or 2."

IntervalMatrix & intblas::IntervalMatrix::diagonalScale IntervalMatrix d,
bool  side = true
 

This method multiplies a by the diagonal matrix d.

This method is faster than using the * operator.

Parameters:
d The diagonal matrix to multiply a by.
side False for d*a, or True for a*d.
Returns:
The diagonally scaled matrix.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
INTERVAL_EXCEPTION code = 304, msg = "Matrix: the side parameter must be 1 or 2."

void intblas::IntervalMatrix::diagonalScale2 IntervalMatrix a,
IntervalMatrix d1,
IntervalMatrix d2,
IntervalMatrix result
[static]
 

This function efficiently performs two sided diagonal scaling on a matrix.

This function implments the formula:

\[ \bf{D_{1} A D_{2}} \]

Parameters:
a The matrix to scale.
result The matrix to store the result in.
d1 The first scaling matrix.
d2 The second scaling matrix.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
INTERVAL_EXCEPTION code = 303, msg = "Matrix: the operation is only valid on square matrices."

bool intblas::IntervalMatrix::disjoint IntervalMatrix y  ) 
 

Tests to see if the elements of y are disjoint to the elements in this matrix.

The comparison is done element wise, i.e. this->a[i][j].disjoint( y[i][j] ).

Parameters:
y The matrix to test against.
Returns:
True, if every element in y is disjoint this matrix.
See also:
Interval::disjoint()

bool intblas::IntervalMatrix::encloses IntervalMatrix y  ) 
 

Tests to see if the elements of this matrix enclose the elements of y.

The comparison is done element wise, i.e. this->a[i][j].encloses( y[i][j] ).

Parameters:
y The matrix to test against.
Returns:
True, if every element at this->a[i][j] encloses the element y[i][j].
See also:
Interval::encloses

void intblas::IntervalMatrix::freeResult IntervalMatrix a,
IntervalMatrix b = NULL
[static]
 

This method cleans up intermediary result matrices.

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

Parameters:
a A matrix to check for deletion.
b A matrix to check for deletion.

void intblas::IntervalMatrix::freeResult IntervalMatrix a,
IntervalMatrix b,
IntervalMatrix r
[static]
 

This method cleans up intermediary result matrices.

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 matrix to check for deletion.
b A matrix to check for deletion.
r Used to make sure a or b was not recycled for the operations result matrix.

void intblas::IntervalMatrix::fromVector IntervalVector v,
int  index,
bool  row = true
 

This method copies the values of a vector into the given row or column.

Parameters:
v The vector to copy.
index The index of the row or column to copy into.
row If true then the vector is a row, Otherwise the vector is a column.
Exceptions:
INTERVAL_EXCEPTION code = 202, msg = "Vector: index out of range"
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch"

Interval& intblas::IntervalMatrix::getAt unsigned int  r,
unsigned int  c
const [inline]
 

Returns a reference to the element at row r and column c.

This method is identical to IntervalMatrix::operator[](). It exists to make using IntervalMatrix pointers easier.

Parameters:
r The row location of the element
c The column location of the element.
Returns:
The element at the given row and column.

int intblas::IntervalMatrix::getCols  )  const [inline]
 

Returns the number of columns in a matrix.

Returns:
The value of m_cols.

IntervalMatrix intblas::IntervalMatrix::getIdentity  ) 
 

This method returns an identity matrix of the current size.

Returns:
Identity matrix m_rows x m_cols.
Exceptions:
INTERVAL_EXCEPTION code = 303, msg = "Matrix: this operation is only valid on square matrices."

IntervalMatrix & intblas::IntervalMatrix::getResult IntervalMatrix a,
IntervalMatrix b,
bool  force_new = false
[static]
 

This method returns an intermediary result matrix.

The matrix that is returned may be a, b, or a new matrix. 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 matrix.
b A matrix.
force_new If true, the method should not attempt to recycle a or b.
Returns:
An intermediary result matrix, which may be a or b.
Exceptions:
INTERVAL_EXCEPTION code = 390 msg = "Vector: out of memory."
INTERVAL_EXCEPTION code = 391 msg = "Vector: could not create matrix, a and b is null."

int intblas::IntervalMatrix::getRows  )  const [inline]
 

Returns the number of rows in a matrix.

Returns:
The value of m_rows.

bool intblas::IntervalMatrix::interior IntervalMatrix y  ) 
 

Tests to see if the elements of y are on the interior of this matrix.

The comparison is done element wise, i.e. this->a[i][j].interior( y[i][j] ).

Parameters:
y The matrix to test against.
Returns:
True, if every element at y[i][j] in on the interior of this->a[i][j].
See also:
Interval::interior()

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

This function calculates the convex interval hull of v and y, and stores the result.

This is done element wise, i.e. v[i][j].hull( y[i][j] ).

Parameters:
v The matrix to interval hull with.
y The matrix to interval hull with.
result Where to store the convex interval hull.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
See also:
Interval::hull()

IntervalMatrix & intblas::IntervalMatrix::intervalHull IntervalMatrix y  ) 
 

This method calculates the convex interval hull of this matrix and y.

This is done element wise, i.e. this->a[i][j].hull( y[i][j] ).

Parameters:
y The matrix to interval hull with.
Returns:
The convex interval hull of this matrix and y.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
See also:
Interval::hull()

void intblas::IntervalMatrix::intervalIntersection IntervalMatrix v,
IntervalMatrix y,
IntervalMatrix result
[static]
 

This method calculates the intersection of this matrix v and y and stores the result.

This is done element wise, i.e. v[i][j] & y[i][j].

Parameters:
v The matrix to intersect against.
y The matrix to intersect with.
result Where to store the intersection.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
See also:
Interval::operator&()

void intblas::IntervalMatrix::intervalUnion IntervalMatrix v,
IntervalMatrix y,
IntervalMatrix result
[static]
 

This operator calculates the union of v and y.

This is done element wise, i.e. v[i][j] & y[i][j].

Parameters:
v The matrix to union with.
y The matrix to union with.
result Where to store the union.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
See also:
Interval::operator|()

void intblas::IntervalMatrix::inverse IntervalMatrix a,
IntervalMatrix result
[static]
 

This function will invert a matrix based on the elements midpoints.

This function uses midpoint LU decomposition to solve for the inverse. For reasons why to use this function as opposed to inverse(), see the documentation for intervalLU().

Parameters:
a The matrix to invert, it must be a square matrix.
result Where to store the inverse.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
INTERVAL_EXCEPTION code = 303, msg = "Matrix: this operation is only valid on square matrices."
See also:
lu(), intervalLU()

IntervalMatrix & intblas::IntervalMatrix::inverse  ) 
 

This function will invert this matrix based on the elements midpoints.

This function uses midpoint LU decomposition to solve for the inverse. For reasons why to use this function as opposed to inverse(), see the documentation for intervalLU().

Returns:
The inverse of this matrix, based on its midpoints.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
INTERVAL_EXCEPTION code = 303, msg = "Matrix: this operation is only valid on square matrices."
See also:
lu(), intervalLU()

bool intblas::IntervalMatrix::isEmpty  ) 
 

This method returns true if any element is the empty interval.

Returns:
True if any element is equal to cEMTPY.

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

This function returns a matrix containing point intervals of the lower bound of each element.

Parameters:
v The matrix to get the lower bounds from.
result Where to store the lower bounds.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

IntervalMatrix & intblas::IntervalMatrix::lowerBounds  ) 
 

This method returns a matrix containing point intervals of the lower bound of each element.

Returns:
A matrix containing only the lower bounds.

void intblas::IntervalMatrix::lu IntervalMatrix lu,
int *  p
 

This method calculates the LU decomposition of this matrix based on the elements' midpoint.

To aid in avoiding singularity and to speed up computation, only the midpoint of the constituent intervals is used. The LU matrix and an array that represents the P matrix is generated by this function. This function is the first step to solving a system of equations. To get the actual answer call solveLU() next.

Parameters:
lu Where to store the generated LU matrix.
p Where to store the permutation array, this array must be m_rows long.
Exceptions:
INTERVAL_EXCEPTION code = 303, msg = "Matrix: this operation is only valid on square matrices."
See also:
solveLU()

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

This function returns a matrix containing point intervals of the midpoint of each element.

Parameters:
v The matrix to get the midpoints from.
result Where to store the midpoints.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

IntervalMatrix & intblas::IntervalMatrix::midpoint  ) 
 

This method returns a matrix containing point intervals of the midpoint of each element.

Returns:
A matrix containing only the midpoints.

void intblas::IntervalMatrix::mult IntervalMatrix a,
IntervalVector v,
IntervalVector result,
bool  right
[static]
 

This method multiplies a matrix by a vector, storing the product in result.

Parameters:
a The matrix to mutiply with.
v The vector to multiply this matrix by.
result Where to store the product.
right If true then a * v, otherwise v * a.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch.", when = m_cols != v.getDimension() or result.getDimension() != v.getDimension()

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

This method multiplies a matrix by the scalar, and stores the product in result.

Parameters:
a The matrix to muliply with.
scalar The value to multiply the matrix by.
result Where to store the product.

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

This method mutliplys a by b, and stores the product in result.

Note:
The result parameter must by have the dimensions a.m_rows x b.m_cols, otherwise a dimension mismatch exception is thrown.
Parameters:
a A matrix to multiply with.
b A matrix to multiply with.
result Where to store the product.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

void intblas::IntervalMatrix::neg IntervalMatrix a,
IntervalMatrix result
[static]
 

This function takes the negation of the matrix.

This function flips the sign of all the elements in the matrix.

Parameters:
a The matrix to negate.
result The preallocated IRMATRIX to store the result in.
Exceptions:
INTERVAL_EXCEPTION code = 301, msg = "Matrix: operation cannot be performed on a 0x0 matrix.", when = a is an empty matrix.
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

double intblas::IntervalMatrix::norm NORMTYPE  n  ) 
 

This method calculates the norm of this matrix.

Parameters:
n Either NORMTYPE::NORM1, NORMTYPE::NORMF, or NORMTYPE::NORMINF.
Returns:
The norm value for this matrix.
Exceptions:
INTERVAL_EXCEPTION code = 302, msg = "Matrix: that norm is not implemented in this package."

IntervalMatrix & intblas::IntervalMatrix::operator & IntervalMatrix y  ) 
 

This operator calculates the intersection of this matrix and y.

This is done element wise, i.e. this->a[i][j] & y[i][j].

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

IntervalVector & intblas::IntervalMatrix::operator * IntervalVector v  ) 
 

This operator multiplies this matrix by a vector.

Parameters:
v The vector to multiply this matrix by.
Returns:
The product of this matrix and the vector.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch.", when = m_cols != v.getDimension()

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

This operator multiplies the scalar by this matrix.

Parameters:
scalar The value to multiply this matrix by.
Returns:
An intermediate matrix containing the product.

IntervalMatrix & intblas::IntervalMatrix::operator * IntervalMatrix b  ) 
 

This operator multiplies b to this matrix.

Parameters:
b The matrix to multiply to this matrix.
Returns:
An intermediate result matrix containing the product.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

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

This operator adds a scalar value to this matrix.

Parameters:
scalar The value add to this matrix.

IntervalMatrix & intblas::IntervalMatrix::operator+ IntervalMatrix b  ) 
 

This operator adds b to this matrix.

Parameters:
b The matrix to add to this matrix.
Returns:
An intermediate result matrix containing the sum.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

IntervalMatrix & intblas::IntervalMatrix::operator-  ) 
 

This operator takes the unary negation of the matrix.

This operator flips the sign of all the elements in the matrix.

Returns:
The unary negated matrix.
Exceptions:
INTERVAL_EXCEPTION code = 301, msg = "Matrix: operation cannot be performed on a 0x0 matrix.", when = a is an empty matrix.

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

This operator subtracts a scalar value from a.

Parameters:
scalar The value subtract from this matrix.
Returns:
An intermediate matrix containing the difference.

IntervalMatrix & intblas::IntervalMatrix::operator- IntervalMatrix b  ) 
 

This operator subtracts b from this matrix.

Parameters:
b The matrix to subtract from this matrix.
Returns:
An intermediate result matrix containing the difference.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

void intblas::IntervalMatrix::operator= const IntervalMatrix b  ) 
 

Copies the values of the matrix b into this matrix.

This operation can be expensive. This is especially the case if this matrix is not empty or b has a different size.

Parameters:
b The matrix whose values are to be copied.

bool intblas::IntervalMatrix::operator== const IntervalMatrix b  )  const
 

This operator tests element wise to see if this matrix and b are equivalent.

Parameters:
b The matrix to test against.
Returns:
True, if the elements of this matrix and b are equivalent.

Interval* intblas::IntervalMatrix::operator[] unsigned int  index  )  const [inline]
 

This operator returns a reference to the row of the matrix.

Parameters:
index The zero based index of the row to get.
Returns:
A reference to the row at index.

IntervalMatrix & intblas::IntervalMatrix::operator| IntervalMatrix y  ) 
 

This operator calculates the union of this matrix and y.

This is done element wise, i.e. this->a[i][j] & y[i][j].

Parameters:
y The matrix to union with.
Returns:
The The intersection of this matrix and y.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
See also:
Interval::operator|()

void intblas::IntervalMatrix::permute IntervalMatrix a,
IntervalMatrix result,
int  p[]
[static]
 

This function moves rows from their original index to the index proveded in p.

Each element in p contains the new index for the row at that location. For example if p = [2,1,0] it would place a[0] at a[1] and a[1] at a[0]. This means that p must have the same number of elements as a has rows.

Parameters:
a The matrix to permute.
p[] The new indexes for a's rows.
result Where to store the permutation.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch." when = The dimension of result does not match a.

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

This method moves rows from their original index to the index proveded in p.

Each element in p contains the new index for the row at that location. For example if p = [2,1,0] it would place a[0] at a[1] and a[1] at a[0]. This means that p must have the same number of elements as this matrix has rows.

Parameters:
p[] The new indexes for a's rows.
Returns:
This matrix with its rows rearranged.

void intblas::IntervalMatrix::rankOneUpdate IntervalMatrix a,
IntervalVector x,
IntervalVector y,
IntervalMatrix result,
const Interval alpha = IntervalMatrix::one,
const Interval beta = IntervalMatrix::one
[static]
 

This function performs a rank one update on matrix a.

This function performs the following formula.

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

Parameters:
a This parameter coresponds to A in the formula.
result Where to store the resulting matrix.
x This parameter coresponds to x in the formula.
y This parameter coresponds to y in the formula.
alpha This parameter coresponds to $\alpha$ in the formula.
beta This parameter coresponds to $\beta$ in the formula.
Returns:
A matrix that has been updated.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

void intblas::IntervalMatrix::scaledAccumulation IntervalMatrix a,
IntervalMatrix b,
IntervalMatrix result,
const Interval alpha = IntervalMatrix::one,
const Interval beta = IntervalMatrix::one
[static]
 

This function is provided to efficiently calculate the accumulate and scale formula.

This method calculates the formula:

\[ \alpha*{\bf A} + \beta*{\bf B} \]

Parameters:
a The A matrix in the formula.
b The B matrix in the formula.
result The result of the calculation, this matrix must be the same dimension as a and b.
alpha The $\alpha$ in the formula.
beta The $\beta$ in the formula.
Returns:
The scaled accumulation.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

void intblas::IntervalMatrix::scaledMatrixMult IntervalMatrix a,
IntervalMatrix b,
IntervalMatrix c,
IntervalMatrix result,
bool  a_transpose = false,
bool  b_transpose = false,
const Interval alpha = IntervalMatrix::one,
const Interval beta = IntervalMatrix::one
[static]
 

This function performs multiple scaled matrix multiplication formulas.

This function calculates:

\[ \alpha{\bf A*B} + \beta{\bf C} \alpha{\bf A^{T}*B} + \beta{\bf C} \alpha{\bf A*B^{T}} + \beta{\bf C} \alpha{\bf A^{T}*B^{T}} + \beta{\bf C} \alpha{\bf B*A} + \beta{\bf C} \alpha{\bf B^{T}*A} + \beta{\bf C} \alpha{\bf B*A^{T}} + \beta{\bf C} \alpha{\bf B^{T}*A^{T}} + \beta{\bf C} \]

Parameters:
a The A in the formula.
b The B in the formula.
c The C in the formula.
result Where to store the product.
a_transpose If true then a is transposed.
b_transpose If true then b is transposed.
alpha The $\alpha$ in the formula.
beta The $\beta$ in the formula.

void intblas::IntervalMatrix::scaledVectorMult IntervalMatrix a,
IntervalVector x,
IntervalVector y,
IntervalVector result,
const Interval alpha = IntervalMatrix::one,
const Interval beta = IntervalMatrix::one,
bool  transpose_a = false
[static]
 

This function performs scaled vector multiplication.

As per the standard this function performs the following formula.

\[ \alpha{\bf A*x} + \beta{\bf y} \& \alpha{\bf A^{T}*x} + \beta{\bf y} \]

Parameters:
a This parameter corresponds to the A in the formula.
x This parameter corresponds to the x in the formula.
y This parameter corresponds to the y in the formula.
result Where to store the resulting vector.
alpha The $\alpha$ in the formula.
beta The $\beta$ in the formula.
transpose_a If true then matrix a is transposed
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch." when y.dim != result.dim

void intblas::IntervalMatrix::setAt unsigned int  r,
unsigned int  c,
const Interval i
[inline]
 

Sets the value of the element at row r and column c to i.

This method is provided to make using IntervalMatrix pointers easier.

Parameters:
r The row location of the element
c The column location of the element.
i The value to assign the element.

void intblas::IntervalMatrix::solveLU IntervalVector b,
IntervalMatrix lu,
int  p[],
IntervalVector result
[static]
 

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:
b The b in the equation.
lu The LU matrix previously found by lu().
p The permutation array previously found by lu().
result Where to store the solution vector.
Exceptions:
INTERVAL_EXCEPTION code = 203, msg = "Vector: dimension mismatch"
INTERVAL_EXCEPTION code = 303, msg = "Matrix: dimension mismatch"
See also:
IntervalMatrix::lu()

IntervalVector & intblas::IntervalMatrix::solveLU IntervalVector b,
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:
b The b in the equation.
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::IntervalMatrix::sub IntervalMatrix a,
const Interval scalar,
IntervalMatrix result,
bool  right = true
[static]
 

This method subtracts a scalar value from a, and stores the difference in result.

Parameters:
a The matrix to subtract the value from.
scalar The value subtract from this matrix.
result Where to store the difference.
right If true then (a-scalar) otherwise (scalar-a).
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

void intblas::IntervalMatrix::sub const IntervalMatrix a,
const IntervalMatrix b,
IntervalMatrix result
[static]
 

This operator subtracts two matrices and stores the difference in result.

Parameters:
a A matrix to subract with.
b A matrix to subract with.
result Where to store the difference.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

IntervalVector & intblas::IntervalMatrix::toVector int  index,
bool  row = true
 

This returns a vector representing a row or column of this matrix.

Parameters:
index the zero based index of the row or column.
row If true then copy a row, Otherwise copy a column.
Returns:
copy of the row or column as a vector.
Exceptions:
INTERVAL_EXCEPTION code = 202, msg = "Vector: index is out of range."

void intblas::IntervalMatrix::transpose IntervalMatrix a,
IntervalMatrix result
[static]
 

Transpose the matrix a and store the result.

Parameters:
a The matrix to transpose.
result Where to store the result.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch.",

IntervalMatrix & intblas::IntervalMatrix::transpose  ) 
 

Transpose the this matrix.

Returns:
An intermediate value that represent the transposition of this matrix.

void intblas::IntervalMatrix::triangularMult IntervalMatrix a,
IntervalMatrix t,
IntervalMatrix result,
const Interval alpha = IntervalMatrix::one,
TRIMAT_TYPE  tt = LTR_TOP,
bool  side = false
[static]
 

This function efficently multiplies a matrix against a square triangular matrix of the same dimension.

This function performs the following calculations:

When tt = LTR_TOP and side = F : $T*A$
When tt = LTR_TOP and side = T : $A*T$
When tt = LTR_BOT and side = F : $T^{T}*A$
When tt = LTR_BOT and side = T : $A*T^{T}$
The same is true for RTL matrices.

Parameters:
a The matrix to multiply.
t The triangular matrix to use.
result Where to store the product.
alpha A scaling factor.
tt The type of the triangular matrix.
side The side the triangular matrix is on when multiplying, either False (left default) or True (right).
Returns:
The triangularly multiplied matrix.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
INTERVAL_EXCEPTION code = 303, msg = "Matrix: the operation is only valid on square matrices."
INTERVAL_EXCEPTION code = 304, msg = "Matrix: the side parameter must be 1 (left) or 2 (right)."

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

This function returns a matrix containing point intervals of the upper bound of each element.

Parameters:
v The matrix to get the upper bounds from.
result Where to store the upper bounds.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

IntervalMatrix & intblas::IntervalMatrix::upperBounds  ) 
 

This method returns a matrix containing point intervals of the upper bound of each element.

Returns:
A matrix containing only the upper bounds.

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

This function returns a matrix containing point intervals of the width of each element.

Parameters:
v The matrix to get the widths from.
result Where to store the widths.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

IntervalMatrix & intblas::IntervalMatrix::widths  ) 
 

This method returns a matrix containing point intervals of the width of each element.

Returns:
A matrix containing only the widths.


Friends And Related Function Documentation

IntervalMatrix& accTranspose IntervalMatrix a,
IntervalMatrix b,
const Interval alpha = IntervalMatrix::one,
const Interval beta = IntervalMatrix::one
[friend]
 

This function is provided to efficiently calculate an accumulate and scale formula.

This method calculates the formula:

\[ \alpha*{\bf A}^{T} + \beta*{\bf B} \]

Parameters:
a The A matrix in the formula.
b The B matrix in the formula.
alpha The $\alpha$ in the formula.
beta The $\beta$ in the formula.
Returns:
The scaled accumulation.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
INTERVAL_EXCEPTION code = 303, msg = "Matrix: this operation is only valid on square matrices."

IntervalMatrix& diagonalScale IntervalMatrix a,
IntervalMatrix b,
IntervalMatrix d
[friend]
 

This function multiplies b by the diagonal matrix d, and adds the result to a.

This function is faster than using the * operator. This function calculates the following formula:

\[ A + BD \]

Parameters:
a The scaling matrix to add by.
b The matrix to multiply into.
d The diagonal matrix to multiply a by.
Returns:
The diagonally scaled matrix.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

IntervalMatrix& diagonalScale IntervalMatrix a,
IntervalMatrix d,
bool  side = true
[friend]
 

This function multiplies a by the diagonal matrix d.

This function is faster than using the * operator.

Parameters:
a The matrix to multiply into.
d The diagonal matrix to multiply a by.
side False for d*a, or True for a*d.
Returns:
The diagonally scaled matrix.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
INTERVAL_EXCEPTION code = 304, msg = "Matrix: the side parameter must be 1 or 2."

IntervalMatrix& diagonalScale2 IntervalMatrix a,
IntervalMatrix d1,
IntervalMatrix d2
[friend]
 

This function efficiently performs two sided diagonal scaling on a matrix.

This function implments the formula:

\[ \bf{D_{1} A D_{2}} \]

Parameters:
a The matrix to scale.
d1 The first scaling matrix.
d2 The second scaling matrix.
Returns:
The matrix a after being scaled.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
INTERVAL_EXCEPTION code = 303, msg = "Matrix: the operation is only valid on square matrices."

bool disjoint IntervalMatrix v,
IntervalMatrix y
[friend]
 

Tests to see if the elements of y are disjoint to the elements of v.

The comparison is done element wise, i.e. v[i][j].disjoint( y[i][j] ).

Parameters:
v The matrix to test with.
y The matrix to test against.
Returns:
True, if every element in y is disjoint with v.
See also:
Interval::disjoint()

bool encloses IntervalMatrix v,
IntervalMatrix y
[friend]
 

Tests to see if the elements of v enclose the elements of y.

The comparison is done element wise, i.e. v[i][j].encloses( y[i][j] ).

Parameters:
v The matrix to test with.
y The matrix to test against.
Returns:
True, if every element at v[i][j] encloses the element y[i][j].
See also:
Interval::encloses

IntervalMatrix intblas::IntervalMatrix::getIdentity unsigned int  rows,
unsigned int  cols
[friend]
 

This function returns an identity matrix of the size rows x cols.

Parameters:
rows The number of rows in the matrix.
cols The number of columns in the matrix.
Returns:
Identity matrix rows x cols.
Exceptions:
INTERVAL_EXCEPTION code = 303, msg = "Matrix: this operation is only valid on square matrices."

bool interior IntervalMatrix v,
IntervalMatrix y
[friend]
 

Tests to see if the elements of y are on the interior of v.

The comparison is done element wise, i.e. v[i][j].interior( y[i][j] ).

Parameters:
v The matrix to test with.
y The matrix to test against.
Returns:
True, if every element at y[i][j] in on the interior of v[i][j].
See also:
Interval::interior()

IntervalMatrix& intervalHull IntervalMatrix v,
IntervalMatrix y
[friend]
 

This function calculates the convex interval hull of v and y.

This is done element wise, i.e. v[i][j].hull( y[i][j] ).

Parameters:
v The matrix to interval hull with.
y The matrix to interval hull with.
Returns:
The convex interval hull of v and y.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
See also:
Interval::hull()

IntervalMatrix& intervalIntersection IntervalMatrix v,
IntervalMatrix y
[friend]
 

This method calculates the intersection of this matrix v and y.

This is done element wise, i.e. v[i][j] & y[i][j].

Parameters:
v The matrix to intersect against.
y The matrix to intersect with.
Returns:
The intersection of v and y.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
See also:
Interval::operator&()

IntervalMatrix& intervalUnion IntervalMatrix v,
IntervalMatrix y
[friend]
 

This operator calculates the union of v and y.

This is done element wise, i.e. v[i][j] & y[i][j].

Parameters:
v The matrix to union with.
y The matrix to union with.
Returns:
The union of v and y.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
See also:
Interval::operator|()

IntervalMatrix& inverse IntervalMatrix a  )  [friend]
 

This function will invert a matrix based on the elements midpoints.

This function uses midpoint LU decomposition to solve for the inverse. For reasons why to use this function as opposed to inverse(), see the documentation for intervalLU().

Parameters:
a The matrix to invert, it must be a square matrix.
Returns:
The inverse of a, based on its midpoints.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
INTERVAL_EXCEPTION code = 303, msg = "Matrix: this operation is only valid on square matrices."
See also:
lu(), intervalLU()

bool isEmpty IntervalMatrix v  )  [friend]
 

This method returns true if any element is the empty interval.

Returns:
True if any element is equal to cEMTPY.

IntervalMatrix& lowerBounds IntervalMatrix v  )  [friend]
 

This function returns a matrix containing point intervals of the lower bound of each element.

Parameters:
v The matrix to get the lower bounds from.
Returns:
A matrix containing only the lower bounds.

void intblas::IntervalMatrix::lu IntervalMatrix a,
IntervalMatrix lu,
int *  p
[friend]
 

This method calculates the LU decomposition of this matrix based on the elements' midpoint.

To aid in avoiding singularity and to speed up computation, only the midpoint of the constituent intervals is used. The LU matrix and an array that represents the P matrix is generated by this function. This function is the first step to solving a system of equations. To get the actual answer call solveLU() next.

Parameters:
a The matrix to find the LU decomposition of.
lu Where to store the generated LU matrix.
p Where to store the permutation array, this array must be a.m_rows long.
Exceptions:
INTERVAL_EXCEPTION code = 303, msg = "Matrix: this operation is only valid on square matrices."
See also:
solveLU()

IntervalMatrix& midpoint IntervalMatrix v  )  [friend]
 

This function returns a matrix containing point intervals of the midpoint of each element.

Returns:
A matrix containing only the midpoints.

IntervalMatrix& neg IntervalMatrix a  )  [friend]
 

This function takes the negation of the matrix.

This function flips the sign of all the elements in the matrix.

Parameters:
a The matrix to negate.
Returns:
The negated matrix.
Exceptions:
INTERVAL_EXCEPTION code = 301, msg = "Matrix: operation cannot be performed on a 0x0 matrix.", when = a is an empty matrix.

double norm IntervalMatrix a,
NORMTYPE  n
[friend]
 

This function calculates the norm of matrix a.

Parameters:
a The matrix to find the norm of.
n Either NORMTYPE::NORM1, NORMTYPE::NORMF, or NORMTYPE::NORMINF.
Returns:
The norm value for a.
Exceptions:
INTERVAL_EXCEPTION code = 302, msg = "Matrix: that norm is not implemented in this package."

IntervalVector& operator * IntervalVector v,
IntervalMatrix a
[friend]
 

This operator multiplies this matrix by a vector.

Parameters:
v The vector to multiply this matrix by.
a The matrix to use in the multiplication.
Returns:
The product of this matrix and the vector.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch.", when = m_cols != v.getDimension()

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

This operator multiplies the scalar by matrix a.

Parameters:
scalar The value to multiply this matrix by.
a The matrix to multiply with.
Returns:
An intermediate matrix containing the product.

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

This operator subtracts a scalar value from a.

Parameters:
a The matrix to subtract the value from.
scalar The value subtract from this matrix.
Returns:
An intermediate result matrix containing the difference.

ostream& operator<< ostream &  out,
const IntervalMatrix mat
[friend]
 

This is a convenience operator for outputing the matrix as a string.

The format used to output the matris is as follows.

  • Each row of the matrix is surrounded by '|'
  • One row per line.
  • The elements of the row are seperated by spaces.
  • The elements are output using the Interval class's << operator.
  • There is a new line outputed after the last row.
    Parameters:
    out The output stream to write to.
    mat The matrix to write.
    Returns:
    A reference to out.

istream& operator>> istream &  in,
IntervalMatrix m
[friend]
 

This operator reads a matrix from an input stream The matrix must be formated as folows:

  • The matrix must begin and end with a '|' character
  • The elements can be seperated by spaces or commas.

  • The rows can be termiated with either a ';' or a '|'.
  • If a '|' is used as a row terminator then a matching '|' must be the next non-white space character. If the dimensions of the read matrix is different than m, then m is resized to the read matrix's dimensions.
    Parameters:
    in The input stream to read from.
    m The matrix to place the result into.
    Returns:
    A reference to in.
    Exceptions:
    INTERVAL_EXCEPTION code = 530, msg = "IntervalMatrix I/O: Could not read a matrix from the stream"
    INTERVAL_EXCEPTION code = 531, msg = "IntervalMatrix I/O: Dimension mismatch on input, stoped reading." when = A row is read whose dimension is different than the first read row.
    See also:
    operator>>(istream& in, Interval& i)

IntervalMatrix& permute IntervalMatrix a,
int  p[]
[friend]
 

This function moves rows from their original index to the index proveded in p.

Each element in p contains the new index for the row at that location. For example if p = [2,1,0] it would place a[0] at a[1] and a[1] at a[0]. This means that p must have the same number of elements as a has rows.

Parameters:
a The matrix to permute.
p[] The new indexes for a's rows.
Returns:
The matrix a with its rows rearranged.

IntervalMatrix& rankOneUpdate IntervalMatrix a,
IntervalVector x,
IntervalVector y,
const Interval alpha = IntervalMatrix::one,
const Interval beta = IntervalMatrix::one
[friend]
 

This function performs a rank one update on matrix a.

This function performs the following formula.

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

Parameters:
a This parameter coresponds to A in the formula.
x This parameter coresponds to x in the formula.
y This parameter coresponds to y in the formula.
alpha This parameter coresponds to $\alpha$ in the formula.
beta This parameter coresponds to $\beta$ in the formula.
Returns:
A matrix that has been updated.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

IntervalMatrix& scaledAccumulation IntervalMatrix a,
IntervalMatrix b,
const Interval alpha = IntervalMatrix::one,
const Interval beta = IntervalMatrix::one
[friend]
 

This function is provided to efficiently calculate an accumulate and scale formula.

This function calculates the formula:

\[ \alpha*{\bf A} + \beta*{\bf B} \]

Parameters:
a The A matrix in the formula.
b The B matrix in the formula.
alpha The $\alpha$ in the formula.
beta The $\beta$ in the formula.
Returns:
The scaled accumulation.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

IntervalMatrix& scaledMatrixMult IntervalMatrix a,
IntervalMatrix b,
IntervalMatrix c,
bool  a_transpose = false,
bool  b_transpose = false,
const Interval alpha = IntervalMatrix::one,
const Interval beta = IntervalMatrix::one
[friend]
 

This function performs multiple scaled matrix multiplication formulas.

This function efficently calculates:

\[ \alpha{\bf A*B} + \beta{\bf C} \alpha{\bf A^{T}*B} + \beta{\bf C} \alpha{\bf A*B^{T}} + \beta{\bf C} \alpha{\bf A^{T}*B^{T}} + \beta{\bf C} \alpha{\bf B*A} + \beta{\bf C} \alpha{\bf B^{T}*A} + \beta{\bf C} \alpha{\bf B*A^{T}} + \beta{\bf C} \alpha{\bf B^{T}*A^{T}} + \beta{\bf C} \]

Parameters:
a The A in the formula.
b The B in the formula.
c The C in the formula.
a_transpose If true then a is transposed.
b_transpose If true then b is transposed.
alpha The $\alpha$ in the formula.
beta The $\beta$ in the formula.
Returns:
The product.

IntervalVector& scaledVectorMult IntervalMatrix a,
IntervalVector x,
IntervalVector y,
const Interval alpha = IntervalMatrix::one,
const Interval beta = IntervalMatrix::one,
bool  transpose_a = false
[friend]
 

This function performs scaled vector multiplication.

As per the standard this function performs the following formula.

\[ \alpha{\bf A*x} + \beta{\bf y} \& \alpha{\bf A^{T}*x} + \beta{\bf y} \]

Parameters:
a This parameter corresponds to the A in the formula.
x This parameter corresponds to the x in the formula.
y This parameter corresponds to the y in the formula, further it contains the result.
alpha The $\alpha$ in the formula.
beta The $\beta$ in the formula.
transpose_a If true then matrix a is transposed
Returns:
The resulting vector.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."

IntervalVector& solveLU IntervalVector b,
IntervalMatrix lu,
int  p[]
[friend]
 

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:
b The b in the equation.
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 swap IntervalMatrix a,
IntervalMatrix b
[friend]
 

This function efficiently swaps two matrices.

This method uses reassignes pointers, hence it runs in constant time.

Note:
a and b may be resized by this operation.
Parameters:
a The matrix to swap with b.
b The matrix to swap with a.

IntervalMatrix& transpose IntervalMatrix a  )  [friend]
 

Transpose the matrix a.

Parameters:
a The matrix to transpose.
Returns:
An intermediate value that represent the transposition of a.

IntervalMatrix& triangularMult IntervalMatrix a,
IntervalMatrix t,
const Interval alpha = IntervalMatrix::one,
TRIMAT_TYPE  tt = LTR_TOP,
bool  side = false
[friend]
 

This function efficently multiplies a matrix against a square triangular matrix of the same dimension.

This function performs the following calculations:

When tt = LTR_TOP and side = F : $T*A$
When tt = LTR_TOP and side = T : $A*T$
When tt = LTR_BOT and side = F : $T^{T}*A$
When tt = LTR_BOT and side = T : $A*T^{T}$
The same is true for RTL matrices.

Parameters:
a The matrix to multiply.
t The triangular matrix to use.
alpha A scaling factor.
tt The type of the triangular matrix.
side The side the triangular matrix is on when multiplying, either False (left default) or True (right).
Returns:
The triangularly multiplied matrix.
Exceptions:
INTERVAL_EXCEPTION code = 300, msg = "Matrix: dimension mismatch."
INTERVAL_EXCEPTION code = 303, msg = "Matrix: the operation is only valid on square matrices."
INTERVAL_EXCEPTION code = 304, msg = "Matrix: the side parameter must be 1 (left) or 2 (right)."

IntervalMatrix& upperBounds IntervalMatrix v  )  [friend]
 

This function returns a matrix containing point intervals of the upper bound of each element.

Returns:
A matrix containing only the upper bounds.

IntervalMatrix& widths IntervalMatrix v  )  [friend]
 

This function returns a matrix containing point intervals of the width of each element.

Parameters:
v The matrix to find the widths from.
Returns:
A matrix containing only the widths.


Member Data Documentation

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

The array that stores the elements.

Interval*** intblas::IntervalMatrix::a_ptr [protected]
 

Work around, ignore it.

bool intblas::IntervalMatrix::ir [protected]
 

True if this object is an intermediary result.

unsigned int intblas::IntervalMatrix::m_cols [protected]
 

The number of columns.

unsigned int intblas::IntervalMatrix::m_rows [protected]
 

The number of rows.


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