Menu

[r193]: / trunk / include / misc / zcomponent.hpp  Maximize  Restore  History

Download this file

53 lines (45 with data), 2.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//=============================================================================
//! Component Class for Complex Double-precision Sparse Matrix Classes
class zcomponent
{
public:
///////////////////////////////////////////////
/////////////////// objects ///////////////////
///////////////////////////////////////////////
CPPL_INT i; //!< i index of the component
CPPL_INT j; //!< j index of the component
comple v; //!< value of the component
///////////////////////////////////////////////
///////////////// constructors ////////////////
///////////////////////////////////////////////
inline zcomponent(){ ; }
inline zcomponent(const CPPL_INT& _i, const CPPL_INT& _j, const comple& _v) :i(_i), j(_j), v(_v){ ; }
///////////////////////////////////////////////
////////////////// functions //////////////////
///////////////////////////////////////////////
inline friend std::ostream& operator<<(std::ostream&, const zcomponent&);
};
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//=============================================================================
inline std::ostream& operator<<(std::ostream& s, const zcomponent& c)
{CPPL_VERBOSE_REPORT;
s << "(" << c.i << ", " << c.j << ", " << c.v << ")" << std::flush;
return s;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//=============================================================================
/*! lessthan function for i of zcomponent */
inline bool ilt(const zcomponent& a, const zcomponent& b)
{CPPL_VERBOSE_REPORT;
return a.i < b.i;
}
//=============================================================================
/*! lessthan function for j of zcomponent */
inline bool jlt(const zcomponent& a, const zcomponent& b)
{CPPL_VERBOSE_REPORT;
return a.j < b.j;
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.