Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
TobTobXX committed Apr 19, 2022
1 parent 2bb3261 commit 67cff41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,25 +663,29 @@ storage_types! {
types: Complex;
impl crate::Conversion<V> for V {
type T = VV;

#[inline(always)]
fn constant(op: crate::ConstantOp) -> Self::T {
match op {
crate::ConstantOp::Add => -<Self::T as crate::num::Zero>::zero(),
crate::ConstantOp::Sub => <Self::T as crate::num::Zero>::zero(),
}
}

#[inline(always)]
fn conversion(&self) -> Self::T {
// Conversion factor is the norm of the number. Scaling with length again yields the
// same number.
self.norm()
}
}

impl crate::ConversionFactor<V> for VV {
#[inline(always)]
fn powi(self, e: i32) -> Self {
self.powi(e)
}

#[inline(always)]
fn value(self) -> V {
// Conversion by scaling (multiplication with only real number). Scaling a normalized
Expand Down

0 comments on commit 67cff41

Please sign in to comment.