vtf-logo

SparseArraySigned.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00008 #if !defined(__ads_SparseArraySigned_h__)
00009 #define __ads_SparseArraySigned_h__
00010 
00011 // If we are debugging the whole ads package.
00012 #if defined(DEBUG_ads) && !defined(DEBUG_ads_SparseArraySigned)
00013 #define DEBUG_ads_SparseArraySigned
00014 #endif
00015 
00016 #include "SparseArray.h"
00017 
00018 
00019 BEGIN_NAMESPACE_ADS
00020 
00021 
00022 // Note: Doxygen will not pick up this class documentation because it is a 
00023 // declaration and there is no class definition.  Only specializations are
00024 // defined.
00026 
00030 template<int N, typename T = double>
00031 class SparseArraySigned;
00032 
00033 
00034 //-----------------------------------------------------------------------------
00039 
00040 //
00041 // Mathematical functions
00042 //
00043 
00044 
00046 template<typename T>
00047 void
00048 merge(const SparseArraySigned<1,T>& a, const SparseArraySigned<1,T>& b, 
00049       SparseArraySigned<1,T>& c);
00050 
00051 
00053 
00057 template<typename T>
00058 void
00059 remove_unecessary_elements(SparseArraySigned<1,T>& a);
00060 
00061 
00063 template<typename T>
00064 void
00065 compute_union(const SparseArraySigned<1,T>& a, 
00066               const SparseArraySigned<1,T>& b, 
00067               SparseArraySigned<1,T>& c);
00068 
00069 
00071 template<typename T>
00072 void
00073 compute_intersection(const SparseArraySigned<1,T>& a, 
00074                       const SparseArraySigned<1,T>& b, 
00075                       SparseArraySigned<1,T>& c);
00076 
00077 
00078 //
00079 // Equality.
00080 //
00081 
00083 template<int N, typename T>
00084 inline
00085 bool
00086 operator==(const SparseArraySigned<N,T>& x, const SparseArraySigned<N,T>& y) {
00087   return x.equal(y);
00088 }
00089 
00091 template<int N, typename T>
00092 inline
00093 bool
00094 operator!=(const SparseArraySigned<N,T>& x, const SparseArraySigned<N,T>& y) {
00095   return !(x == y);
00096 }
00097 
00098 //
00099 // File I/O.
00100 //
00101 
00103 
00117 template<int N, typename T>
00118 inline
00119 std::ostream&
00120 operator<<(std::ostream& out, const SparseArraySigned<N,T>& x) {
00121   x.put(out);
00122   return out;
00123 }
00124 
00125 
00127 
00141 template<int N, typename T>
00142 inline
00143 std::istream&
00144 operator>>(std::istream& in, SparseArraySigned<N,T>& x) {
00145   x.get(in);
00146   return in;
00147 }
00148 
00149 
00151 
00152 
00153 END_NAMESPACE_ADS
00154 
00155 #define __ads_SparseArraySigned1_h__
00156 #include "SparseArraySigned1.h"
00157 #undef __ads_SparseArraySigned1_h__
00158 
00159 //#define __SparseArraySigned2_ipp__
00160 //#include "SparseArraySigned2.ipp"
00161 //#undef __SparseArraySigned2_ipp__
00162 
00163 //#define __SparseArraySigned_ipp__
00164 //#include "SparseArraySigned.ipp"
00165 //#undef __SparseArraySigned_ipp__
00166 
00167 #endif

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