Free functions for SparseArraySigned.

Functions

template<typename T >
void merge (const SparseArraySigned< 1, T > &a, const SparseArraySigned< 1, T > &b, SparseArraySigned< 1, T > &c)
 Merge the arrays.
template<typename T >
void remove_unecessary_elements (SparseArraySigned< 1, T > &a)
 Remove the unecessary elements.
template<typename T >
void 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 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 operator== (const SparseArraySigned< N, T > &x, const SparseArraySigned< N, T > &y)
 Return true if the arrays are equal.
template<int N, typename T >
bool 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 & operator<< (std::ostream &out, const SparseArraySigned< N, T > &x)
 Write a SparseArraySigned in ascii format.
template<int N, typename T >
std::istream & 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& 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& 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 remove_unecessary_elements ( SparseArraySigned< 1, T > &  a  )  [inline]

Remove the unecessary elements.

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

Generated on Thu Jun 30 02:14:51 2016 for Algorithms and Data Structures Package by  doxygen 1.6.3