Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

smatrix::const_svector_ref Class Template Reference

#include <Smatrix.hpp>

Inheritance diagram for smatrix::const_svector_ref::

smatrix::svector_ref List of all members.

Public Types

typedef map< size_t, size_t
>::const_iterator 
const_iterator

Public Methods

 const_svector_ref (const smatrix< t > *pm, const rng &i, size_t j)
 const_svector_ref (const smatrix< t > *pm, size_t i, const rng &j)
const map< size_t, size_t > * GetMap () const
const_iterator lower_bound (size_t i) const
svector operator * (const t &b)
GetEpsilon () const
Coef (const_iterator p) const
operator() (size_t n) const
bool operator!= (const const_svector_ref &b)
template<class tb> t operator * (const tb &b)
template<class tb> svector operator+ (const tb &b) const
template<class tb> svector operator- (const tb &b) const

Static Public Methods

size_t Index (const_iterator p)

Public Attributes

const smatrix< t > * cm
rng range
size_t n
bool bColVect

template<class t>
class smatrix< t >::const_svector_ref


Member Typedef Documentation

template<class t>
typedef map<size_t, size_t>::const_iterator smatrix::const_svector_ref::const_iterator
 

Definition at line 362 of file Smatrix.hpp.


Constructor & Destructor Documentation

template<class t>
smatrix< t >::const_svector_ref::const_svector_ref const smatrix< t > *    pm,
const rng   i,
size_t    j
[inline]
 

Definition at line 364 of file Smatrix.hpp.

00364                                                                         :
00365             cm(pm), range(i), n(j), bColVect(true) { }

template<class t>
smatrix< t >::const_svector_ref::const_svector_ref const smatrix< t > *    pm,
size_t    i,
const rng   j
[inline]
 

Definition at line 366 of file Smatrix.hpp.

00366                                                                         :
00367             cm(pm), range(j), n(i), bColVect(false) { }


Member Function Documentation

template<class t>
t smatrix< t >::const_svector_ref::Coef const_iterator    p const [inline]
 

Definition at line 392 of file Smatrix.hpp.

Referenced by operator *(), and operator!=().

00392 { return(cm->e[p->second]); }

template<class t>
t smatrix< t >::const_svector_ref::GetEpsilon   const [inline]
 

Definition at line 390 of file Smatrix.hpp.

Referenced by operator *(), operator+(), and operator-().

00390 { return(cm->epsilon); }

template<class t>
const map<size_t, size_t>* smatrix< t >::const_svector_ref::GetMap   const [inline]
 

Definition at line 368 of file Smatrix.hpp.

Referenced by lower_bound(), and operator()().

00369         {
00370             if(bColVect && n < cm->jMap->size())
00371                 return((*cm->jMap)[n]);
00372             if(!bColVect && n < cm->iMap->size())
00373                 return((*cm->iMap)[n]);
00374             return((*cm->iMap)[0]);
00375         }

template<class t>
size_t smatrix< t >::const_svector_ref::Index const_iterator    p [inline, static]
 

Definition at line 391 of file Smatrix.hpp.

Referenced by operator!=().

00391 { return(p->first); }

template<class t>
const_iterator smatrix< t >::const_svector_ref::lower_bound size_t    i const [inline]
 

Definition at line 376 of file Smatrix.hpp.

Referenced by operator *(), and operator!=().

00377         {
00378             return(GetMap()->lower_bound(i));
00379         }

template<class t>
template<class tb>
t smatrix< t >::const_svector_ref::operator * const tb &    b [inline]
 

Definition at line 413 of file Smatrix.hpp.

00414         {
00415             return(smatrix<t>::svMultiply(*this, b));
00416         }

template<class t>
svector smatrix< t >::const_svector_ref::operator * const t &    b [inline]
 

Definition at line 380 of file Smatrix.hpp.

00381         {
00382             svector c(GetEpsilon() * b);
00383             c.range = range;
00384             const_iterator i = lower_bound(range.first);
00385             const_iterator iEnd = lower_bound(range.second + 1);
00386             for(; i != iEnd; i++) 
00387                 c.insert(c.end(), i->first, Coef(i) * b);
00388             return(c);
00389         }

template<class t>
bool smatrix< t >::const_svector_ref::operator!= const const_svector_ref &    b [inline]
 

Definition at line 399 of file Smatrix.hpp.

00400         {
00401             if(range.first != b.range.first || range.second != b.range.second) return(true);
00402             const_iterator ia = lower_bound(range.first);
00403             const_iterator iaEnd = lower_bound(range.second + 1);
00404             const_iterator ib = b.lower_bound(b.range.first);
00405             const_iterator ibEnd = b.lower_bound(b.range.second + 1);
00406             for(; ia != iaEnd && ib != ibEnd; ia++, ib++)
00407             {
00408                 if(Index(ia) != b.Index(ib)) return(true);
00409                 if(Coef(ia) != b.Coef(ib)) return(true);
00410             }
00411             return(ia != iaEnd || ib != ibEnd);
00412         }

template<class t>
t smatrix< t >::const_svector_ref::operator() size_t    n const [inline]
 

Definition at line 393 of file Smatrix.hpp.

00394         {
00395             const map<size_t, size_t> *Map = GetMap();
00396             const_iterator p = Map->find(n);
00397             return(p == Map->end() ? 0 : cm->e[p->second]);
00398         }

template<class t>
template<class tb>
svector smatrix< t >::const_svector_ref::operator+ const tb &    b const [inline]
 

Definition at line 417 of file Smatrix.hpp.

00418         {
00419             svector c(max(GetEpsilon(), b.GetEpsilon()));
00420             svAssign(c, *this);
00421             return(svAddEq(c, b, false));
00422         }

template<class t>
template<class tb>
svector smatrix< t >::const_svector_ref::operator- const tb &    b const [inline]
 

Definition at line 423 of file Smatrix.hpp.

00424         {
00425             svector c(max(GetEpsilon(), b.GetEpsilon()));
00426             svAssign(c, *this);
00427             return(svAddEq(c, b, true));
00428         }


Member Data Documentation

template<class t>
bool smatrix::const_svector_ref::bColVect
 

Definition at line 360 of file Smatrix.hpp.

template<class t>
const smatrix<t>* smatrix::const_svector_ref::cm
 

Definition at line 357 of file Smatrix.hpp.

template<class t>
size_t smatrix::const_svector_ref::n
 

Definition at line 359 of file Smatrix.hpp.

template<class t>
rng smatrix::const_svector_ref::range
 

Definition at line 358 of file Smatrix.hpp.


The documentation for this class was generated from the following file:
Generated on Sun Oct 14 18:50:30 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001