using gmx::RVec;
-void read_correlation_matrix_file(std::vector< std::vector< std::vector< double > > > &crrlts, const char* file_name, unsigned long size, unsigned int length)
+const std::vector< std::vector< std::vector< double > > > read_correlation_matrix_file(const char* file_name, unsigned long size, unsigned int length)
{
FILE *file;
+ std::vector< std::vector< std::vector< double > > > crrlts;
file = std::fopen(file_name, "r+");
std::vector< double > c;
c.resize(size, 0);
}
std::fclose(file);
std::cout << "\n";
+ return crrlts;
}
-void make_correlation_matrix_file(std::vector< std::vector< std::vector< double > > > correlations, const char* file_name)
+void make_correlation_matrix_file(const std::vector< std::vector< std::vector< double > > > correlations, const char* file_name)
{
FILE *file;
file = std::fopen(file_name, "w+");
}
}
-void correlation_evaluation(std::vector< RVec > ref, std::vector< std::vector< RVec > > traj, std::vector< std::vector< std::vector< double > > > &crl, unsigned int tauE) {
+const std::vector< std::vector< std::vector< double > > > correlation_evaluation(std::vector< RVec > ref, std::vector< std::vector< RVec > > traj, unsigned int tauE) {
+ std::vector< std::vector< std::vector< double > > > crl;
crl.resize(tauE + 1);
for (unsigned int i = 0; i < crl.size(); i++) {
crl[i].resize(traj.front().size());
}
#pragma omp barrier
std::cout << "\n";
+ return crl;
}
void graph_calculation( std::vector< std::vector< std::pair< double, long int > > > &graph, std::vector< std::vector< unsigned int > > &s_graph,
std::vector< std::vector< std::pair< unsigned int, unsigned int > > > &s_graph_rbr,
std::vector< std::vector< RVec > > traj, std::vector< RVec > ref,
- std::vector< std::vector< std::vector< double > > > crl, double crl_b, double e_rad, unsigned int tauB, unsigned int tauE) {
+ const std::vector< std::vector< std::vector<double > > > crl, double crl_b, double e_rad, unsigned int tauB, unsigned int tauE) {
graph.resize(traj.front().size());
for (unsigned int i = 0; i < traj.front().size(); i++) {
graph[i].resize(traj.front().size(), std::make_pair(0, -1));
if (mode == 0) {
std::cout << "\nCorrelation's evaluation - start\n";
- correlation_evaluation(reference, trajectory, crltns, k);
+ crltns = correlation_evaluation(reference, trajectory, k);
for (unsigned int i1 = 0; i1 < crltns.size(); i1++) {
for (unsigned int i2 = 0; i2 < crltns[i1].size(); i2++) {
std::cout << "Correlation's evaluation - end\n" << "graph evaluation: start\n";
} else if (mode == 1) {
- read_correlation_matrix_file(crltns, (MtrxNm).c_str(), index.size(), k);
+ crltns = read_correlation_matrix_file((MtrxNm).c_str(), index.size(), k);
for (unsigned int i1 = 0; i1 < crltns.size(); i1++) {
for (unsigned int i2 = 0; i2 < crltns[i1].size(); i2++) {