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());
64 void ExportDat(
const String& file_name);
65 void ExportCsv(
const String& file_name);
66 void ExportJson(
const String& file_name);
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;
107 void ExportDat(
const String& file_name);
108 void ExportCsv(
const String& file_name);
109 void ExportJson(
const String& file_name);
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_; }
152 void ExportDat(
const String& file_name);
153 void ExportCsv(
const String& file_name);
154 void ExportJson(
const String& file_name);
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_;
Real Get(uint i_res, uint i_str) const
boost::shared_ptr< VarianceMap > VarianceMapPtr
Dist2Mean(uint num_residues, uint num_structures)
std::vector< Real > & Data()
Real & operator()(uint i_res, uint i_str)
Dist2MeanPtr DLLEXPORT_OST_SEQ_ALG CreateDist2Mean(const DistanceMapPtr dmap)
MeanlDDT(uint num_residues, uint num_structures)
uint GetNumStructures() const
Container for distances to mean for N structures. Main functionality: Get/Set, ExportXXX.
boost::shared_ptr< DistanceMap > DistanceMapPtr
Real Get(uint i_res, uint i_str) const
Real operator()(uint i_res, uint i_str) const
uint GetNumStructures() const
#define DLLEXPORT_OST_SEQ_ALG
MeanlDDTPtr DLLEXPORT_OST_SEQ_ALG CreateMeanlDDTHA(const DistanceMapPtr dmap)
triangular matrix template
void Set(uint i_res, uint i_str, Real val)
uint GetNumResidues() const
void Set(uint i_res, uint i_str, Real val)
std::vector< Real > & Data()
uint GetNumResidues() const
boost::shared_ptr< Dist2Mean > Dist2MeanPtr
boost::shared_ptr< MeanlDDT > MeanlDDTPtr
void Add(uint i_res, uint i_str, Real val)
VarianceMapPtr DLLEXPORT_OST_SEQ_ALG CreateVarianceMap(const DistanceMapPtr dmap, Real sigma=25)
Container for variances for each entry in a distance map. Main functionality: Get/Set, Min, Max, ExportXXX Get/Set and GetSize taken from TriMatrix.
VarianceMap(int nresidues)
Real & operator()(uint i_res, uint i_str)
Real operator()(uint i_res, uint i_str) const