SNAP Library 6.0, User Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TLFlt Class Reference

#include <dt.h>

Public Member Functions

 TLFlt ()
 
 TLFlt (const ldouble &_Val)
 
 operator ldouble () const
 
 TLFlt (TSIn &SIn)
 
void Save (TSOut &SOut) const
 
void LoadXml (const PXmlTok &XmlTok, const TStr &Nm)
 
void SaveXml (TSOut &SOut, const TStr &Nm) const
 
TLFltoperator= (const TLFlt &LFlt)
 
bool operator== (const TLFlt &LFlt) const _CMPWARN
 
bool operator== (const ldouble &LFlt) const _CMPWARN
 
bool operator!= (const ldouble &LFlt) const _CMPWARN
 
bool operator< (const TLFlt &LFlt) const
 
ldouble operator() () const
 
TLFltoperator+= (const ldouble &LFlt)
 
TLFltoperator-= (const ldouble &LFlt)
 
int GetMemUsed () const
 
int GetPrimHashCd () const
 
int GetSecHashCd () const
 

Static Public Member Functions

static TStr GetStr (const ldouble &Val, const int &Width=-1, const int &Prec=-1)
 
static TStr GetStr (const TLFlt &LFlt, const int &Width=-1, const int &Prec=-1)
 
static TStr GetStr (const ldouble &Val, const char *FmtStr)
 
static TStr GetStr (const ldouble &Val, const TStr &FmtStr)
 

Public Attributes

ldouble Val
 

Static Public Attributes

static const ldouble Mn =-LDBL_MAX
 
static const ldouble Mx =+LDBL_MAX
 

Detailed Description

Definition at line 1537 of file dt.h.

Constructor & Destructor Documentation

TLFlt::TLFlt ( )
inline

Definition at line 1544 of file dt.h.

1544 : Val(0){}
ldouble Val
Definition: dt.h:1539
TLFlt::TLFlt ( const ldouble _Val)
inline

Definition at line 1545 of file dt.h.

1545 : Val(_Val){}
ldouble Val
Definition: dt.h:1539
TLFlt::TLFlt ( TSIn SIn)
inlineexplicit

Definition at line 1547 of file dt.h.

1547 {SIn.Load(Val);}
void Load(bool &Bool)
Definition: fl.h:84
ldouble Val
Definition: dt.h:1539

Member Function Documentation

int TLFlt::GetMemUsed ( ) const
inline

Definition at line 1560 of file dt.h.

1560 {return sizeof(TLFlt);}
TLFlt()
Definition: dt.h:1544
int TLFlt::GetPrimHashCd ( ) const
inline

Definition at line 1562 of file dt.h.

1562 {Fail; return 0;}
#define Fail
Definition: bd.h:238
int TLFlt::GetSecHashCd ( ) const
inline

Definition at line 1563 of file dt.h.

1563 {Fail; return 0;}
#define Fail
Definition: bd.h:238
TStr TLFlt::GetStr ( const ldouble Val,
const int &  Width = -1,
const int &  Prec = -1 
)
static

Definition at line 2284 of file dt.cpp.

2284  {
2285  char Bf[255];
2286  if ((Width==-1)&&(Prec==-1)){sprintf(Bf, "%Lg", Val);}
2287  else {sprintf(Bf, "%*.*Lf", Width, Prec, Val);}
2288  return TStr(Bf);
2289 }
Definition: dt.h:412
ldouble Val
Definition: dt.h:1539
static TStr TLFlt::GetStr ( const TLFlt LFlt,
const int &  Width = -1,
const int &  Prec = -1 
)
inlinestatic

Definition at line 1566 of file dt.h.

1566  {
1567  return GetStr(LFlt.Val, Width, Prec);}
ldouble Val
Definition: dt.h:1539
static TStr GetStr(const ldouble &Val, const int &Width=-1, const int &Prec=-1)
Definition: dt.cpp:2284
TStr TLFlt::GetStr ( const ldouble Val,
const char *  FmtStr 
)
static

Definition at line 2291 of file dt.cpp.

