RsBundle  Diff

Differences From Artifact [52cec0fe93]:

  • File src/mcf/problem.rs — part of check-in [0778fd3534] at 2023-07-08 11:02:21 on branch mpi — examples/mmcf: first send minorant, then objective. This is currently (for testing) necessary because otherwise the asynchronous solver won't do a step. (user: fifr size: 20995) [more...]

To Artifact [1ccd346fa5]:

  • File src/mcf/problem.rs — part of check-in [d979db1a2e] at 2023-08-12 17:43:02 on branch trunk — problem::FirstOrderProblem: use implicit impl traits (user: fifr size: 20962)

533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
        self.pool = Some(pool);
    }

    fn stop(&mut self) {
        self.pool.take();
    }

    fn evaluate<S>(&mut self, i: usize, y: Arc<DVector>, tx: S) -> Result<()>
    where
        S: ResultSender<Self> + 'static,
    {
        if self.pool.is_none() {
            self.start()
        }
        let sub = self.subs[i].clone();
        let subdatas = self.subdatas.clone();
        // Attention: `y` might be shorter than the set of active constraints
        // because evaluation and problem update are not synchronized, i.e. the







|
<
<
<







533
534
535
536
537
538
539
540



541
542
543
544
545
546
547
        self.pool = Some(pool);
    }

    fn stop(&mut self) {
        self.pool.take();
    }

    fn evaluate(&mut self, i: usize, y: Arc<DVector>, tx: impl ResultSender<Self> + 'static) -> Result<()> {



        if self.pool.is_none() {
            self.start()
        }
        let sub = self.subs[i].clone();
        let subdatas = self.subdatas.clone();
        // Attention: `y` might be shorter than the set of active constraints
        // because evaluation and problem update are not synchronized, i.e. the
559
560
561
562
563
564
565
566
567
568
569
570

571
572
573
574
575
576
577
                }
                Err(err) => tx.error(err).unwrap(),
            }
        });
        Ok(())
    }

    fn update<U, S>(&mut self, state: U, tx: S) -> Result<()>
    where
        U: ParallelUpdateState<<Self::Minorant as Minorant>::Primal>,
        S: UpdateSender<Self> + 'static,
    {

        if self.inactive_constraints.read().unwrap().is_empty() {
            return Ok(());
        }

        let inactive_constraints = self.inactive_constraints.clone();
        let active_constraints = self.active_constraints.clone();
        let subdatas = self.subdatas.clone();







|
|
|
|
<
>







556
557
558
559
560
561
562
563
564
565
566

567
568
569
570
571
572
573
574
                }
                Err(err) => tx.error(err).unwrap(),
            }
        });
        Ok(())
    }

    fn update(
        &mut self,
        state: impl ParallelUpdateState<<Self::Minorant as Minorant>::Primal>,
        tx: impl UpdateSender<Self> + 'static,

    ) -> Result<()> {
        if self.inactive_constraints.read().unwrap().is_empty() {
            return Ok(());
        }

        let inactive_constraints = self.inactive_constraints.clone();
        let active_constraints = self.active_constraints.clone();
        let subdatas = self.subdatas.clone();