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 1129 of file emutil.cpp.

References Assert, image_scores, and n.

01130 {
01131         Assert(nn > 0);
01132         n = nn;
01133         image_scores = new ImageScore[n];
01134 }

ImageSort::~ImageSort (  ) 

Definition at line 1136 of file emutil.cpp.

References image_scores.

01137 {
01138         if( image_scores )
01139         {
01140                 delete [] image_scores;
01141                 image_scores = 0;
01142         }
01143 }


Member Function Documentation

int ImageSort::get_index ( int  i  )  const

Definition at line 1157 of file emutil.cpp.

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

01158 {
01159         Assert(i >= 0);
01160         return image_scores[i].index;
01161 }

float ImageSort::get_score ( int  i  )  const

Definition at line 1164 of file emutil.cpp.

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

01165 {
01166         Assert(i >= 0);
01167         return image_scores[i].score;
01168 }

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

Definition at line 1151 of file emutil.cpp.

References Assert, and image_scores.

01152 {
01153         Assert(i >= 0);
01154         image_scores[i] = ImageScore(i, score);
01155 }

int ImageSort::size (  )  const

Definition at line 1171 of file emutil.cpp.

References n.

01172 {
01173         return n;
01174 }

void ImageSort::sort (  ) 

Definition at line 1145 of file emutil.cpp.

References image_scores, imgscore_cmp(), and n.

01146 {
01147         qsort(image_scores, n, sizeof(ImageScore), imgscore_cmp);
01148 
01149 }


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 May 2 13:29:31 2011 for EMAN2 by  doxygen 1.4.7