7 #if defined(_MSC_VER) && (_MSC_VER >= 1400) 9 #pragma warning(disable:4267) 11 #pragma warning(disable:4244) 16 #include "SecStruct.h" 17 #include "FoldedMatrix.h" 19 #include <boost/scoped_ptr.hpp> 27 class FoldedMatrixStrategy;
37 const EnergyNucleo& energy,
unsigned int max_foldings = 100);
49 return lazyCreate()->getSecStructEnergy();
54 return lazyCreate()->findInDepth();
60 return lazyCreate()->getStructures();
64 std::ostream&
printMatrix(std::ostream& os,
int print_width = 4)
const {
65 if( proxy_.get() != 0L)
66 proxy_->printMatrix(os, print_width);
68 os <<
"energy matrix not created" << std::endl;
74 if( proxy_.get() != 0L)
75 proxy_->printStructures(os, print_width);
77 os <<
"energy matrix not created" << std::endl;
93 unsigned int max_foldings_;
96 FoldedMatrixStrategyPtr strategy_;
99 mutable FoldedMatrixPtr proxy_;
102 FoldedMatrixPtr& lazyCreate()
const {
103 if( proxy_.get() == 0L )
104 proxy_.reset(
new FoldedMatrix(*strategy_, max_foldings_) );
118 splitIdx_(first_.getLength() )
121 virtual ~DoubleMatrixStrategy() {}
126 if(index < splitIdx_) {
140 virtual int getSplitIndex()
const {
return splitIdx_; }
143 virtual int getLength()
const {
return first_.getLength() + second_.getLength(); }
146 const Chain& second_;
152 inline FoldedPair::FoldedPair(
const Chain& first_chain,
const Chain& second_chain,
154 : first_(first_chain),
155 second_(second_chain),
157 max_foldings_(max_foldings),
158 strategy_(
new DoubleMatrixStrategy(energy_, first_, second_) ),
175 #endif //FOLDER_PAIR_H
const Chain & getSecondChain() const
Definition: FoldedPair.h:45
const Chain & getFirstChain() const
Definition: FoldedPair.h:42
Two DNA chains with secondary structures.
Definition: FoldedPair.h:34
std::ostream & printMatrix(std::ostream &os, int print_width=4) const
Definition: FoldedPair.h:64
int EnergyValue
Definition: EnergyNucleo.h:15
EnergyValue getSecStructEnergy() const
Definition: FoldedPair.h:48
The DNA strand (single).
Definition: Chain.h:25
std::set< SecStruct > SecStructures
Definition: SecStruct.h:104
Definition: FoldedMatrix.h:52
the maps between pair of nucleotides and its energy
Definition: EnergyNucleo.h:37
std::string getString() const
Definition: Chain.h:125
boost::scoped_ptr< FoldedMatrixStrategy > FoldedMatrixStrategyPtr
Definition: FoldedPair.h:84
std::ostream & operator<<(std::ostream &os, const Chain &chain)
Definition: Chain.h:162
std::ostream & printStructures(std::ostream &os, int print_width=4) const
Definition: FoldedPair.h:73
boost::scoped_ptr< FoldedMatrix > FoldedMatrixPtr
Definition: FoldedPair.h:82
const SecStructures & getStructures() const
Definition: FoldedPair.h:59
SecStruct findInDepth() const
Definition: FoldedPair.h:53
Definition: FoldedMatrix.h:76
the secondary structure
Definition: SecStruct.h:55