RsBundle  Diff

Differences From Artifact [3669a1775e]:

  • File src/solver/sync.rs — part of check-in [043546e5db] at 2020-07-27 12:39:39 on branch async — sync: show number of subproblem evaluations in log output (user: fifr size: 29122) [more...]

To Artifact [5bf7e11a8c]:

  • File src/solver/sync.rs — part of check-in [57ea9c19e3] at 2022-03-28 14:20:36 on branch trunk — Remove `std::error::Error` requirement on `FirstOrderProblem::Err` (user: fifr size: 29001)

1
2
3
4
5
6
7
8
9
/*
 * Copyright (c) 2019, 2020 Frank Fischer <frank-fischer@shadow-soft.de>
 *
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but

|







1
2
3
4
5
6
7
8
9
/*
 * Copyright (c) 2019-2022 Frank Fischer <frank-fischer@shadow-soft.de>
 *
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
pub type NoBundleSolver<P> = Solver<P, StandardTerminator, HKWeighter, crate::master::MinimalMasterBuilder>;

/// Error raised by the parallel bundle [`Solver`].
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum Error<PErr, MErr>
where
    PErr: std::error::Error + 'static,
    MErr: std::error::Error + 'static,
{
    #[error("master problem creation failed")]
    BuildMaster(#[source] MErr),
    #[error("error solving the master problem")]
    Master(#[source] MasterError<PErr, MErr>),
    #[error("iteration limit ({limit}) has been reached")]
    IterationLimit { limit: usize },







|
|







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
pub type NoBundleSolver<P> = Solver<P, StandardTerminator, HKWeighter, crate::master::MinimalMasterBuilder>;

/// Error raised by the parallel bundle [`Solver`].
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum Error<PErr, MErr>
where
    PErr: 'static,
    MErr: 'static,
{
    #[error("master problem creation failed")]
    BuildMaster(#[source] MErr),
    #[error("error solving the master problem")]
    Master(#[source] MasterError<PErr, MErr>),
    #[error("iteration limit ({limit}) has been reached")]
    IterationLimit { limit: usize },
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
            <P as FirstOrderProblem>::Minorant,
        >>::Err,
    >,
>;

impl<PErr, MErr> From<MasterError<PErr, MErr>> for Error<PErr, MErr>
where
    PErr: std::error::Error + 'static,
    MErr: std::error::Error + 'static,
{
    fn from(err: MasterError<PErr, MErr>) -> Error<PErr, MErr> {
        Error::Master(err)
    }
}

impl<PErr, MErr> From<RecvError> for Error<PErr, MErr>
where
    PErr: std::error::Error + 'static,
    MErr: std::error::Error + 'static,
{
    fn from(err: RecvError) -> Error<PErr, MErr> {
        Error::DisconnectedReceiver(err)
    }
}

#[derive(Debug, Clone)]







|
|








|
|







92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
            <P as FirstOrderProblem>::Minorant,
        >>::Err,
    >,
>;

impl<PErr, MErr> From<MasterError<PErr, MErr>> for Error<PErr, MErr>
where
    PErr: 'static,
    MErr: 'static,
{
    fn from(err: MasterError<PErr, MErr>) -> Error<PErr, MErr> {
        Error::Master(err)
    }
}

impl<PErr, MErr> From<RecvError> for Error<PErr, MErr>
where
    PErr: 'static,
    MErr: 'static,
{
    fn from(err: RecvError) -> Error<PErr, MErr> {
        Error::DisconnectedReceiver(err)
    }
}

#[derive(Debug, Clone)]