Commit 971087d3 authored by Pit Nestle's avatar Pit Nestle

proximal term added

parent a77951fc
Pipeline #7478 failed with stages
in 5 minutes and 10 seconds
......@@ -35,7 +35,7 @@ int SLIMSolver::solve(SLIMProblemInterface &problem, int iterations)
constructLinearSystem(problem, ata, atb);
std::cout << "solve():solveLinearSystem()" << std::endl;
// addProximalTerm(problem, ata, atb);
addProximalTerm(problem, ata, atb);
solveLinearSystem(ata, atb, p);
std::cout << "solve():calculateSearchDirection()" << std::endl;
......@@ -67,8 +67,8 @@ int SLIMSolver::solve(SLIMProblemInterface &problem, int iterations)
// std::cout << problem.computeEnergySV(problem.sv, problem.area) << std::endl;
// std::cout << "### DIR ###" << std::endl;
// std::cout << p << std::endl;
std::cout << "### RES ###" << std::endl;
std::cout << problem.par << std::endl;
// std::cout << "### RES ###" << std::endl;
// std::cout << problem.par << std::endl;
......@@ -96,7 +96,7 @@ void SLIMSolver::calculateWeightAndLambda(SLIMProblemInterface &p, Eigen::Matrix
{
size_t f = p.n_faces();
lambda.resize(4*f, 1);
lambda.resize(f, 4);
for (size_t i = 0; i < f; i++)
{
......@@ -241,10 +241,13 @@ void SLIMSolver::constructLinearSystem(SLIMProblemInterface &p, Eigen::SparseMat
void SLIMSolver::addProximalTerm(SLIMProblemInterface &p, Eigen::SparseMatrix<double> &ata, Eigen::VectorXd &atb)
{
int v = p.n_vertices();
double l = 10e-8;
double l = 10e-4;
Eigen::MatrixXd id = Eigen::MatrixXd::Identity(v, v) * l;
ata = id + ata;
Eigen::SparseMatrix<double> id;
id.resize(2*v,2*v);
id.setIdentity();
ata = ata + (l * id);
atb.block(0,0,v,1) += p.par.col(0) * l;
atb.block(v,0,v,1) += p.par.col(1) * l;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment