pub(crate) fn vec_sub(a: &[f64],
                      b: &[f64])
                      -> Result<Vec<f64>, ProximalOptimizerErr> {
  if a.len() != b.len() {
    return Err(ProximalOptimizerErr::ParameterLengthMismatch);
  }
  let mut target = vec![0.0; a.len()];
  for i in 0..a.len() {
    target[i] = a[i] - b[i];
  }
  Ok(target)
}
/// Returns a newly allocated vector subtracting each `b` from each `a`.
Returns a newly allocated vector subtracting each `b` from each `a`.
Returns a newly allocated vector subtracting each ` b ` from each ` a ` .
pub(crate) fn vec_sub(a: &[f64],
                      b: &[f64])
                      -> Result<Vec<f64>, ProximalOptimizerErr> {
  if a.len() != b.len() {
    return Err(ProximalOptimizerErr::ParameterLengthMismatch);
  }
  let mut target = vec![0.0; a.len()];
  for i in 0..a.len() {
    target[i] = a[i] - b[i];
  }
  Ok(target)
}
pub ( crate ) fn vec_sub ( a : & [ f64 ] , b : & [ f64 ] ) -> Result < Vec < f64 > , ProximalOptimizerErr > { if a . len ( ) != b . len ( ) { return Err ( ProximalOptimizerErr :: ParameterLengthMismatch ) ; } let mut target = vec ! [ 0.0 a len ( ) ] ; for i in 0 .. a . len ( ) { target [ i ] = a [ i ] - b [ i ] ; } Ok ( target ) }
Returns a newly allocated vector subtracting each `b` from each `a`.
Returns a newly allocated vector subtracting each ` b ` from each ` a ` .
a
&[f64]
b
&[f64]
a
&[f64]
b
&[f64]