You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jake Timothy edited this page Jan 19, 2016
·
3 revisions
This feature is not implemented yet!
Integration
Breeze comes with built-in integration facilities, located in
breeze.integrate module. At this moment, there is only 1d trapezoid and
Simpson interpolation available, but you are encouraged to contribute to
Breeze and write other integrators.
All examples in this document assumes that you've imported necessary modules:
scala>importbreeze.integrate._
1D integrals
breeze.integrate comes with one function for each integration method. Now,
there are trapezoid and simpson functions, both sharing
the same interface:
the function whose integral we want to compute; should be Double => Double
the beginning of the integration range
the end of the integration range
accuracy -- the number of nodes; higher the number, more accurate the
integral is, but also it takes more time; for trapezoid, there
must be at least two nodes while simpson requires three or more
nodes.
Trapezoid and Simpson integral don't support infinite integration ranges. Both
ends of the range must be finite.