Struct TallyResult
pub struct TallyResult {
pub value: f64,
pub error: f64,
}
Expand description
Tally result containing a value and relative error
All tally results are output as <value>
<error>
pairs. Each pair is
stored as a TallyResult to avoid maintiaing multiple arrays and indexing
both to retrieve data that should be linked.
For example:
vals
1.00000E+00 0.1230 2.00000E+00 0.4560 3.00000E+00 0.7890 ...
[
TallyResult {
value: 1.00000E+00,
error: 0.1230,
},
TallyResult {
value: 2.00000E+00,
error: 0.4560,
},
TallyResult {
value: 3.00000E+00,
error: 0.7890,
},
...
]
Fields§
§value: f64
Tally result value
error: f64
Relative uncertainty
Implementations§
§impl TallyResult
impl TallyResult
pub fn absolute_error(&self) -> f64
pub fn absolute_error(&self) -> f64
Absolute error on the result
For example:
let result = TallyResult {
value: 50.0,
error: 0.10,
};
/// 10% relative error => 50.0 +/-5.0
assert_eq!(result.absolute_error(), 5.0);
pub fn relative_error(&self) -> f64
pub fn relative_error(&self) -> f64
Relative error on the result
The MCNP tally outputs are provided and stored as the relative uncertainty anyway. However, having both absolute_error() and relative_error() methods makes intent explicit.
For example:
let result = TallyResult {
value: 50.0,
error: 0.10,
};
/// 10% relative error => 50.0 +/-5.0
assert_eq!(result.relative_error(), 0.1);
Trait Implementations§
§impl Debug for TallyResult
impl Debug for TallyResult
§impl Default for TallyResult
impl Default for TallyResult
§fn default() -> TallyResult
fn default() -> TallyResult
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TallyResult
impl RefUnwindSafe for TallyResult
impl Send for TallyResult
impl Sync for TallyResult
impl Unpin for TallyResult
impl UnwindSafe for TallyResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.