complexip.h 3.6 KB
#ifndef DEF_COMPIP
#define DEF_COMPIP

#include <vector>
#include <string>

#include "structure.h"
#include "solinteraction.h"


class ComplexIP
{
public:

    ComplexIP(const std::vector< int > &rnaList, const std::vector< std::string > &rnaName, const std::vector< std::string > &seqList, const std::vector< Structure > &strList, const std::vector< SolInteraction > &inteList, double score);

    ComplexIP();

    ~ComplexIP();

    void loadListBP_();

    void loadListsBP_();

    std::vector< int > get_rnaList_() const;

    std::vector< std::string > get_rnaName_() const;

    std::vector< std::string > get_seqList_() const;

    std::vector< Structure > get_strList_() const;

    std::vector< SolInteraction > get_inteList_() const;

    double get_obj1_() const;

    int get_nbCt_() const;

    std::vector< std::vector< double > > get_var_() const; //ip

    std::vector < std::vector < double > > get_vari_() const; //ip

    std::vector < std::pair < std::pair < int, int > , std::pair < int, int > > > get_listBP_() const;

    std::vector < std::vector < std::pair < std::pair < int, int > , std::pair < int, int > > > > get_listsBP_() const;

    void set_obj1_(double obj1);

    void set_nbCt_(int nbCt);

    void set_var_(std::vector< std::vector< double > > var); //ip

    void set_vari_(const std::vector < std::vector < double > > &vari); //ip

    void set_rnaList_(const std::vector< int > &rnaList);

    void set_rnaName_(const std::vector< std::string > &rnaName);

    void set_seqList_(const std::vector< std::string > &seqList);

    void set_strList_(const std::vector< Structure > &strList);

    void set_inteList_(const std::vector< SolInteraction > &inteList);

    std::vector< std::vector < std::vector < int > > >  permutation(std::vector< std::vector < std::vector < int > > > oldLevel, std::vector< std::vector < std::vector < int > > > combi, int max) const;

    std::string convToDP();

    std::string to_string();

    std::string to_Json();

    std::string to_forna();

    bool operator<(const ComplexIP &c);

    bool operator<(const ComplexIP &c) const;

    bool operator>(const ComplexIP &c);

    bool operator>(const ComplexIP &c) const;

    bool operator<=(const ComplexIP &c);

    bool operator<=(const ComplexIP &c) const;

    bool operator>=(const ComplexIP &c);

    bool operator>=(const ComplexIP &c) const;

    bool operator==(const ComplexIP &c);

    bool operator==(const ComplexIP &c) const;

    bool operator!=(const ComplexIP &c);

    bool operator!=(const ComplexIP &c) const;

    std::pair < std::pair < int, int > , std::pair < int, int > > invert(std::pair < std::pair < int, int > , std::pair < int, int > > pair) const;

    static bool isEquivalent(const ComplexIP &c1, const ComplexIP &c2);

private:

    std::vector < int > rnaList_;   // Vector to store the rna

    std::vector < std::string > rnaName_;   // Vector to store the name of the rna

    std::vector < std::string > seqList_;   // Vector to store the sequences

    std::vector< Structure > strList_;       // Vector to store the structures

    std::vector< SolInteraction > inteList_;        // Vector to store the interactions

    std::vector < std::pair < std::pair < int, int > , std::pair < int, int > > > listBP_;  // Store the base pairs

    std::vector < std::vector < std::pair < std::pair < int, int > , std::pair < int, int > > > > listsBP_;     // Store id base pair if there are identical sequences of rna

    double obj1_;

    int nbCt_;

    std::vector< std::vector< double > > var_;	// IP values of the decision variable of the integer program

    std::vector < std::vector < double > > vari_; // IP
};

#endif