CPPLapack
 All Classes Files Functions Variables Friends Pages
dcomponent.hpp
Go to the documentation of this file.
1 //=============================================================================
2 //! Component Class for Real Double-precision Sparse Matrix Classes
3 class dcomponent
4 {
5 public:
6  ///////////////////////////////////////////////
7  /////////////////// objects ///////////////////
8  ///////////////////////////////////////////////
9  CPPL_INT i; //!< i index of the component
10  CPPL_INT j; //!< j index of the component
11  double v; //!< value of the component
12 
13  ///////////////////////////////////////////////
14  ///////////////// constructors ////////////////
15  ///////////////////////////////////////////////
16  inline dcomponent(){ ; }
17  inline dcomponent(const CPPL_INT& _i, const CPPL_INT& _j, const double& _v) :i(_i), j(_j), v(_v){ ; }
18 
19  ///////////////////////////////////////////////
20  ////////////////// functions //////////////////
21  ///////////////////////////////////////////////
22  inline friend std::ostream& operator<<(std::ostream&, const dcomponent&);
23  inline static bool ilt(const dcomponent&, const dcomponent&);
24  inline static bool jlt(const dcomponent&, const dcomponent&);
25 };
26 
27 ///////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////
29 ///////////////////////////////////////////////////////////////////////////////
30 
31 //=============================================================================
32 inline std::ostream& operator<<(std::ostream& s, const dcomponent& c)
33 {CPPL_VERBOSE_REPORT;
34  s << "(" << c.i << ", " << c.j << ", " << c.v << ")" << std::flush;
35  return s;
36 }
37 
38 //=============================================================================
39 /*! lessthan function for i of dcomponent */
40 inline bool dcomponent::ilt(const dcomponent& a, const dcomponent& b)
41 {CPPL_VERBOSE_REPORT;
42  return a.i < b.i;
43 }
44 
45 //=============================================================================
46 /*! lessthan function for j of dcomponent */
47 inline bool dcomponent::jlt(const dcomponent& a, const dcomponent& b)
48 {CPPL_VERBOSE_REPORT;
49  return a.j < b.j;
50 }
std::ostream & operator<<(std::ostream &s, const dcomponent &c)
Definition: dcomponent.hpp:32
Component Class for Real Double-precision Sparse Matrix Classes.
Definition: dcomponent.hpp:3
double v
value of the component
Definition: dcomponent.hpp:11
CPPL_INT i
i index of the component
Definition: dcomponent.hpp:9
dcomponent(const CPPL_INT &_i, const CPPL_INT &_j, const double &_v)
Definition: dcomponent.hpp:17
static bool jlt(const dcomponent &, const dcomponent &)
Definition: dcomponent.hpp:47
static bool ilt(const dcomponent &, const dcomponent &)
Definition: dcomponent.hpp:40
CPPL_INT j
j index of the component
Definition: dcomponent.hpp:10
friend std::ostream & operator<<(std::ostream &, const dcomponent &)
Definition: dcomponent.hpp:32