AngouriMath

Navigation

← Back to list of members

ToPiecewise​(System.​Collections.​Generic.​IEnumerable{AngouriMath.​Entity.​Providedf})

 Method (no overloads)

Summary

Converts an IEnumerable into a piecewise function

Returns

A Piecewise node

Example

The absolute value, written as two guarded branches:
var abs = new[]
{
    new Providedf("x", "x > 0"),
    new Providedf("-x", "x <= 0")
}.ToPiecewise();
Console.WriteLine(abs);
Console.WriteLine(abs.Substitute("x", -3).Simplify());

Prints
piecewise(x provided (x > 0), (-x) provided (x <= 0))
3

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online