EMAN::ImageSort Class Reference

#include <emutil.h>

Collaboration diagram for EMAN::ImageSort:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ImageSort (int n)
 ~ImageSort ()
void sort ()
void set (int i, float score)
int get_index (int i) const
float get_score (int i) const
int size () const

Private Attributes

ImageScoreimage_scores
int n

Detailed Description

Definition at line 398 of file emutil.h.


Constructor & Destructor Documentation

ImageSort::ImageSort ( int  n  ) 

Definition at line 1168 of file emutil.cpp.

References Assert, image_scores, and n.

01169 {
01170         Assert(nn > 0);
01171         n = nn;
01172         image_scores = new ImageScore[n];
01173 }

ImageSort::~ImageSort (  ) 

Definition at line 1175 of file emutil.cpp.

References image_scores.

01176 {
01177         if( image_scores )
01178         {
01179                 delete [] image_scores;
01180                 image_scores = 0;
01181         }
01182 }


Member Function Documentation

int ImageSort::get_index ( int  i  )  const

Definition at line 1196 of file emutil.cpp.

References Assert, image_scores, and EMAN::ImageScore::index.

01197 {
01198         Assert(i >= 0);
01199         return image_scores[i].index;
01200 }

float ImageSort::get_score ( int  i  )  const

Definition at line 1203 of file emutil.cpp.

References Assert, image_scores, and EMAN::ImageScore::score.

01204 {
01205         Assert(i >= 0);
01206         return image_scores[i].score;
01207 }

void ImageSort::set ( int  i,
float  score 
)

Definition at line 1190 of file emutil.cpp.

References Assert, and image_scores.

01191 {
01192         Assert(i >= 0);
01193         image_scores[i] = ImageScore(i, score);
01194 }

int ImageSort::size (  )  const

Definition at line 1210 of file emutil.cpp.

References n.

01211 {
01212         return n;
01213 }

void ImageSort::sort (  ) 

Definition at line 1184 of file emutil.cpp.

References image_scores, imgscore_cmp(), and n.

01185 {
01186         qsort(image_scores, n, sizeof(ImageScore), imgscore_cmp);
01187 
01188 }


Member Data Documentation

ImageScore* EMAN::ImageSort::image_scores [private]

Definition at line 411 of file emutil.h.

Referenced by get_index(), get_score(), ImageSort(), set(), sort(), and ~ImageSort().

int EMAN::ImageSort::n [private]

Definition at line 412 of file emutil.h.

Referenced by ImageSort(), size(), and sort().


The documentation for this class was generated from the following files:
Generated on Thu May 3 10:09:12 2012 for EMAN2 by  doxygen 1.4.7