Summation

Trait Summation 

Source
pub trait Summation {
    // Required methods
    fn finite_sum(
        &self,
        variable: &Symbol,
        start: &Expression,
        end: &Expression,
    ) -> Expression;
    fn infinite_sum(&self, variable: &Symbol, start: &Expression) -> Expression;
    fn finite_product(
        &self,
        variable: &Symbol,
        start: &Expression,
        end: &Expression,
    ) -> Expression;
    fn infinite_product(
        &self,
        variable: &Symbol,
        start: &Expression,
    ) -> Expression;
}
Expand description

Trait for summation and product operations

Required Methods§

Source

fn finite_sum( &self, variable: &Symbol, start: &Expression, end: &Expression, ) -> Expression

Compute finite sum

§Examples
use mathhook_core::{expr, symbol};
use mathhook_core::calculus::Summation;

let i = symbol!(i);
let start = expr!(1);
let end = expr!(10);
let result = i.clone().into().finite_sum(&i, &start, &end);
Source

fn infinite_sum(&self, variable: &Symbol, start: &Expression) -> Expression

Compute infinite sum

§Examples
use mathhook_core::{expr, symbol};
use mathhook_core::calculus::Summation;

let n = symbol!(n);
let expr = expr!(n ^ (-2));
let start = expr!(1);
let result = expr.infinite_sum(&n, &start);
Source

fn finite_product( &self, variable: &Symbol, start: &Expression, end: &Expression, ) -> Expression

Compute finite product

§Examples
use mathhook_core::{expr, symbol};
use mathhook_core::calculus::Summation;

let i = symbol!(i);
let start = expr!(1);
let end = expr!(5);
let result = i.clone().into().finite_product(&i, &start, &end);
Source

fn infinite_product(&self, variable: &Symbol, start: &Expression) -> Expression

Compute infinite product

§Examples
use mathhook_core::{expr, symbol};
use mathhook_core::calculus::Summation;

let n = symbol!(n);
let expr = expr!(1 + (n ^ (-2)));
let start = expr!(1);
let result = expr.infinite_product(&n, &start);

Implementors§