use crate::deco::zhl16::*;
use crate::deco::TISSUE_COUNT;
#[derive(Copy, Clone, Debug)]
#[cfg_attr(feature = "use-serde", derive(serde::Serialize, serde::Deserialize))]
pub struct TissueConstants {
pub(crate) n2_a: [f64; TISSUE_COUNT],
pub(crate) n2_b: [f64; TISSUE_COUNT],
pub(crate) n2_hl: [f64; TISSUE_COUNT],
pub(crate) he_a: [f64; TISSUE_COUNT],
pub(crate) he_b: [f64; TISSUE_COUNT],
pub(crate) he_hl: [f64; TISSUE_COUNT],
}
impl TissueConstants {
pub fn new(
n2_a: [f64; TISSUE_COUNT],
n2_b: [f64; TISSUE_COUNT],
n2_hl: [f64; TISSUE_COUNT],
he_a: [f64; TISSUE_COUNT],
he_b: [f64; TISSUE_COUNT],
he_hl: [f64; TISSUE_COUNT],
) -> Self {
Self {
n2_a,
n2_b,
n2_hl,
he_a,
he_b,
he_hl,
}
}
pub fn new_by_variant(variant: Variant) -> Self {
match variant {
Variant::B => Self::new(
ZHL16B_N2_A,
ZHL16B_N2_B,
ZHL16B_N2_HALFLIFE,
ZHL16B_HE_A,
ZHL16B_HE_B,
ZHL16B_HE_HALFLIFE,
),
Variant::C => Self::new(
ZHL16C_N2_A,
ZHL16C_N2_B,
ZHL16C_N2_HALFLIFE,
ZHL16C_HE_A,
ZHL16C_HE_B,
ZHL16C_HE_HALFLIFE,
),
}
}
}