Compare commits

...

3 Commits
dev_yi ... main

Author SHA1 Message Date
9bce099bf8 tmp 2025-03-03 19:55:01 +08:00
330c1f6b0d bug fixed 2025-03-03 19:53:18 +08:00
c84efac24b bug fixed 2025-03-03 19:51:21 +08:00
6 changed files with 15 additions and 15 deletions

View File

@ -125,12 +125,12 @@ int main(int argc, char const *argv[])
test.LCG_Minimize(m, B, gctl::LCG_CG, ofile);
ofile << "maximal difference: " << max_diff(fm, m) << std::endl;
m.assign_all(0.0);
m.assign(0.0);
test.LCG_Minimize(m, B, gctl::LCG_PCG, ofile);
ofile << "maximal difference: " << max_diff(fm, m) << std::endl;
m.assign_all(0.0);
m.assign(0.0);
test.LCG_Minimize(m, B, gctl::LCG_CGS, ofile);
ofile << "maximal difference: " << max_diff(fm, m) << std::endl;
@ -138,12 +138,12 @@ int main(int argc, char const *argv[])
test.set_lcg_message(gctl::LCG_SOLUTION);
m.assign_all(0.0);
m.assign(0.0);
test.LCG_Minimize(m, B, gctl::LCG_BICGSTAB);
std::clog << "maximal difference: " << max_diff(fm, m) << std::endl;
m.assign_all(0.0);
m.assign(0.0);
test.LCG_Minimize(m, B, gctl::LCG_BICGSTAB2);
std::clog << "maximal difference: " << max_diff(fm, m) << std::endl;
@ -151,12 +151,12 @@ int main(int argc, char const *argv[])
gctl::array<double> low(N, 1.0);
gctl::array<double> hig(N, 2.0);
m.assign_all(0.0);
m.assign(0.0);
test.LCG_MinimizeConstrained(m, B, low, hig, gctl::LCG_PG);
std::clog << "maximal difference: " << max_diff(fm, m) << std::endl;
m.assign_all(0.0);
m.assign(0.0);
test.LCG_MinimizeConstrained(m, B, low, hig, gctl::LCG_SPG);
std::clog << "maximal difference: " << max_diff(fm, m) << std::endl;

View File

@ -121,15 +121,15 @@ int main(int argc, char const *argv[])
test.CLCG_Minimize(m, B, gctl::CLCG_BICG_SYM);
std::clog << "maximal difference: " << max_diff(fm, m) << std::endl;
m.assign_all(std::complex<double>(0.0, 0.0));
m.assign(std::complex<double>(0.0, 0.0));
test.CLCG_Minimize(m, B, gctl::CLCG_BICG);
std::clog << "maximal difference: " << max_diff(fm, m) << std::endl;
m.assign_all(std::complex<double>(0.0, 0.0));
m.assign(std::complex<double>(0.0, 0.0));
test.CLCG_Minimize(m, B, gctl::CLCG_CGS);
std::clog << "maximal difference: " << max_diff(fm, m) << std::endl;
m.assign_all(std::complex<double>(0.0, 0.0));
m.assign(std::complex<double>(0.0, 0.0));
test.CLCG_Minimize(m, B, gctl::CLCG_BICGSTAB);
std::clog << "maximal difference: " << max_diff(fm, m) << std::endl;
return 0;

View File

@ -99,7 +99,7 @@ double gctl::dwa::DWALoss(array<double> &g)
fx_c_ = 0;
multi_fx_ = 0.0;
grad_.assign_all(0.0);
grad_.assign(0.0);
return fx;
}

View File

@ -213,7 +213,7 @@ double gctl::grad_norm::GradNormLoss(array<double> &g)
fx_c_ = 0;
multi_fx_ = 0.0;
grad_.assign_all(0.0);
grad_.assign(0.0);
return fx;
}

View File

@ -500,7 +500,7 @@ gctl::lgd_return_code gctl::lgd_solver::lgd(array<double> &best_m, array<double>
if (lgd_save_trace_)
{
lgd_trace_.append_array(best_m);
lgd_trace_.concat(best_m);
lgd_trace_times_++;
}
}
@ -671,7 +671,7 @@ gctl::lgd_return_code gctl::lgd_solver::lgd_momentum(array<double> &best_m, arra
if (lgd_save_trace_)
{
lgd_trace_.append_array(best_m);
lgd_trace_.concat(best_m);
lgd_trace_times_++;
}
}

View File

@ -129,8 +129,8 @@ void gctl::svd::decompose(const matrix<double> &src_mat)
for(int iter=0; diff >= epsilon && iter < maxi_iteration; iter++)
{
next_left_vector.assign_all(0.0);
next_right_vector.assign_all(0.0);
next_left_vector.assign(0.0);
next_right_vector.assign(0.0);
for(int i=0;i<M;i++)
for(int j=0;j<N;j++)