|
@@ -275,8 +275,14 @@ namespace ABACUS {
|
275
|
275
|
|
276
|
276
|
DP damping = 1.0;
|
277
|
277
|
DP diffsq_prev = 1.0e+6;
|
|
278
|
+
|
|
279
|
+ Vect_DP RHSBAE (0.0, N); // contains RHS of BAEs
|
|
280
|
+ Vect_DP dlambdaoc (0.0, N); // contains delta lambdaoc computed from Newton's method
|
|
281
|
+ SQMat_DP Gaudin (0.0, N);
|
|
282
|
+ Vect_INT indx (N);
|
|
283
|
+
|
278
|
284
|
while (diffsq > prec && !is_nan(diffsq) && iter_Newton < 100) {
|
279
|
|
- (*this).Iterate_BAE_Newton(damping);
|
|
285
|
+ (*this).Iterate_BAE_Newton(damping, RHSBAE, dlambdaoc, Gaudin, indx);
|
280
|
286
|
if (diffsq > diffsq_prev && damping > 0.5) damping /= 2.0;
|
281
|
287
|
else if (diffsq < diffsq_prev) damping = 1.0;
|
282
|
288
|
diffsq_prev = diffsq;
|
|
@@ -469,12 +475,8 @@ namespace ABACUS {
|
469
|
475
|
/**
|
470
|
476
|
Performs one step of the matrix Newton method on the rapidities.
|
471
|
477
|
*/
|
472
|
|
- void LiebLin_Bethe_State::Iterate_BAE_Newton (DP damping)
|
|
478
|
+ void LiebLin_Bethe_State::Iterate_BAE_Newton (DP damping, Vect_DP& RHSBAE, Vect_DP& dlambdaoc, SQMat_DP& Gaudin, Vect_INT& indx)
|
473
|
479
|
{
|
474
|
|
- Vect_DP RHSBAE (0.0, N); // contains RHS of BAEs
|
475
|
|
- Vect_DP dlambdaoc (0.0, N); // contains delta lambdaoc computed from Newton's method
|
476
|
|
- SQMat_DP Gaudin (0.0, N);
|
477
|
|
- Vect_INT indx (N);
|
478
|
480
|
DP sumtheta = 0.0;
|
479
|
481
|
// for large |lambda|, use atan (lambda) = sgn(lambda) pi/2 - atan(1/lambda)
|
480
|
482
|
int atanintshift = 0;
|