C++ Interval Arithmetic Library
Copyright 2002, Sun Microsystems, Inc.
NAME
nvector
- An optimized vector class for interval operations.
SYNOPSIS
#include <suninterval_vector.h>
template < typename T >
class nvector;
DESCRIPTION
nvector<T> class represents and manipulates one dimensional
arrays of values. Elements in a vector are indexed sequen-
tially beginning with zero. Template specializations are
available for the following types: interval<float>,
interval<double>, interval<long double>, float, double, long
double, int, bool ( nvector<bool> has restricted usage ).
INTERFACE
template< typename T >
class nvector {
public:
// types
class vref; // reference to a vector element
// constructors
nvector(size_t);
nvector(const T&, size_t);
nvector(const T*, size_t);
nvector(const std::valarray<T>&);
nvector(const nvector<T>&);
// destructor
~nvector();
// operator =
nvector<T>& operator= (const nvector<T>&);
nvector<T>& operator= (const T&);
// operator[]
T operator[] (size_t) const;
vref operator[] (size_t);
// unary operators
nvector<T> operator+() const;
nvector<T> operator-() const;
// computed assignment
nvector<T>& operator+= (const nvector<T>&);
nvector<T>& operator-= (const nvector<T>&);
nvector<T>& operator*= (const nvector<T>&);
nvector<T>& operator/= (const nvector<T>&);
nvector<T>& operator+= (const T&);
nvector<T>& operator-= (const T&);
nvector<T>& operator*= (const T&);
nvector<T>& operator/= (const T&);
// others
size_t size() const;
std::valarray<T>& array() const;
};
/* Non-member binary operators */
template< typename T > nvector<T>
operator+ (const nvector<T>&, const nvector<T>&);
template< typename T > nvector<T>
operator- (const nvector<T>&, const nvector<T>&);
template< typename T > nvector<T>
operator* (const nvector<T>&, const nvector<T>&);
template< typename T > nvector<T>
operator/ (const nvector<T>&, const nvector<T>&);
template< typename T > nvector<bool>
operator== (const nvector<T>&, const nvector<T>&);
template< typename T > nvector<bool>
operator!= (const nvector<T>&, const nvector<T>&);
template< typename T > nvector<T>
operator+ (const nvector<T>&, const T&);
template< typename T > nvector<T>
operator- (const nvector<T>&, const T&);
template< typename T > nvector<T>
operator* (const nvector<T>&, const T&);
template< typename T > nvector<T>
operator/ (const nvector<T>&, const T&);
template< typename T > nvector<bool>
operator== (const nvector<T>&, const T&);
template< typename T > nvector<bool>
operator!= (const nvector<T>&, const T&);
template< typename T > nvector<T>
operator+ (const T&, const nvector<T>&);
template< typename T > nvector<T>
operator- (const T&, const nvector<T>&);
template< typename T > nvector<T>
operator* (const T&, const nvector<T>&);
template< typename T > nvector<T>
operator/ (const T&, const nvector<T>&);
template< typename T > nvector<bool>
operator== (const T&, const nvector<T>&);
template< typename T > nvector<bool>
operator!= (const T&, const nvector<T>&);
/* Non-member elementary functions */
template< typename T > nvector<T>
sqrt(const nvector<T>&)
template< typename T > nvector<T>
exp(const nvector<T>&)
template< typename T > nvector<T>
log(const nvector<T>&)
template< typename T > nvector<T>
log10(const nvector<T>&)
template< typename T > nvector<T>
acos(const nvector<T>&)
template< typename T > nvector<T>
asin(const nvector<T>&)
template< typename T > nvector<T>
atan(const nvector<T>&)
template< typename T > nvector<T>
cos(const nvector<T>&)
template< typename T > nvector<T>
cosh(const nvector<T>&)
template< typename T > nvector<T>
sin(const nvector<T>&)
template< typename T > nvector<T>
sinh(const nvector<T>&)
template< typename T > nvector<T>
tan(const nvector<T>&)
template< typename T > nvector<T>
tanh(const nvector<T>&)
template< typename T > nvector<T>
pow(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<T>
pow(const nvector<T>&, const nvector<int>&)
template< typename T > nvector<T>
atan2(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<T>
pow(const nvector<T>&, const T&)
template< typename T > nvector<T>
pow(const nvector<T>&, const int&)
template< typename T > nvector<T>
atan2(const nvector<T>&, const T&)
template< typename T > nvector<T>
pow(const T&, const nvector<T>&)
template< typename T > nvector<T>
pow(const T&, const nvector<int>&)
template< typename T > nvector<T>
atan2(const T&, const nvector<T>&)
/* Non-member interval-specific functions */
// extraction functions: infimim, supremum, midpoint,
// width, magnitude, mignitude
template< typename T > nvector<T>
inf(const nvector< interval<T> >&);
template< typename T > nvector<T>
sup(const nvector< interval<T> >&);
template< typename T > nvector<T>
mid(const nvector< interval<T> >&);
template< typename T > nvector<T>
wid(const nvector< interval<T> >&);
template< typename T > nvector<T>
mag(const nvector< interval<T> >&);
template< typename T > nvector<T>
mig(const nvector< interval<T> >&);
// intersection division
template< typename T > nvector<T>
divix(const nvector<T>&, const nvector<T>&, const
nvector<T>&);
// hull functions: regular hull, intersection
template< typename T > nvector<T>
interval_hull(const nvector<T>&, const nvector<T>&);
template< typename T > nvector<T>
intersect(const nvector<T>&, const nvector<T>&);
template< typename T > nvector<T>
interval_hull(const nvector<T>&, const T&);
template< typename T > nvector<T>
intersect(const nvector<T>&, const T&);
template< typename T > nvector<T>
interval_hull(const T&, const nvector<T>&);
template< typename T > nvector<T>
intersect(const T&, const nvector<T>&);
// query functions: is empty, ndigits
template< typename T > nvector<interval_bool>
is_empty(const nvector<T>&);
template< typename T > nvector<int>
ndigits(const nvector<T>&);
// membership functions
template< typename T1, typename T2 > nvector<interval_bool>
in(const nvector<T1>&, const nvector<T2>&);
// comparison functions: disjoint, in interior,
// subset, superset, proper subset, proper superset
template< typename T > nvector<interval_bool>
disjoint(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
in_interior(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
subset(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
superset(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
proper_subset(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
proper_superset(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
disjoint(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
in_interior(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
subset(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
superset(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
proper_subset(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
proper_superset(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
disjoint(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
in_interior(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
subset(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
superset(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
proper_subset(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
proper_superset(const T&, const nvector<T>&)
// set relations: equal, not equal,
// less than, less than or equal,
// greater than, greater than or equal
template< typename T > nvector<interval_bool>
seq(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
sne(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
slt(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
sle(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
sgt(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
sge(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
seq(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
sne(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
slt(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
sle(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
sgt(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
sge(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
seq(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
sne(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
slt(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
sle(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
sgt(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
sge(const T&, const nvector<T>&)
// certainly relations: equal, not equal,
// less than, less than or equal,
// greater than, greater than or equal
template< typename T > nvector<interval_bool>
ceq(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
cne(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
clt(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
cle(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
cgt(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
cge(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
ceq(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
cne(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
clt(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
cle(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
cgt(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
cge(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
ceq(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
cne(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
clt(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
cle(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
cgt(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
cge(const T&, const nvector<T>&)
// possibly relations: equal, not equal,
// less than, less than or equal,
// greater than, greater than or equal
template< typename T > nvector<interval_bool>
peq(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
pne(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
plt(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
ple(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
pgt(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
pge(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<interval_bool>
peq(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
pne(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
plt(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
ple(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
pgt(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
pge(const nvector<T>&, const T&)
template< typename T > nvector<interval_bool>
peq(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
pne(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
plt(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
ple(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
pgt(const T&, const nvector<T>&)
template< typename T > nvector<interval_bool>
pge(const T&, const nvector<T>&)
// arithmetic functions: absolute value, min, max,
// ceil, floor, fmod
template< typename T > nvector<T>
fabs(const nvector<T>&)
template< typename T > nvector<T>
minimum(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<T>
maximum(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<T>
minimum(const nvector<T>&, const T&)
template< typename T > nvector<T>
maximum(const nvector<T>&, const T&)
template< typename T > nvector<T>
minimum(const T&, const nvector<T>&)
template< typename T > nvector<T>
maximum(const T&, const nvector<T>&)
template< typename T > nvector<T>
ceil(const nvector< interval<T> >&)
template< typename T > nvector<T>
floor(const nvector< interval<T> >&)
template< typename T > nvector<T>
fmod(const nvector<T>&, const nvector<T>&)
template< typename T > nvector<T>
fmod(const nvector<T>&, const T&)
template< typename T > nvector<T>
fmod(const T&, const nvector<T>&)
// power functions: square, cube root
template< typename T > nvector<T>
sqr(const nvector<T>&)
template< typename T > nvector<T>
cbrt(const nvector<T>&)
/* Other non-member functions */
// sum of all elements
template< typename T > T
sum(const nvector<T>&)
// product of all elements
template< typename T > T
product(const nvector<T>&)
// scalar product of two vectors
template< typename T > T
dot_product(const nvector<T>&, const nvector<T>&);
// output to a stream
template< typename T >
ostream& operator<< (ostream&, const nvector<T>&);
CONSTRUCTORS
nvector(size_t n);
Creates a vector of length n, containing n values ini-
tialized with the default value for type T.
nvector(const T& value, size_t n);
Creates a vector of length n, containing n values ini-
tialized with value.
nvector(const T* value, size_t n);
Creates a vector of length n, containing n values ini-
tialized with the first n elements pointed to by value.
The array pointed to by value must contain at least n
values.
nvector(const std::valarray<T>& x);
Creates a vector of length x.size(), containing the same
values as x.
nvector(const nvector<T>& x);
Creates a copy of x.
DESTRUCTORS
~nvector();
Releases all allocated memory.
ASSIGNMENT OPERATORS
nvector<T>& operator= (const nvector<T>& x);
Assigns to each element of self the corresponding value
from x. Self is resized to match the size of x, if neces-
sary. Returns a reference to self.
nvector<T>& operator= (const T& x);
Assigns to each element of self the value of x. Returns a
reference to self.
REFERENCE OPERATORS
T operator[] (size_t n) const;
Returns the value at element n of self. The index n must
be between 0 and size less one.
vref operator[] (size_t n);
Returns a reference to element n of self. The result can
be used as an lvalue. This reference is valid until the
vector is destroyed. The index n must be between 0 and
size less one.
UNARY OPERATORS
nvector<T> operator+() const;
Returns a new nvector object of the same size as the vec-
tor in self where each element has been initialized by
applying operator+ to the corresponding element in self.
nvector<T> operator-() const;
Returns a new nvector object of the same size as the vec-
tor in self where each element has been initialized by
applying operator- to the corresponding element in self.
COMPUTED ASSIGNMENT OPERATORS
nvector<T>& operator+= (const nvector<T>& x);
nvector<T>& operator-= (const nvector<T>& x);
nvector<T>& operator*= (const nvector<T>& x);
nvector<T>& operator/= (const nvector<T>& x);
Applies the indicated operation to each element in self,
using the corresponding element from x as the right hand
argument. The length of x must equal the length of self.
Returns self.
nvector<T>& operator+= (const T& val);
nvector<T>& operator-= (const T& val);
nvector<T>& operator*= (const T& val);
nvector<T>& operator/= (const T& val);
Applies the indicated operation to each element in self,
using val as the right hand argument. Returns self.
MEMBER FUNCTIONS
size_t size() const;
Returns the number of elements.
std::valarray<T>& array() const;
Returns valarray representation of nvector.
NON-MEMBER BINARY OPERATORS
template< typename T > nvector<T>
operator+ (const nvector<T>& lhs, const nvector<T>& rhs);
template< typename T > nvector<T>
operator- (const nvector<T>& lhs, const nvector<T>& rhs);
template< typename T > nvector<T>
operator* (const nvector<T>& lhs, const nvector<T>& rhs);
template< typename T > nvector<T>
operator/ (const nvector<T>& lhs, const nvector<T>& rhs);
template< typename T > nvector<bool>
operator== (const nvector<T>& lhs, const nvector<T>& rhs);
template< typename T > nvector<bool>
operator!= (const nvector<T>& lhs, const nvector<T>& rhs);
template< typename T > nvector<T>
operator+ (const nvector<T>& lhs, const T& rhs);
template< typename T > nvector<T>
operator- (const nvector<T>& lhs, const T& rhs);
template< typename T > nvector<T>
operator* (const nvector<T>& lhs, const T& rhs);
template< typename T > nvector<T>
operator/ (const nvector<T>& lhs, const T& rhs);
template< typename T > nvector<bool>
operator== (const nvector<T>& lhs, const T& rhs);
template< typename T > nvector<bool>
operator!= (const nvector<T>& lhs, const T& rhs);
template< typename T > nvector<T>
operator+ (const T& lhs, const nvector<T>& rhs);
template< typename T > nvector<T>
operator- (const T& lhs, const nvector<T>& rhs);
template< typename T > nvector<T>
operator* (const T& lhs, const nvector<T>& rhs);
template< typename T > nvector<T>
operator/ (const T& lhs, const nvector<T>& rhs);
template< typename T > nvector<bool>
operator== (const T& lhs, const nvector<T>& rhs);
template< typename T > nvector<bool>
operator!= (const T& lhs, const nvector<T>& rhs);
Returns a new nvector object of the same size as the
argument vectors where each element has been initialized
by applying the indicated operation to the corresponding
elements in the argument vectors. The argument vectors
must have the same length.
NON-MEMBER ELEMENTARY FUNCTIONS
template< typename T > nvector<T>
sqrt(const nvector<T>& x)
template< typename T > nvector<T>
exp(const nvector<T>& x)
template< typename T > nvector<T>
log(const nvector<T>& x)
template< typename T > nvector<T>
log10(const nvector<T>& x)
template< typename T > nvector<T>
acos(const nvector<T>& x)
template< typename T > nvector<T>
asin(const nvector<T>& x)
template< typename T > nvector<T>
atan(const nvector<T>& x)
template< typename T > nvector<T>
cos(const nvector<T>& x)
template< typename T > nvector<T>
cosh(const nvector<T>& x)
template< typename T > nvector<T>
sin(const nvector<T>& x)
template< typename T > nvector<T>
sinh(const nvector<T>& x)
template< typename T > nvector<T>
tan(const nvector<T>& x)
template< typename T > nvector<T>
tanh(const nvector<T>& x)
template< typename T > nvector<T>
pow(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<T>
pow(const nvector<T>& x, const nvector<int>& y)
template< typename T > nvector<T>
atan2(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<T>
pow(const nvector<T>& x, const T& y)
template< typename T > nvector<T>
pow(const nvector<T>& x, const int& y)
template< typename T > nvector<T>
atan2(const nvector<T>& x, const T& y)
template< typename T > nvector<T>
pow(const T& x, const nvector<T>& y)
template< typename T > nvector<T>
pow(const T& x, const nvector<int>& y)
template< typename T > nvector<T>
atan2(const T& x, const nvector<T>& y)
Returns a new nvector object of the same size as the
argument vector (vectors) where each element has been
initialized by applying the indicated elementary function
to the corresponding elements in the argument vector
(vectors).
NON-MEMBER INTERVAL-SPECIFIC FUNCTIONS
template< typename T > nvector<T>
inf(const nvector< interval<T> >& x);
template< typename T > nvector<T>
sup(const nvector< interval<T> >& x);
template< typename T > nvector<T>
mid(const nvector< interval<T> >& x);
template< typename T > nvector<T>
wid(const nvector< interval<T> >& x);
template< typename T > nvector<T>
mag(const nvector< interval<T> >& x);
template< typename T > nvector<T>
mig(const nvector< interval<T> >& x);
template< typename T > nvector<T>
divix(const nvector<T>& x, const nvector<T>& y, const
nvector<T>& z);
template< typename T > nvector<T>
interval_hull(const nvector<T>& x, const nvector<T>& y);
template< typename T > nvector<T>
intersect(const nvector<T>& x, const nvector<T>& y);
template< typename T > nvector<T>
interval_hull(const nvector<T>& x, const T& y);
template< typename T > nvector<T>
intersect(const nvector<T>& x, const T& y);
template< typename T > nvector<T>
interval_hull(const T& x, const nvector<T>& y);
template< typename T > nvector<T>
intersect(const T& x, const nvector<T>& y);
template< typename T > nvector<interval_bool>
is_empty(const nvector<T>& x);
template< typename T > nvector<int>
ndigits(const nvector<T>& x);
template< typename T1, typename T2 > nvector<interval_bool>
in(const nvector<T1>& x, const nvector<T2>& y);
template< typename T > nvector<interval_bool>
disjoint(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
in_interior(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
subset(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
superset(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
proper_subset(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
proper_superset(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
disjoint(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
in_interior(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
subset(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
superset(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
proper_subset(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
proper_superset(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
disjoint(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
in_interior(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
subset(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
superset(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
proper_subset(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
proper_superset(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
seq(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
sne(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
slt(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
sle(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
sgt(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
sge(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
seq(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
sne(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
slt(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
sle(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
sgt(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
sge(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
seq(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
sne(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
slt(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
sle(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
sgt(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
sge(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
ceq(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
cne(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
clt(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
cle(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
cgt(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
cge(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
ceq(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
cne(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
clt(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
cle(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
cgt(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
cge(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
ceq(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
cne(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
clt(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
cle(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
cgt(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
cge(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
peq(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
pne(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
plt(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
ple(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
pgt(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
pge(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
peq(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
pne(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
plt(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
ple(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
pgt(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
pge(const nvector<T>& x, const T& y)
template< typename T > nvector<interval_bool>
peq(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
pne(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
plt(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
ple(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
pgt(const T& x, const nvector<T>& y)
template< typename T > nvector<interval_bool>
pge(const T& x, const nvector<T>& y)
template< typename T > nvector<T>
fabs(const nvector<T>& x)
template< typename T > nvector<T>
minimum(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<T>
maximum(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<T>
minimum(const nvector<T>& x, const T& y)
template< typename T > nvector<T>
maximum(const nvector<T>& x, const T& y)
template< typename T > nvector<T>
minimum(const T& x, const nvector<T>& y)
template< typename T > nvector<T>
maximum(const T& x, const nvector<T>& y)
template< typename T > nvector<T>
ceil(const nvector< interval<T> >& x)
template< typename T > nvector<T>
floor(const nvector< interval<T> >& x)
template< typename T > nvector<T>
fmod(const nvector<T>& x, const nvector<T>& y)
template< typename T > nvector<T>
fmod(const nvector<T>& x, const T& y)
template< typename T > nvector<T>
fmod(const T& x, const nvector<T>& y)
template< typename T > nvector<T>
sqr(const nvector<T>& x)
template< typename T > nvector<T>
cbrt(const nvector<T>& x)
These functions are defined only for nvectors instan-
tiated on interval data types: interval<float>,
interval<double> and interval<long double>. Returns a new
nvector object of the same size as the argument vector
(vectors) where each element has been initialized by
applying the indicated function to the corresponding
elements in the argument vector (vectors).
OTHER NON-MEMBER FUNCTIONS
// sum of all elements
template< typename T > T
sum(const nvector<T>& x)
Returns sum of all elements of vector x
// product of all elements
template< typename T > T
product(const nvector<T>& x)
Returns product of all elements of vector x
// scalar product of two vectors
template< typename T > T
dot_product(const nvector<T>& x, const nvector<T>& y);
Returns scalar product of vectors x and y.
// output to a stream
template< typename T >
ostream& operator<< (ostream& out, const nvector<T>& x);
Outputs all elements of x to a stream out.
EXAMPLE
#include <iostream.h>
#include <suninterval_vector.h>
using namespace SUNW_interval;
main()
{
// create two vectors
nvector< interval<double> > v1( interval<double>(2.0,
3.0), 10);
nvector< double > v2(10);
// compute middle points of v1 elements
v2 = mid(v1);
// print them out
cout << v2 << endl;
// print scalar product of vectors v1 and v1*v1
cout << dot_product(v1, v1*v1) << endl;
}