24 #ifndef OST_SEQ_ALG_VARIANCE_MAP_HH
25 #define OST_SEQ_ALG_VARIANCE_MAP_HH
35 namespace ost {
namespace seq {
namespace alg {
52 std::vector<Real>& data = this->Data();
53 return *std::min_element(data.begin(), data.end());
58 std::vector<Real>& data = this->Data();
59 return *std::max_element(data.begin(), data.end());
62 void ExportDat(
const String& file_name);
63 void ExportCsv(
const String& file_name);
64 void ExportJson(
const String& file_name);
74 : num_residues_(num_residues), num_structures_(num_structures)
75 , values_(num_residues * num_structures, 0) { }
78 values_[GetIndex(i_res, i_str)] = val;
82 return values_[GetIndex(i_res, i_str)];
86 return values_[GetIndex(i_res, i_str)];
89 return values_[GetIndex(i_res, i_str)];
92 std::vector<Real>&
Data() {
return values_; }
98 values_[GetIndex(i_res, i_str)] += val;
102 for (
uint i = 0; i < values_.size(); ++i) values_[i] /= val;
105 void ExportDat(
const String& file_name);
106 void ExportCsv(
const String& file_name);
107 void ExportJson(
const String& file_name);
112 assert(i_res < num_residues_);
113 assert(i_str < num_structures_);
114 return (i_res * num_structures_ + i_str);
118 uint num_structures_;
119 std::vector<Real> values_;
boost::shared_ptr< VarianceMap > VarianceMapPtr
Dist2Mean(uint num_residues, uint num_structures)
std::vector< Real > & Data()
Dist2MeanPtr DLLEXPORT_OST_SEQ_ALG CreateDist2Mean(const DistanceMapPtr dmap)
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
triangular matrix template
void Set(uint i_res, uint i_str, Real val)
uint GetNumResidues() const
boost::shared_ptr< Dist2Mean > Dist2MeanPtr
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)