pub struct InputOutputModel { /* private fields */ }Expand description
Input-Output economic model (Leontief)
Implementations§
Source§impl InputOutputModel
impl InputOutputModel
Sourcepub fn new(sectors: usize, sector_names: Vec<String>) -> SimResult<Self>
pub fn new(sectors: usize, sector_names: Vec<String>) -> SimResult<Self>
Create a new input-output model
Sourcepub fn set_coefficient(
&mut self,
from_sector: usize,
to_sector: usize,
value: f64,
) -> SimResult<()>
pub fn set_coefficient( &mut self, from_sector: usize, to_sector: usize, value: f64, ) -> SimResult<()>
Set technical coefficient (how much sector j needs from sector i per unit output)
Sourcepub fn calculate_total_output(
&self,
final_demand: &[f64],
) -> SimResult<Vec<f64>>
pub fn calculate_total_output( &self, final_demand: &[f64], ) -> SimResult<Vec<f64>>
Calculate total output required for given final demand Using Leontief inverse: X = (I - A)^(-1) * D
Sourcepub fn multipliers(&self) -> SimResult<Vec<f64>>
pub fn multipliers(&self) -> SimResult<Vec<f64>>
Calculate multipliers (how much total output changes for 1 unit change in final demand)
Sourcepub fn sector_names(&self) -> &[String]
pub fn sector_names(&self) -> &[String]
Get sector names
Trait Implementations§
Source§impl Clone for InputOutputModel
impl Clone for InputOutputModel
Source§fn clone(&self) -> InputOutputModel
fn clone(&self) -> InputOutputModel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InputOutputModel
impl Debug for InputOutputModel
Source§impl<'de> Deserialize<'de> for InputOutputModel
impl<'de> Deserialize<'de> for InputOutputModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for InputOutputModel
impl RefUnwindSafe for InputOutputModel
impl Send for InputOutputModel
impl Sync for InputOutputModel
impl Unpin for InputOutputModel
impl UnwindSafe for InputOutputModel
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