Skip to content
Snippets Groups Projects

Adding tdd

Merged Sergi Foix Salmerón requested to merge adding_tdd into ubuntu.16.04
7 files
+ 152
26
Compare changes
  • Side-by-side
  • Inline
Files
7
#ifndef _finddd_alg_h_
#ifndef _finddd_alg_h_
#define _finddd_alg_h_
#define _finddd_alg_h_
@@ -18,6 +17,7 @@
@@ -18,6 +17,7 @@
// util
// util
template <class T>
template <class T>
 
[[deprecated]]
inline std::string to_string (const T& t)
inline std::string to_string (const T& t)
{
{
std::stringstream ss;
std::stringstream ss;
@@ -303,7 +303,7 @@ protected:
@@ -303,7 +303,7 @@ protected:
* the PCA matrix.
* the PCA matrix.
*
*
*/
*/
inline void update_pca_matrix(std::string new_pca_matrix_file, int pca_nkeep)
inline void update_pca_matrix(std::string new_pca_matrix_file, size_t pca_nkeep)
{
{
this->pca_file_ = new_pca_matrix_file;
this->pca_file_ = new_pca_matrix_file;
this->pca_nkeep_=pca_nkeep;
this->pca_nkeep_=pca_nkeep;
@@ -325,14 +325,13 @@ protected:
@@ -325,14 +325,13 @@ protected:
float num;
float num;
getline(ifs, line);
getline(ifs, line);
std::istringstream iss(line);
std::istringstream iss(line);
int i=0;
do
do
{
{
iss >> num;
iss >> num;
this->pca_mean_.push_back(num);
this->pca_mean_.push_back(num);
}while(!iss.eof());
}while(!iss.eof());
}
}
int dout=0;
size_t dout=0;
while (ifs.good())
while (ifs.good())
{
{
float num;
float num;
@@ -371,7 +370,7 @@ protected:
@@ -371,7 +370,7 @@ protected:
std::vector< std::vector<float> > PCA_t;
std::vector< std::vector<float> > PCA_t;
PCA_t.resize(nkeep, std::vector<float>(this->pca_matrix_.size()));
PCA_t.resize(nkeep, std::vector<float>(this->pca_matrix_.size()));
for(int i=0;i<nkeep;i++)
for(int i=0;i<nkeep;i++)
for(int j=0;j<this->pca_matrix_.size();j++)
for(size_t j=0;j<this->pca_matrix_.size();j++)
{
{
PCA_t[i][j]=this->pca_matrix_[j][i];
PCA_t[i][j]=this->pca_matrix_[j][i];
}
}
Loading