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 400 of file emutil.h.


Constructor & Destructor Documentation

ImageSort::ImageSort ( int  n  ) 

Definition at line 1259 of file emutil.cpp.

References Assert, image_scores, and n.

01260 {
01261         Assert(nn > 0);
01262         n = nn;
01263         image_scores = new ImageScore[n];
01264 }

ImageSort::~ImageSort (  ) 

Definition at line 1266 of file emutil.cpp.

References image_scores.

01267 {
01268         if( image_scores )
01269         {
01270                 delete [] image_scores;
01271                 image_scores = 0;
01272         }
01273 }


Member Function Documentation

int ImageSort::get_index ( int  i  )  const

Definition at line 1287 of file emutil.cpp.

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

01288 {
01289         Assert(i >= 0);
01290         return image_scores[i].index;
01291 }

float ImageSort::get_score ( int  i  )  const

Definition at line 1294 of file emutil.cpp.

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

01295 {
01296         Assert(i >= 0);
01297         return image_scores[i].score;
01298 }

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

Definition at line 1281 of file emutil.cpp.

References Assert, and image_scores.

01282 {
01283         Assert(i >= 0);
01284         image_scores[i] = ImageScore(i, score);
01285 }

int ImageSort::size (  )  const

Definition at line 1301 of file emutil.cpp.

References n.

01302 {
01303         return n;
01304 }

void ImageSort::sort (  ) 

Definition at line 1275 of file emutil.cpp.

References image_scores, imgscore_cmp(), and n.

01276 {
01277         qsort(image_scores, n, sizeof(ImageScore), imgscore_cmp);
01278 
01279 }


Member Data Documentation

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

Definition at line 413 of file emutil.h.

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

int EMAN::ImageSort::n [private]

Definition at line 414 of file emutil.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 11 12:43:05 2013 for EMAN2 by  doxygen 1.4.7