2291  {
2292  if (FmtStr==NULL){
2293  return GetStr(Val);
2294  } else {
2295  char Bf[255];
2296  sprintf(Bf, FmtStr, Val);
2297  return TStr(Bf);
2298  }
2299 }
Definition: dt.h:412
ldouble Val
Definition: dt.h:1539
static TStr GetStr(const ldouble &Val, const int &Width=-1, const int &Prec=-1)
Definition: dt.cpp:2284
static TStr TLFlt::GetStr ( const ldouble Val,
const TStr FmtStr 
)
inlinestatic

Definition at line 1569 of file dt.h.

1569  {
1570  return GetStr(Val, FmtStr.CStr());}
ldouble Val
Definition: dt.h:1539
static TStr GetStr(const ldouble &Val, const int &Width=-1, const int &Prec=-1)
Definition: dt.cpp:2284
char * CStr()
Definition: dt.h:479
void TLFlt::LoadXml ( const PXmlTok XmlTok,
const TStr Nm 
)

Definition at line 2275 of file dt.cpp.

2275  {
2276  XLoadHd(Nm);
2277  Val=TXmlObjSer::GetFltArg(XmlTok, "Val");
2278 }
#define XLoadHd(Nm)
Definition: bd.h:312
static double GetFltArg(const PXmlTok &XmlTok, const TStr &Nm)
Definition: xml.cpp:104
ldouble Val
Definition: dt.h:1539
TLFlt::operator ldouble ( ) const
inline

Definition at line 1546 of file dt.h.

1546 {return Val;}
ldouble Val
Definition: dt.h:1539
bool TLFlt::operator!= ( const ldouble LFlt) const
inline

Definition at line 1555 of file dt.h.

1555 {return Val!=LFlt;}
ldouble Val
Definition: dt.h:1539
ldouble TLFlt::operator() ( ) const
inline

Definition at line 1557 of file dt.h.

1557 {return Val;}
ldouble Val
Definition: dt.h:1539
TLFlt& TLFlt::operator+= ( const ldouble LFlt)
inline

Definition at line 1558 of file dt.h.

1558 {Val+=LFlt; return *this;}
ldouble Val
Definition: dt.h:1539
TLFlt& TLFlt::operator-= ( const ldouble LFlt)
inline

Definition at line 1559 of file dt.h.

1559 {Val-=LFlt; return *this;}
ldouble Val
Definition: dt.h:1539
bool TLFlt::operator< ( const TLFlt LFlt) const
inline

Definition at line 1556 of file dt.h.

1556 {return Val<LFlt.Val;}
ldouble Val
Definition: dt.h:1539
TLFlt& TLFlt::operator= ( const TLFlt LFlt)
inline

Definition at line 1552 of file dt.h.

1552 {Val=LFlt.Val; return *this;}
ldouble Val
Definition: dt.h:1539
bool TLFlt::operator== ( const TLFlt LFlt) const
inline

Definition at line 1553 of file dt.h.

1553 {return Val==LFlt.Val;}
ldouble Val
Definition: dt.h:1539
bool TLFlt::operator== ( const ldouble LFlt) const
inline

Definition at line 1554 of file dt.h.

1554 {return Val==LFlt;}
ldouble Val
Definition: dt.h:1539
void TLFlt::Save ( TSOut SOut) const
inline

Definition at line 1548 of file dt.h.

1548 {SOut.Save(Val);}
void Save(const bool &Bool)
Definition: fl.h:173
ldouble Val
Definition: dt.h:1539
void TLFlt::SaveXml ( TSOut SOut,
const TStr Nm 
) const

Definition at line 2280 of file dt.cpp.

2280  {
2281  XSaveBETagArg(Nm, "Val", TFlt::GetStr(double(Val)));
2282 }
#define XSaveBETagArg(Nm, ArgNm, ArgVal)
Definition: bd.h:327
TStr GetStr() const
Definition: dt.h:1462
ldouble Val
Definition: dt.h:1539

Member Data Documentation

const ldouble TLFlt::Mn =-LDBL_MAX
static

Definition at line 1541 of file dt.h.

const ldouble TLFlt::Mx =+LDBL_MAX
static

Definition at line 1542 of file dt.h.

ldouble TLFlt::Val

Definition at line 1539 of file dt.h.


The documentation for this class was generated from the following files: