1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
#![allow(non_snake_case)]
use crate::algebra::*;
// ---------------
// equilibration data
// ---------------
/// Data from the Ruiz equilibration procedure
pub struct DefaultEquilibrationData<T> {
// scaling matrices for problem data equilibration
// fields d,e,dinv,einv are vectors of scaling values
// to be treated as diagonal scaling data
pub d: Vec<T>,
pub dinv: Vec<T>,
pub e: Vec<T>,
pub einv: Vec<T>,
// overall scaling for objective function
pub c: T,
}
impl<T> DefaultEquilibrationData<T>
where
T: FloatT,
{
pub fn new(n: usize, m: usize) -> Self {
// Left/Right diagonal scaling for problem data
let d = vec![T::one(); n];
let dinv = vec![T::one(); n];
let e = vec![T::one(); m];
let einv = vec![T::one(); m];
let c = T::one();
Self {
d,
dinv,
e,
einv,
c,
}
}
}