7 #if defined(_MSC_VER) && (_MSC_VER >= 1400) 9 #pragma warning(disable:4267) 11 #pragma warning(disable:4244) 15 #include "SecStruct.h" 16 #include "FoldedMatrix.h" 18 #include <boost/scoped_ptr.hpp> 26 class FoldedMatrixStrategy;
43 return lazyCreate()->getSecStructEnergy();
48 return lazyCreate()->findInDepth();
54 return lazyCreate()->getStructures();
58 std::ostream&
printMatrix(std::ostream& os,
int print_width = 4)
const {
59 if( proxy_.get() != 0L)
60 proxy_->printMatrix(os, print_width);
62 os <<
"energy matrix not created" << std::endl;
69 if( proxy_.get() != 0L)
70 proxy_->printStructures(os, print_width);
72 os <<
"energy matrix not created" << std::endl;
87 unsigned int max_foldings_;
90 FoldedMatrixStrategyPtr strategy_;
93 mutable FoldedMatrixPtr proxy_;
96 FoldedMatrixPtr& lazyCreate()
const {
97 if( proxy_.get() == 0L )
98 proxy_.reset(
new FoldedMatrix(*strategy_, max_foldings_ ) );
110 virtual ~SingleMatrixStrategy() {}
120 virtual int getSplitIndex()
const {
return chain_.getLength(); }
123 virtual int getLength()
const {
return chain_.getLength(); }
131 inline FoldedChain::FoldedChain(
const Chain& chain,
const EnergyNucleo& energy,
unsigned int max_foldings)
134 max_foldings_(max_foldings),
135 strategy_(
new SingleMatrixStrategy(energy_, chain_) ),
boost::scoped_ptr< FoldedMatrixStrategy > FoldedMatrixStrategyPtr
Definition: FoldedChain.h:79
SecStruct findInDepth() const
Definition: FoldedChain.h:47
DNA strand with secondary structure.
Definition: FoldedChain.h:32
const Chain & getChain() const
Definition: FoldedChain.h:39
int EnergyValue
Definition: EnergyNucleo.h:15
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
const SecStructures & getStructures() const
Definition: FoldedChain.h:53
EnergyValue getSecStructEnergy() const
Definition: FoldedChain.h:42
std::ostream & printStructures(std::ostream &os, int print_width=4) const
Definition: FoldedChain.h:68
std::ostream & operator<<(std::ostream &os, const Chain &chain)
Definition: Chain.h:162
std::ostream & printMatrix(std::ostream &os, int print_width=4) const
Definition: FoldedChain.h:58
boost::scoped_ptr< FoldedMatrix > FoldedMatrixPtr
Definition: FoldedChain.h:77
Definition: FoldedMatrix.h:76
the secondary structure
Definition: SecStruct.h:55