24 #ifndef OST_SEQ_ALG_VARIANCE_MAP_HH
25 #define OST_SEQ_ALG_VARIANCE_MAP_HH
35 namespace ost {
namespace seq {
namespace alg {
54 std::vector<Real>& data = this->Data();
55 return *std::min_element(data.begin(), data.end());
60 std::vector<Real>& data = this->Data();
61 return *std::max_element(data.begin(), data.end());
76 : num_residues_(num_residues), num_structures_(num_structures)
77 , values_(num_residues * num_structures, 0) { }
80 values_[GetIndex(i_res, i_str)] = val;
84 return values_[GetIndex(i_res, i_str)];
88 return values_[GetIndex(i_res, i_str)];
91 return values_[GetIndex(i_res, i_str)];
94 std::vector<Real>&
Data() {
return values_; }
100 values_[GetIndex(i_res, i_str)] += val;
104 for (
uint i = 0; i < values_.size(); ++i) values_[i] /= val;
114 assert(i_res < num_residues_);
115 assert(i_str < num_structures_);
116 return (i_res * num_structures_ + i_str);
120 uint num_structures_;
121 std::vector<Real> values_;
129 : num_residues_(num_residues), num_structures_(num_structures)
130 , values_(num_residues * num_structures, 0) { }
133 values_[GetIndex(i_res, i_str)] = val;
137 return values_[GetIndex(i_res, i_str)];
141 return values_[GetIndex(i_res, i_str)];
144 return values_[GetIndex(i_res, i_str)];
147 std::vector<Real>&
Data() {
return values_; }
159 assert(i_res < num_residues_);
160 assert(i_str < num_structures_);
161 return (i_res * num_structures_ + i_str);
165 uint num_structures_;
166 std::vector<Real> values_;
triangular matrix template
Container for distances to mean for N structures. Main functionality: Get/Set, ExportXXX.
std::vector< Real > & Data()
uint GetNumStructures() const
void ExportCsv(const String &file_name)
Real operator()(uint i_res, uint i_str) const
Real & operator()(uint i_res, uint i_str)
void Set(uint i_res, uint i_str, Real val)
void ExportJson(const String &file_name)
void Add(uint i_res, uint i_str, Real val)
uint GetNumResidues() const
Real Get(uint i_res, uint i_str) const
void ExportDat(const String &file_name)
Dist2Mean(uint num_residues, uint num_structures)
std::vector< Real > & Data()
uint GetNumStructures() const
void ExportCsv(const String &file_name)
Real operator()(uint i_res, uint i_str) const
Real & operator()(uint i_res, uint i_str)
void Set(uint i_res, uint i_str, Real val)
void ExportJson(const String &file_name)
uint GetNumResidues() const
MeanlDDT(uint num_residues, uint num_structures)
Real Get(uint i_res, uint i_str) const
void ExportDat(const String &file_name)
Container for variances for each entry in a distance map. Main functionality: Get/Set,...
void ExportCsv(const String &file_name)
void ExportJson(const String &file_name)
void ExportDat(const String &file_name)
VarianceMap(int nresidues)
boost::shared_ptr< VarianceMap > VarianceMapPtr
Dist2MeanPtr DLLEXPORT_OST_SEQ_ALG CreateDist2Mean(const DistanceMapPtr dmap)
boost::shared_ptr< DistanceMap > DistanceMapPtr
boost::shared_ptr< MeanlDDT > MeanlDDTPtr
VarianceMapPtr DLLEXPORT_OST_SEQ_ALG CreateVarianceMap(const DistanceMapPtr dmap, Real sigma=25)
MeanlDDTPtr DLLEXPORT_OST_SEQ_ALG CreateMeanlDDTHA(const DistanceMapPtr dmap)
boost::shared_ptr< Dist2Mean > Dist2MeanPtr
#define DLLEXPORT_OST_SEQ_ALG