InfiniteSum
This case class represents an infinite sum of terms which can be derived by a function (f) which takes as its parameters the index of the term and the previous value of the term.
Type parameters
- X
-
a type for which there is evidence of Numeric[X].
Value parameters
- f
-
the function (see description above).
- x0
-
the initial value of type X which is used for the first term.
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Int => Xclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
The apply function which takes a number n and returns a value of X representing the (finite) sum of the first n terms of the infinite series.
The apply function which takes a number n and returns a value of X representing the (finite) sum of the first n terms of the infinite series.
Value parameters
- n
-
the number which specifies how many terms we should use to evaluate this infinite sum.
Attributes
- Returns
-
an X which represents an approximation to the infinite sum.
A function which takes a number n and returns a Double representing the (finite) sum of the first n terms of the infinite series.
A function which takes a number n and returns a Double representing the (finite) sum of the first n terms of the infinite series.
Value parameters
- n
-
the number which specifies how many terms we should use to evaluate this infinite sum.
Attributes
- Returns
-
a Double which represents an approximation to the infinite sum. This values depends on #apply(n).
Inherited methods
Composes two instances of Function1 in a new Function1, with this function applied first.
Composes two instances of Function1 in a new Function1, with this function applied first.
Type parameters
- A
-
the result type of function
g
Value parameters
- g
-
a function R => A
Attributes
- Returns
-
a new function
fsuch thatf(x) == g(apply(x)) - Inherited from:
- Function1
Composes two instances of Function1 in a new Function1, with this function applied last.
Composes two instances of Function1 in a new Function1, with this function applied last.
Type parameters
- A
-
the type to which function
gcan be applied
Value parameters
- g
-
a function A => T1
Attributes
- Returns
-
a new function
fsuch thatf(x) == apply(g(x)) - Inherited from:
- Function1
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Function1 -> Any
- Inherited from:
- Function1
Concrete fields
A lazy val representing the LazyList[X] which is all the terms of the infinite sum.
A lazy val representing the LazyList[X] which is all the terms of the infinite sum.