Skip to content

Commit

Permalink
Merge branch 'minorFixesAndUpdates' of github.com:EXP-code/EXP into m…
Browse files Browse the repository at this point in the history
…inorFixesAndUpdates
  • Loading branch information
Martin D. Weinberg committed Dec 23, 2024
2 parents a77784e + 1f3e51e commit f869b07
Showing 1 changed file with 18 additions and 24 deletions.
42 changes: 18 additions & 24 deletions expui/expMSSA.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1606,38 +1606,36 @@ namespace MSSA {
n++;
}

double Scale = Y1.norm();

// double Scale = Y1.norm();
// auto YY = Y1/Scale;

auto YY = Y1;

// Use one of the built-in Eigen3 algorithms
//
/*
if (params["Jacobi"]) {
if (params["Jacobi"]) {
// -->Using Jacobi
Eigen::JacobiSVD<Eigen::MatrixXd>
svd(YY, Eigen::ComputeThinU | Eigen::ComputeThinV);
svd(YY, Eigen::ComputeThinU | Eigen::ComputeThinV);
S1 = svd.singularValues();
V1 = svd.matrixV();
} else if (params["BDCSVD"]) {
*/
}
// -->Using BDC
else if (params["BDCSVD"]) {
Eigen::BDCSVD<Eigen::MatrixXd>
svd(YY, Eigen::ComputeFullU | Eigen::ComputeFullV);
// svd(YY, Eigen::ComputeThinU | Eigen::ComputeThinV);
S1 = svd.singularValues();
V1 = svd.matrixV();
/*
} else {
// -->Use Random approximation algorithm from Halko, Martinsson,
// and Tropp
}
// -->Use Random approximation algorithm from Halko, Martinsson,
// and Tropp
else {
int srank = std::min<int>(YY.cols(), YY.rows());
RedSVD::RedSVD<Eigen::MatrixXd> svd(YY, srank);
S1 = svd.singularValues();
V1 = svd.matrixV();
}
*/
}

std::cout << "shape V1 = " << V1.rows() << " x "
<< V1.cols() << std::endl;
Expand Down Expand Up @@ -1680,37 +1678,33 @@ namespace MSSA {
// SVD
// Use one of the built-in Eigen3 algorithms
//
/*
// -->Using Jacobi
if (params["Jacobi"]) {
// -->Using Jacobi
Eigen::JacobiSVD<Eigen::MatrixXd>
// svd(VT1, Eigen::ComputeThinU | Eigen::ComputeThinV);
svd(VT1, Eigen::ComputeFullU | Eigen::ComputeFullV);
SS = svd.singularValues();
UU = svd.matrixU();
VV = svd.matrixV();
} else if (params["BDCSVD"]) {
*/
{
// -->Using BDC
}
// -->Using BDC
else if (params["BDCSVD"]) {
Eigen::BDCSVD<Eigen::MatrixXd>
// svd(VT1, Eigen::ComputeThinU | Eigen::ComputeThinV);
svd(VT1, Eigen::ComputeFullU | Eigen::ComputeFullV);
SS = svd.singularValues();
UU = svd.matrixU();
VV = svd.matrixV();
}
/*
} else {
// -->Use Random approximation algorithm from Halko, Martinsson,
// and Tropp
// -->Use Random approximation algorithm from Halko, Martinsson,
// and Tropp
else {
// RedSVD::RedSVD<Eigen::MatrixXd> svd(VT1, std::min<int>(rank, numK-1));
RedSVD::RedSVD<Eigen::MatrixXd> svd(VT1, std::max<int>(VT1.rows(), VT2.cols()));
SS = svd.singularValues();
UU = svd.matrixU();
VV = svd.matrixV();
}
*/

if (out) out << "Singular values" << std::endl << SS << std::endl;

Expand Down

0 comments on commit f869b07

Please sign in to comment.