RsBundle  Diff

Differences From Artifact [4b4877061c]:

  • File src/solver.rs — part of check-in [a475dc4e2d] at 2016-09-29 06:37:20 on branch trunk — solver: Handle error when setting the number of suproblems in the master. (user: fifr size: 24557)

To Artifact [d0928a45a4]:

  • File src/solver.rs — part of check-in [9d2ba83f87] at 2016-09-29 06:37:51 on branch trunk — solver: Initialize subgradient with first master evaluation. (user: fifr size: 25142)

556
557
558
559
560
561
562









563


564

565
566
567
568
569
570
571
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583







+
+
+
+
+
+
+
+
+

+
+

+







                });
            } else {
                return Err(Error::NoMinorant);
            }
        }

        self.cur_valid = true;

        // Solve the master problem once to compute the initial
        // subgradient.
        //
        // We could compute that subgradient directly by
        // adding up the initial minorants, but this would not include
        // the eta terms. However, this is a heuristic anyway because
        // we assume an initial weight of 1.0, which, in general, will
        // *not* be the initial weight for the first iteration.
        self.master.set_weight(1.0);
        try!(self.master.solve(self.cur_val));
        self.sgnorm = self.master.get_dualoptnorm2().sqrt();

        // Compute the real initial weight.
        let state = current_state!(self, Step::Term);
        let new_weight = self.weighter.weight(&state, &self.params);
        self.master.set_weight(new_weight);

        debug!("Init master completed");

        Ok(())