849

edits

Use OctaveForge template.

[[File:Interval-sombrero.png|280px|thumb|left|Example: Plotting the interval enclosure of a function]]<div style=~~= Motivation ==~~"clear:left"></div>

== ~~Theory ~~=Octave Forge simp package ===In 2008/2009 there was a Single Interval Mathematics Package (SIMP) for Octave, which has eventually become unmaintained at Octave Forge.

=== ~~Input and output ~~INTLAB ===~~Before exercising ~~This interval ~~arithmetic~~package is ''not'' meant to be a replacement for INTLAB and any compatibility with it is pure coincidence. Since both are compatible with GNU Octave, they happen to agree on many function names and programs written for INTLAB may possibly run with this interval ~~objects must be created, typically from ~~package as well. Some fundamental differences that I am currently aware of:* INTLAB is non-~~interval data~~free software, it grants none of the [http://www.gnu. ~~There are interval constants <code>empty<~~org/~~code> and <code>entire<~~philosophy/~~code> ~~free-sw.html four essential freedoms] of free software* INTLAB is not conforming to IEEE Std 1788-2015 and the ~~class constructors <code>infsup</code> ~~parsing of intervals from strings uses a different format—especially for ~~bare ~~the uncertain form* INTLAB supports intervals with complex numbers and ~~<code>infsupdec</code> ~~sparse interval matrices, but no empty intervals* INTLAB uses inferior accuracy for ~~decorated intervals. The class constructors are very sophisticated and ~~most arithmetic operations, because it focuses on speed* Basic operations can be ~~used with several kinds ~~found in both packages, but the availability of ~~parameters: Interval boundaries can be given by numeric values or string values with decimal numbers. Also it is possible to use so called interval literals with square brackets.~~special functions depends

|-

| ~~com<br/>~~disjoint (~~common~~a, b)| ~~style="text-align: center" | ✓~~~~| style="text-align: center" | ✓~~~~| style="text-align: center" | ✓~~~~| '''''x''''' is ~~emptyintersect (a ~~bounded~~, ~~nonempty subset of Dom(''f''); ''f'' is continuous at each point of '''''x'''''; and the computed interval ''f''('''''x'''''~~b) ~~is bounded~~

|-

| ~~dac<br/>~~hdist (~~defined & continuous~~a, b)|~~| style="text-align: center" | ✓~~~~| style="text-align: center" | ✓~~~~| '''''x''''' is ~~qdist (a ~~nonempty subset of Dom(''f''~~, b)~~; and the restriction of ''f'' to '''''x''''' is continuous~~

|-

| ~~def<br/>~~disp (~~defined~~x)|~~|~~~~| style="text-align: center" | ✓~~~~| '''''~~disp2str (x~~''''' is a nonempty subset of Dom(''f''~~)

|-

| ~~trv<br/>~~infsup (~~trivial~~s)|~~|~~~~|~~~~| always true ~~str2intval (~~so gives no information~~s)

|-

| ~~ill<br/>~~isa (~~ill-formed~~x, "infsup")|~~|~~~~|~~~~| Not an interval, at least one interval constructor failed during the course of computation~~isintval (x)

|}

=== ~~Arithmetic operations ~~Build ===The ~~interval packages comprises many interval arithmetic operations~~repository contains a Makefile which controls the build process. ~~Function names match GNU ~~Some common targets are:* <code>make release</code> Create a release tarball and the HTML documentation for [[Octave ~~standard functions where applicable, and follow recommendations by IEEE 1788 otherwise~~Forge]] (takes a while). ~~It is possible ~~* <code>make check</code> Run the full test-suite to ~~look up all ~~verify that code changes didn't break anything (takes a while).* <code>make run</code> Quickly start Octave with minimal recompilation and functions ~~by their corresponding IEEE 1788 name in ~~loaded from the ~~index {{Citation needed}}~~workspace (for interactive testing of code changes).

if (not (isa (x, "infsupdec"))) x =~~== Numerical operations ===~~infsupdec (x); endif~~Some operations on intervals do ~~ if (not ~~return an interval enclosure~~(isa (y, ~~but a single number. Most important are <code>inf</code> and <code>sup</code>, which return the interval boundaries in double precision.~~"infsupdec"))) y = infsupdec (y); endif

==== Vectorization & Indexing ====All functions should be implemented using vectorization and indexing. This is very important for performance on large data. For example, consider the plus function. It computes lower and upper boundaries of the result (x.inf, y.inf, x.sup, y.sup may be vectors or matrices) and then uses an indexing expression to adjust values where empty intervals would have produces problematic values. ~~octave:1> infsup ~~function x = plus (~~1~~x, ~~3~~y) ~~<~~ ... parameter checking ... l = ~~infsup ~~mpfr_function_d (~~2~~'plus', ~~4~~-inf, x.inf, y.inf); u = mpfr_function_d ('plus', +inf, x.sup, y.sup); ~~ans ~~ emptyresult = isempty (x) | isempty (y); l(emptyresult) = inf; u(emptyresult) = -inf; … ~~1~~endfunction

==~~= Error handling =~~VERSOFT ==~~Due to the nature of set-based interval arithmetic, you should never observe errors during computation~~The [http://uivtx.cs.cas. ~~If you do, there either is ~~cz/~rohn/matlab/ VERSOFT] software package (by Jiří Rohn) has been released under a ~~bug in ~~free software license (Expat license) and algorithms may be migrated into the ~~code or there are unsupported data types~~interval package.

[[Category:Octave~~-~~Forge]]

Retrieved from "https://wiki.octave.org/Special:MobileDiff/5182...12214"