SummationMethods

Struct SummationMethods 

Source
pub struct SummationMethods;
Expand description

Summation methods and utilities

§Performance

All methods use closed-form formulas when applicable, providing O(1) time complexity for arithmetic/geometric series and power sums (k ≤ 3). General sums remain symbolic.

Implementations§

Source§

impl SummationMethods

Source

pub fn arithmetic_series( first_term: &Expression, common_difference: &Expression, num_terms: &Expression, ) -> Expression

Compute arithmetic series sum: Σ(a + (i-1)d) from i=1 to n

§Formula

Sum = n/2 * (2a + (n-1)d)

§Performance
  • Time Complexity: O(1) - uses closed-form formula
  • Space Complexity: O(1) - constant expression construction
Source

pub fn geometric_series( first_term: &Expression, common_ratio: &Expression, num_terms: &Expression, ) -> Expression

Compute geometric series sum: Σ(ar^(i-1)) from i=1 to n

§Formula

Sum = a * (1 - r^n) / (1 - r) for r ≠ 1

§Performance
  • Time Complexity: O(1) - uses closed-form formula
  • Space Complexity: O(1) - constant expression construction
Source

pub fn infinite_geometric_series( first_term: &Expression, common_ratio: &Expression, ) -> Expression

Compute infinite geometric series sum: Σ(ar^(i-1)) from i=1 to ∞

§Formula

Sum = a / (1 - r) for |r| < 1

§Domain Restriction

Convergence requires |r| < 1. For |r| ≥ 1, series diverges.

§Performance
  • Time Complexity: O(1) - uses closed-form formula
  • Space Complexity: O(1) - constant expression construction
Source

pub fn power_sum(power: &Expression, upper_limit: &Expression) -> Expression

Compute power sum: Σ(i^k) from i=1 to n using Faulhaber’s formulas

§Formulas (SymPy Validated)
  • k=0: Σ1 = n
  • k=1: Σi = n(n+1)/2
  • k=2: Σi² = n(n+1)(2n+1)/6
  • k=3: Σi³ = [n(n+1)/2]²
§Performance
  • Time Complexity: O(1) for k ∈ {0,1,2,3}, symbolic for k > 3
  • Space Complexity: O(1) - constant expression construction
Source

pub fn convergence_test( expr: &Expression, variable: &Symbol, ) -> ConvergenceResult

Check convergence of infinite series

Simplified p-series test: Σ(1/n^p) converges iff p > 1

§Performance
  • Time Complexity: O(1) - pattern matching only
  • Space Complexity: O(1) - returns enum variant

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.