Skip to content

Commit 917106a

Browse files
committed
MAINT: comment out overloads that result in ambiguous calls
1 parent 8d005ca commit 917106a

File tree

3 files changed

+145
-145
lines changed

3 files changed

+145
-145
lines changed

libraries/utils/ioutils.h

Lines changed: 104 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -397,49 +397,49 @@ bool IOUtils::write_eigen_matrix(const Eigen::Matrix<T, Eigen::Dynamic, Eigen::D
397397

398398
//=============================================================================================================
399399

400-
template<typename T>
401-
bool IOUtils::write_eigen_matrix(const Eigen::Matrix<T, 1, Eigen::Dynamic>& in, const std::string& sPath, const std::string& sDescription)
402-
{
403-
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> matrixName(1,in.cols());
404-
matrixName.row(0)= in;
405-
return IOUtils::write_eigen_matrix(matrixName, sPath, sDescription);
406-
}
407-
408-
//=============================================================================================================
409-
410-
template<typename T>
411-
bool IOUtils::write_eigen_matrix(const Eigen::Matrix<T, Eigen::Dynamic, 1>& in, const std::string& sPath, const std::string& sDescription)
412-
{
413-
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> matrixName(in.rows(),1);
414-
matrixName.col(0)= in;
415-
return IOUtils::write_eigen_matrix(matrixName, sPath, sDescription);
416-
}
417-
418-
//=============================================================================================================
419-
420-
template<typename T>
421-
bool IOUtils::write_eigen_matrix(const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& in, const std::string& sPath, const std::string& sDescription)
422-
{
423-
std::ofstream outputFile(sPath);
424-
if(outputFile.is_open())
425-
{
426-
if(!sDescription.empty()) {
427-
outputFile<<"# Dimensions (rows x cols): "<<in.rows()<<" x "<<in.cols()<<"\n";
428-
outputFile<<"# Description: "<<sDescription<<"\n";
429-
}
430-
431-
for(int row = 0; row<in.rows(); row++) {
432-
for(int col = 0; col<in.cols(); col++)
433-
outputFile << in(row, col)<<" ";
434-
outputFile<<"\n";
435-
}
436-
} else {
437-
qWarning()<<"Could not write Eigen element to file! Path does not exist!";
438-
return false;
439-
}
440-
441-
return true;
442-
}
400+
//template<typename T>
401+
//bool IOUtils::write_eigen_matrix(const Eigen::Matrix<T, 1, Eigen::Dynamic>& in, const std::string& sPath, const std::string& sDescription)
402+
//{
403+
// Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> matrixName(1,in.cols());
404+
// matrixName.row(0)= in;
405+
// return IOUtils::write_eigen_matrix(matrixName, sPath, sDescription);
406+
//}
407+
408+
////=============================================================================================================
409+
410+
//template<typename T>
411+
//bool IOUtils::write_eigen_matrix(const Eigen::Matrix<T, Eigen::Dynamic, 1>& in, const std::string& sPath, const std::string& sDescription)
412+
//{
413+
// Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> matrixName(in.rows(),1);
414+
// matrixName.col(0)= in;
415+
// return IOUtils::write_eigen_matrix(matrixName, sPath, sDescription);
416+
//}
417+
418+
////=============================================================================================================
419+
420+
//template<typename T>
421+
//bool IOUtils::write_eigen_matrix(const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& in, const std::string& sPath, const std::string& sDescription)
422+
//{
423+
// std::ofstream outputFile(sPath);
424+
// if(outputFile.is_open())
425+
// {
426+
// if(!sDescription.empty()) {
427+
// outputFile<<"# Dimensions (rows x cols): "<<in.rows()<<" x "<<in.cols()<<"\n";
428+
// outputFile<<"# Description: "<<sDescription<<"\n";
429+
// }
430+
431+
// for(int row = 0; row<in.rows(); row++) {
432+
// for(int col = 0; col<in.cols(); col++)
433+
// outputFile << in(row, col)<<" ";
434+
// outputFile<<"\n";
435+
// }
436+
// } else {
437+
// qWarning()<<"Could not write Eigen element to file! Path does not exist!";
438+
// return false;
439+
// }
440+
441+
// return true;
442+
//}
443443

444444
//=============================================================================================================
445445

@@ -523,86 +523,86 @@ bool IOUtils::read_eigen_matrix(Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>
523523

524524
//=============================================================================================================
525525

526-
template<typename T>
527-
bool IOUtils::read_eigen_matrix(Eigen::Matrix<T, 1, Eigen::Dynamic>& out, const std::string& path)
528-
{
529-
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> matrixName;
530-
bool bStatus = IOUtils::read_eigen_matrix(matrixName, path);
526+
//template<typename T>
527+
//bool IOUtils::read_eigen_matrix(Eigen::Matrix<T, 1, Eigen::Dynamic>& out, const std::string& path)
528+
//{
529+
// Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> matrixName;
530+
// bool bStatus = IOUtils::read_eigen_matrix(matrixName, path);
531531

532-
if(matrixName.rows() > 0)
533-
{
534-
out = matrixName.row(0);
535-
}
532+
// if(matrixName.rows() > 0)
533+
// {
534+
// out = matrixName.row(0);
535+
// }
536536

537-
return bStatus;
538-
}
537+
// return bStatus;
538+
//}
539539

540-
//=============================================================================================================
540+
////=============================================================================================================
541541

542-
template<typename T>
543-
bool IOUtils::read_eigen_matrix(Eigen::Matrix<T, Eigen::Dynamic, 1>& out, const std::string& path)
544-
{
545-
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> matrixName;
546-
bool bStatus = IOUtils::read_eigen_matrix(matrixName, path);
542+
//template<typename T>
543+
//bool IOUtils::read_eigen_matrix(Eigen::Matrix<T, Eigen::Dynamic, 1>& out, const std::string& path)
544+
//{
545+
// Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> matrixName;
546+
// bool bStatus = IOUtils::read_eigen_matrix(matrixName, path);
547547

548-
if(matrixName.cols() > 0)
549-
{
550-
out = matrixName.col(0);
551-
}
548+
// if(matrixName.cols() > 0)
549+
// {
550+
// out = matrixName.col(0);
551+
// }
552552

553-
return bStatus;
554-
}
553+
// return bStatus;
554+
//}
555555

556-
//=============================================================================================================
556+
////=============================================================================================================
557557

558-
template<typename T>
559-
bool IOUtils::read_eigen_matrix(Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& out, const std::string& path)
560-
{
561-
std::ifstream inputFile(path);
558+
//template<typename T>
559+
//bool IOUtils::read_eigen_matrix(Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& out, const std::string& path)
560+
//{
561+
// std::ifstream inputFile(path);
562562

563-
if(inputFile.is_open()) {
564-
//Start reading from file
565-
std::vector<Eigen::VectorXd> help;
563+
// if(inputFile.is_open()) {
564+
// //Start reading from file
565+
// std::vector<Eigen::VectorXd> help;
566566

567-
std::string line;
567+
// std::string line;
568568

569-
while(std::getline(inputFile, line)){
570-
if(line.find('#') == std::string::npos){
571-
std::vector<double> elements;
572-
std::stringstream stream{line};
573-
std::string element;
569+
// while(std::getline(inputFile, line)){
570+
// if(line.find('#') == std::string::npos){
571+
// std::vector<double> elements;
572+
// std::stringstream stream{line};
573+
// std::string element;
574574

575-
stream >> std::ws;
576-
while(stream >> element){
577-
elements.push_back(std::stod(element));
578-
stream >> std::ws;
579-
}
575+
// stream >> std::ws;
576+
// while(stream >> element){
577+
// elements.push_back(std::stod(element));
578+
// stream >> std::ws;
579+
// }
580580

581-
Eigen::VectorXd x (elements.size());
581+
// Eigen::VectorXd x (elements.size());
582582

583-
for(size_t i = 0; i < elements.size(); ++i){
584-
x(i) = elements.at(i);
585-
}
583+
// for(size_t i = 0; i < elements.size(); ++i){
584+
// x(i) = elements.at(i);
585+
// }
586586

587-
help.push_back(std::move(x));
588-
}
589-
}
587+
// help.push_back(std::move(x));
588+
// }
589+
// }
590590

591-
int rows = help.size();
592-
int cols = rows <= 0 ? 0 : help.at(0).rows();
591+
// int rows = help.size();
592+
// int cols = rows <= 0 ? 0 : help.at(0).rows();
593593

594-
out.resize(rows, cols);
594+
// out.resize(rows, cols);
595595

596-
for (size_t i = 0; i < help.size(); i++) {
597-
out.row(i) = help[i].transpose();
598-
}
599-
} else {
600-
qWarning()<<"IOUtils::read_eigen_matrix - Could not read Eigen element from file! Path does not exist!";
601-
return false;
602-
}
596+
// for (size_t i = 0; i < help.size(); i++) {
597+
// out.row(i) = help[i].transpose();
598+
// }
599+
// } else {
600+
// qWarning()<<"IOUtils::read_eigen_matrix - Could not read Eigen element from file! Path does not exist!";
601+
// return false;
602+
// }
603603

604-
return true;
605-
}
604+
// return true;
605+
//}
606606
} // NAMESPACE
607607

608608
#endif // IOUTILS_H

libraries/utils/kmeans.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -89,30 +89,30 @@ KMeans::KMeans(QString distance,
8989

9090
//=============================================================================================================
9191

92-
KMeans::KMeans(std::string distance,
93-
std::string start,
94-
qint32 replicates,
95-
std::string emptyact,
96-
bool online,
97-
qint32 maxit)
98-
: m_sDistance(distance)
99-
, m_sStart(start)
100-
, m_iReps(replicates)
101-
, m_sEmptyact(emptyact)
102-
, m_iMaxit(maxit)
103-
, m_bOnline(online)
104-
, emptyErrCnt(0)
105-
, iter(0)
106-
, k(0)
107-
, n(0)
108-
, p(0)
109-
, totsumD(0)
110-
, prevtotsumD(0)
111-
{
112-
// Assume one replicate
113-
if (m_iReps < 1)
114-
m_iReps = 1;
115-
}
92+
//KMeans::KMeans(std::string distance,
93+
// std::string start,
94+
// qint32 replicates,
95+
// std::string emptyact,
96+
// bool online,
97+
// qint32 maxit)
98+
//: m_sDistance(distance)
99+
//, m_sStart(start)
100+
//, m_iReps(replicates)
101+
//, m_sEmptyact(emptyact)
102+
//, m_iMaxit(maxit)
103+
//, m_bOnline(online)
104+
//, emptyErrCnt(0)
105+
//, iter(0)
106+
//, k(0)
107+
//, n(0)
108+
//, p(0)
109+
//, totsumD(0)
110+
//, prevtotsumD(0)
111+
//{
112+
// // Assume one replicate
113+
// if (m_iReps < 1)
114+
// m_iReps = 1;
115+
//}
116116

117117
//=============================================================================================================
118118

libraries/utils/kmeans.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,23 @@ class UTILSSHARED_EXPORT KMeans
9696
bool online = true,
9797
qint32 maxit = 100);
9898

99-
//=========================================================================================================
100-
/**
101-
* Constructs a KMeans algorithm object.
102-
*
103-
* @param[in] distance (optional) K-Means distance measure: "sqeuclidean" (default), "cityblock" , "cosine", "correlation", "hamming".
104-
* @param[in] start (optional) Cluster initialization: "sample" (default), "uniform", "cluster".
105-
* @param[in] replicates (optional) Number of K-Means replicates, which are generated. Best is returned.
106-
* @param[in] emptyact (optional) What happens if a cluster wents empty: "error" (default), "drop", "singleton".
107-
* @param[in] online (optional) If centroids should be updated during iterations: true (default), false.
108-
* @param[in] maxit (optional) maximal number of iterations per replicate; 100 by default.
109-
*/
110-
explicit KMeans(std::string distance = std::string{"sqeuclidean"} ,
111-
std::string start = std::string{"sample"},
112-
qint32 replicates = 1,
113-
std::string emptyact = std::string{"error"},
114-
bool online = true,
115-
qint32 maxit = 100);
99+
// //=========================================================================================================
100+
// /**
101+
// * Constructs a KMeans algorithm object.
102+
// *
103+
// * @param[in] distance (optional) K-Means distance measure: "sqeuclidean" (default), "cityblock" , "cosine", "correlation", "hamming".
104+
// * @param[in] start (optional) Cluster initialization: "sample" (default), "uniform", "cluster".
105+
// * @param[in] replicates (optional) Number of K-Means replicates, which are generated. Best is returned.
106+
// * @param[in] emptyact (optional) What happens if a cluster wents empty: "error" (default), "drop", "singleton".
107+
// * @param[in] online (optional) If centroids should be updated during iterations: true (default), false.
108+
// * @param[in] maxit (optional) maximal number of iterations per replicate; 100 by default.
109+
// */
110+
// explicit KMeans(std::string distance = std::string{"sqeuclidean"} ,
111+
// std::string start = std::string{"sample"},
112+
// qint32 replicates = 1,
113+
// std::string emptyact = std::string{"error"},
114+
// bool online = true,
115+
// qint32 maxit = 100);
116116

117117
//=========================================================================================================
118118
/**

0 commit comments

Comments
 (0)