00001 #ifndef LIBRARY_H
00002 #define LIBRARY_H
00003
00004 #include "Fragment.h"
00005 #include <iosfwd>
00006 #include <string>
00007 #include <vector>
00008
00012 class Library
00013 {
00014 public:
00015
00019 inline Library( void );
00020
00024 virtual ~Library();
00025
00029 void initialize( void );
00030
00031 friend std::ostream& operator<<( std::ostream& p_out, const Library& p_library );
00032
00038 void addFragment( const Fragment& p_fragment, int p_position = Library::LAST_POSITION );
00039
00044 void deleteFragmentByIndex( const int p_position );
00045
00050 void pruneBasedOnOccurence( float p_fraction_to_keep );
00051
00055 void pruneZeroOccurence( void );
00056
00061 void pruneWithGoodnessFraction( const float p_threshold_fraction );
00062
00063
00064
00065
00070 void pruneNWorstFragment( const int p_number );
00071
00075 void resetFragmentList( void );
00076
00083 void buildSubLibrary( const int p_nbr_division, const int p_index, Library* p_library ) const;
00084
00088 void shuffle( void );
00089
00090
00091
00092
00093
00094
00095
00100 double calculateSumScoreUpTo( float p_fraction );
00101
00105 inline const std::string& getLibraryName( void ) const;
00106
00110 inline void setLibraryName( const std::string& p_Name );
00111
00116 inline Fragment* getFragmentByIndex( const int p_index ) const;
00117
00121 inline const std::vector<Fragment*>& getFragmentList( void ) const;
00122
00126 inline const std::vector<Fragment*>& getRejectedFragmentList( void ) const;
00127
00131 inline int getNumberOfFragment( void ) const;
00132
00136 inline int getNumberOfRejectedFragment( void ) const;
00137
00141 inline int getNumberOfInitialFragment( void ) const;
00142
00147 inline void setIsKeptConstant( const bool p_is_kept_constant );
00148
00152 inline bool getIsKeptConstant( void ) const;
00153
00157 inline int getPotentialGoodnessCount( void ) const;
00158
00162 inline void setPotentialGoodnessCount( int p_potential );
00163
00164
00165 protected:
00166
00167 static const int LAST_POSITION;
00168
00169 private:
00170
00171
00172 Library& operator=( const Library& p_Library ){ return *this;};
00173
00174
00175
00176
00177
00178 bool m_IsKeptConstant;
00179 int m_PotentialGoodnessCount;
00180 std::string m_LibraryName;
00181 std::vector<Fragment*> m_Fragments;
00182 std::vector<Fragment*> m_RejectedFragments;
00183 };
00184
00185 #include "Library.inline.cc"
00186
00187 #endif
00188 PotentialGoodnessCount;
00189 std::string m_LibraryName;
00190 std::vector<Fragment*> m_Fragments;
00191 std::vector<Fragment*> m_RejectedFragments;
00192 };
00193
00194 #include "Library.inline.cc"
00195
00196 #endif