vtf-logo

Free functions for SparseArraySigned.


Functions

template<typename T>
void ads::merge (const SparseArraySigned< 1, T > &a, const SparseArraySigned< 1, T > &b, SparseArraySigned< 1, T > &c)
 Merge the arrays.
template<typename T>
void ads::remove_unecessary_elements (SparseArraySigned< 1, T > &a)
 Remove the unecessary elements.
template<typename T>
void ads::compute_union (const SparseArraySigned< 1, T > &a, const SparseArraySigned< 1, T > &b, SparseArraySigned< 1, T > &c)
 Compute the union of the arrays.
template<typename T>
void ads::compute_intersection (const SparseArraySigned< 1, T > &a, const SparseArraySigned< 1, T > &b, SparseArraySigned< 1, T > &c)
 Compute the intersection of the arrays.
template<int N, typename T>
bool ads::operator== (const SparseArraySigned< N, T > &x, const SparseArraySigned< N, T > &y)
 Return true if the arrays are equal.
template<int N, typename T>
bool ads::operator!= (const SparseArraySigned< N, T > &x, const SparseArraySigned< N, T > &y)
 Return true if the arrays are not equal.
template<int N, typename T>
std::ostream & ads::operator<< (std::ostream &out, const SparseArraySigned< N, T > &x)
 Write a SparseArraySigned in ascii format.
template<int N, typename T>
std::istream & ads::operator>> (std::istream &in, SparseArraySigned< N, T > &x)
 Read a SparseArraySigned in ascii format.

Detailed Description

We use the sum(), product(), min() and max() defined for SparseArray.

Function Documentation

template<int N, typename T>
std::ostream& ads::operator<< ( std::ostream &  out,
const SparseArraySigned< N, T > &  x 
) [inline]

Write a SparseArraySigned in ascii format.

Here is the 1-D file format. size indicates the number of non-null elements.

  null_value
  sign
  size
  index[0]
  ...
  index[size-1]
  value[0]
  ...
  value[size-1] 

template<int N, typename T>
std::istream& ads::operator>> ( std::istream &  in,
SparseArraySigned< N, T > &  x 
) [inline]

Read a SparseArraySigned in ascii format.

Here is the 1-D file format. size indicates the number of non-null elements.

  null_value
  sign
  size
  index[0]
  ...
  index[size-1]
  value[0]
  ...
  value[size-1] 

template<typename T>
void ads::remove_unecessary_elements ( SparseArraySigned< 1, T > &  a  ) 

Remove the unecessary elements.

Remove positive elements that do not have an adjacent non-positive neighbor and vice-versa.


Generated on Fri Aug 24 12:55:37 2007 for Algorithms and Data Structures Package by  doxygen 1.4.7