EMAN2
Classes | Public Member Functions | Static Private Member Functions | Private Attributes
Maxclique::Vertices Class Reference
Collaboration diagram for Maxclique::Vertices:
Collaboration graph
[legend]

List of all members.

Classes

class  Vertex

Public Member Functions

 Vertices (int size)
 ~Vertices ()
void dispose ()
void sort ()
void init_colors ()
void set_degrees (Maxclique &)
int size () const
void push (const int ii)
void pop ()
Vertexat (const int ii) const
Vertexend () const

Static Private Member Functions

static bool desc_degree (const Vertex vi, const Vertex vj)

Private Attributes

Vertexv
int sz

Detailed Description

Definition at line 38 of file mcqd.h.


Constructor & Destructor Documentation

Maxclique::Vertices::Vertices ( int  size) [inline]

Definition at line 59 of file mcqd.h.

References v.

: sz(0) { v = new Vertex[size]; }
Maxclique::Vertices::~Vertices ( ) [inline]

Definition at line 60 of file mcqd.h.

{}

Member Function Documentation

Vertex& Maxclique::Vertices::at ( const int  ii) const [inline]

Definition at line 68 of file mcqd.h.

References v.

Referenced by Maxclique::color_sort(), and Maxclique::cut2().

{ return v[ii]; };
static bool Maxclique::Vertices::desc_degree ( const Vertex  vi,
const Vertex  vj 
) [inline, static, private]

Definition at line 49 of file mcqd.h.

References Maxclique::Vertices::Vertex::get_degree().

{ return (vi.get_degree() > vj.get_degree()); }
void Maxclique::Vertices::dispose ( ) [inline]

Definition at line 61 of file mcqd.h.

References v.

{ if (v) delete [] v; }
Vertex& Maxclique::Vertices::end ( void  ) const [inline]

Definition at line 69 of file mcqd.h.

References v.

Referenced by Maxclique::cut2(), Maxclique::expand(), and Maxclique::expand_dyn().

{ return v[sz - 1]; };
void Maxclique::Vertices::init_colors ( )

Definition at line 177 of file mcqd.h.

References Maxclique::Vertices::Vertex::get_degree(), sz, and v.

Referenced by Maxclique::_mcq().

                                    { 
  const int max_degree = v[0].get_degree();
  for (int i = 0; i < max_degree; i++)
    v[i].set_degree(i + 1);
  for (int i = max_degree; i < sz; i++)
    v[i].set_degree(max_degree + 1);
}
void Maxclique::Vertices::pop ( ) [inline]

Definition at line 67 of file mcqd.h.

Referenced by Maxclique::expand(), and Maxclique::expand_dyn().

{ sz--; };
void Maxclique::Vertices::push ( const int  ii) [inline]

Definition at line 66 of file mcqd.h.

References v.

Referenced by Maxclique::cut2(), and Maxclique::Maxclique().

{ v[sz++].set_i(ii); };
void Maxclique::Vertices::set_degrees ( Maxclique m)

Definition at line 185 of file mcqd.h.

References Maxclique::connection(), and v.

Referenced by Maxclique::_mcq(), and Maxclique::degree_sort().

                                                { 
  for (int i=0; i < sz; i++) {
    int d = 0;
    for (int j=0; j < sz; j++)
      if (m.connection(v[i].get_i(), v[j].get_i())) d++;
    v[i].set_degree(d);
  }
}
int Maxclique::Vertices::size ( ) const [inline]
void Maxclique::Vertices::sort ( ) [inline]

Definition at line 62 of file mcqd.h.

References v.

Referenced by Maxclique::_mcq(), and Maxclique::degree_sort().


Member Data Documentation

int Maxclique::Vertices::sz [private]

Definition at line 48 of file mcqd.h.

Referenced by init_colors().

Definition at line 47 of file mcqd.h.

Referenced by init_colors().


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