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


Constructor & Destructor Documentation

ImageSort::ImageSort ( int  n  ) 

Definition at line 1126 of file emutil.cpp.

References Assert, image_scores, and n.

01127 {
01128         Assert(nn > 0);
01129         n = nn;
01130         image_scores = new ImageScore[n];
01131 }

ImageSort::~ImageSort (  ) 

Definition at line 1133 of file emutil.cpp.

References image_scores.

01134 {
01135         if( image_scores )
01136         {
01137                 delete [] image_scores;
01138                 image_scores = 0;
01139         }
01140 }


Member Function Documentation

int ImageSort::get_index ( int  i  )  const

Definition at line 1154 of file emutil.cpp.

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

01155 {
01156         Assert(i >= 0);
01157         return image_scores[i].index;
01158 }

float ImageSort::get_score ( int  i  )  const

Definition at line 1161 of file emutil.cpp.

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

01162 {
01163         Assert(i >= 0);
01164         return image_scores[i].score;
01165 }

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

Definition at line 1148 of file emutil.cpp.

References Assert, and image_scores.

01149 {
01150         Assert(i >= 0);
01151         image_scores[i] = ImageScore(i, score);
01152 }

int ImageSort::size (  )  const

Definition at line 1168 of file emutil.cpp.

References n.

01169 {
01170         return n;
01171 }

void ImageSort::sort (  ) 

Definition at line 1142 of file emutil.cpp.

References image_scores, imgscore_cmp(), and n.

01143 {
01144         qsort(image_scores, n, sizeof(ImageScore), imgscore_cmp);
01145 
01146 }


Member Data Documentation

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

Definition at line 409 of file emutil.h.

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

int EMAN::ImageSort::n [private]

Definition at line 410 of file emutil.h.

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


The documentation for this class was generated from the following files:
Generated on Mon Mar 7 18:01:46 2011 for EMAN2 by  doxygen 1.4.7