libStatGen Software 1
Loading...
Searching...
No Matches
QuickIndex Class Reference
Inheritance diagram for QuickIndex:
Collaboration diagram for QuickIndex:

Public Member Functions

 QuickIndex (const IntArray &source_data)
 
 QuickIndex (const StringArray &source_data)
 
 QuickIndex (const Vector &source_data)
 
void Index (const IntArray &source_data)
 
void Index (const StringArray &source_data)
 
void Index (const Vector &source_data)
 
void IndexCounts (const StringIntMap &source_data)
 
void IndexCounts (const StringIntHash &source_data)
 
- Public Member Functions inherited from IntArray
 IntArray (int start_size=0)
 
 IntArray (const IntArray &source)
 
IntArrayoperator= (const IntArray &rhs)
 
int & operator[] (int index)
 
int operator[] (int index) const
 
int & operator[] (char index)
 
int operator[] (char index) const
 
int & operator[] (double fraction)
 
int operator[] (double fraction) const
 
int Append (int value)
 
int Append (const IntArray &rhs)
 
void Push (int value)
 
int Pop ()
 
int Peek () const
 
int & Last () const
 
void PushIfNew (int value)
 
int Delete (int index)
 
void InsertAt (int index, int value)
 
int Find (int value) const
 
int FastFind (int value) const
 
int BinarySearch (int value) const
 
void Sort ()
 
void Sort (IntArray &freeRider)
 
void Zero ()
 
void Set (int value)
 
void SetSequence (int start=0, int increment=1)
 
int Length () const
 
void Dimension (int new_count)
 
void Clear ()
 
int Sum () const
 
int Sum (int start) const
 
int Sum (int start, int end) const
 
double dSum () const
 
double dSum (int start) const
 
double dSum (int start, int end) const
 
int SumProduct (const IntArray &weight) const
 
double dSumProduct (const IntArray &weight) const
 
int Max () const
 
int Max (int start) const
 
int Max (int start, int end) const
 
int Min () const
 
int Min (int start) const
 
int Min (int start, int end) const
 
int Count () const
 
int CountIfGreater (int treshold) const
 
int CountIfGreaterOrEqual (int treshold) const
 
void Swap (int i, int j)
 
void Reverse ()
 
 operator int * ()
 
void Add (int term)
 
void Subtract (int term)
 
void Multiply (int factor)
 
void Divide (int denominator)
 
void Add (const IntArray &rhs)
 
IntArrayoperator+= (int rhs)
 
IntArrayoperator+= (const IntArray &rhs)
 
IntArrayoperator*= (int rhs)
 
IntArrayoperator-= (int rhs)
 
IntArrayoperator/= (int rhs)
 
int InnerProduct (IntArray &v)
 
bool operator== (const IntArray &rhs) const
 
bool operator!= (const IntArray &rhs) const
 
bool isAscending ()
 
bool isDescending ()
 
void Stack (const IntArray &rhs)
 
void Swap (IntArray &rhs)
 
void Print ()
 
void Print (const char *label)
 
void Print (FILE *output)
 
void Print (FILE *output, const char *label)
 
int Product ()
 
double DoubleProduct ()
 
int Hash (int initval=0)
 

Additional Inherited Members

- Static Public Attributes inherited from IntArray
static int alloc = 4
 

Detailed Description

Definition at line 27 of file QuickIndex.h.

Constructor & Destructor Documentation

◆ QuickIndex() [1/4]

QuickIndex::QuickIndex ( )

Definition at line 26 of file QuickIndex.cpp.

27{
28 source = NULL;
29 datatype = __QI_INVALID;
30}

◆ QuickIndex() [2/4]

QuickIndex::QuickIndex ( const IntArray source_data)
inline

Definition at line 31 of file QuickIndex.h.

32 {
33 Index(source_data);
34 }

◆ QuickIndex() [3/4]

QuickIndex::QuickIndex ( const StringArray source_data)
inline

Definition at line 35 of file QuickIndex.h.

36 {
37 Index(source_data);
38 }

◆ QuickIndex() [4/4]

QuickIndex::QuickIndex ( const Vector source_data)
inline

Definition at line 39 of file QuickIndex.h.

40 {
41 Index(source_data);
42 }

Member Function Documentation

◆ Index() [1/3]

void QuickIndex::Index ( const IntArray source_data)

Definition at line 32 of file QuickIndex.cpp.

33{
34 source = (const void *) &source_data;
35 datatype = __QI_INTARRAY;
36
37 Dimension(source_data.Length());
38 SetSequence();
39 Sort();
40}

◆ Index() [2/3]

void QuickIndex::Index ( const StringArray source_data)

Definition at line 52 of file QuickIndex.cpp.

53{
54 source = (const void *) &source_data;
55 datatype = __QI_STRINGARRAY;
56
57 Dimension(source_data.Length());
58 SetSequence();
59 Sort();
60}

◆ Index() [3/3]

void QuickIndex::Index ( const Vector source_data)

Definition at line 42 of file QuickIndex.cpp.

43{
44 source = (const void *) &source_data;
45 datatype = __QI_VECTOR;
46
47 Dimension(source_data.Length());
48 SetSequence();
49 Sort();
50}

◆ IndexCounts() [1/2]

void QuickIndex::IndexCounts ( const StringIntHash source_data)

Definition at line 72 of file QuickIndex.cpp.

73{
74 IntArray counts(source_data.Capacity());
75
76 for (int i = 0; i < source_data.Capacity(); i++)
77 if (source_data.SlotInUse(i))
78 counts[i] = source_data.Integer(i);
79 else
80 counts[i] = -1;
81
82 Index(counts);
83
84 Reverse();
85 Dimension(source_data.Entries());
86 Reverse();
87}

◆ IndexCounts() [2/2]

void QuickIndex::IndexCounts ( const StringIntMap source_data)

Definition at line 62 of file QuickIndex.cpp.

63{
64 IntArray counts(source_data.Length());
65
66 for (int i = 0; i < source_data.Length(); i++)
67 counts[i] = source_data.GetCount(i);
68
69 Index(counts);
70}

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