SNAP Library 2.1, User Reference
2013-09-25 10:47:25
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <xmath.h>
Public Member Functions | |
TComb () | |
TComb (const int &_Items, const int &_Order) | |
~TComb () | |
TComb (TSIn &) | |
void | Save (TSOut &) |
TComb & | operator= (const TComb &) |
bool | GetNext () |
TIntV & | GetItemV () |
int | GetCombN () const |
int | GetCombs () const |
void | Wr () |
Static Public Member Functions | |
static PComb | New (const int &Items, const int &Order) |
static PComb | Load (TSIn &SIn) |
Public Attributes | |
int | Items |
int | Order |
int | CombN |
TIntV | ItemV |
Private Attributes | |
TCRef | CRef |
Friends | |
class | TPt< TComb > |
TComb::TComb | ( | ) | [inline] |
TComb::TComb | ( | const int & | _Items, |
const int & | _Order | ||
) | [inline] |
TComb::~TComb | ( | ) | [inline] |
TComb::TComb | ( | TSIn & | ) | [inline] |
int TComb::GetCombN | ( | ) | const [inline] |
int TComb::GetCombs | ( | ) | const |
TIntV& TComb::GetItemV | ( | ) | [inline] |
bool TComb::GetNext | ( | ) |
Definition at line 724 of file xmath.cpp.
{ if (ItemV.Len()==0){ ItemV.Gen(Order, Order); for (int OrderN=0; OrderN<Order; OrderN++){ ItemV[OrderN]=OrderN;} return true; } else { if (ItemV.Last()==Items-1){ int OrderN=Order-1; while ((OrderN>=0)&&(ItemV[OrderN]==Items-(Order-OrderN-1)-1)){OrderN--;} if (OrderN<0){ return false; } else { ItemV[OrderN]++; for (int SubOrderN=OrderN+1; SubOrderN<Order; SubOrderN++){ ItemV[SubOrderN]=ItemV[SubOrderN-1]+1;} CombN++; return true; } } else { ItemV.Last()++; CombN++; return true; } } }
static PComb TComb::Load | ( | TSIn & | SIn | ) | [inline, static] |
static PComb TComb::New | ( | const int & | Items, |
const int & | Order | ||
) | [inline, static] |
void TComb::Save | ( | TSOut & | ) | [inline] |
void TComb::Wr | ( | ) |
int TComb::CombN |
TCRef TComb::CRef [private] |
int TComb::Items |
int TComb::Order |