Skip to main content

FtpResult

Struct FtpResult 

Source
pub struct FtpResult { /* private fields */ }
Expand description

Main structure holding all FTP calculation inputs and outputs.

§Examples

use ftp_core::{FtpResult, ComputeMethod};
use ndarray::array;

let mut result = FtpResult::new(
    array![[1000.0]],
    array![[1.0, 0.5, 0.2]],
    array![[0.01, 0.02]],
);
result.compute(ComputeMethod::Stock).unwrap();
assert!(result.stock_amort().is_some());

Implementations§

Source§

impl FtpResult

Source

pub fn new( input_outstanding: Array2<f64>, input_profiles: Array2<f64>, input_rate: Array2<f64>, ) -> Self

Creates a new FtpResult with the given input matrices.

Source

pub fn compute(&mut self, method: ComputeMethod) -> Result<(), FtpError>

Runs the FTP computation using the specified method.

Source

pub fn input_outstanding(&self) -> &Array2<f64>

Source

pub fn input_profiles(&self) -> &Array2<f64>

Source

pub fn input_rate(&self) -> &Array2<f64>

Source

pub fn stock_amort(&self) -> Option<&Array2<f64>>

Source

pub fn stock_instal(&self) -> Option<&Array2<f64>>

Source

pub fn varstock_amort(&self) -> Option<&Array2<f64>>

Source

pub fn varstock_instal(&self) -> Option<&Array2<f64>>

Source

pub fn ftp_rate(&self) -> Option<&Array2<f64>>

Source

pub fn ftp_int(&self) -> Option<&Array2<f64>>

Source

pub fn market_rate(&self) -> Option<&Array2<f64>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.