|
FAUST compiler
0.9.9.6b8
|
#include <math.h>#include <iostream>

Go to the source code of this file.
Classes | |
| struct | interval |
Functions | |
| ostream & | operator<< (ostream &dst, const interval &i) |
| double | min (double x, double y) |
| double | max (double x, double y) |
| double | min4 (double a, double b, double c, double d) |
| double | max4 (double a, double b, double c, double d) |
| interval | reunion (const interval &x, const interval &y) |
| interval | operator+ (const interval &x, const interval &y) |
| interval | operator- (const interval &x, const interval &y) |
| interval | operator* (const interval &x, const interval &y) |
| interval | operator/ (const interval &x, const interval &y) |
| interval | operator% (const interval &x, const interval &y) |
| int | bitmask (double x) |
| Convert a number 1bbb..b into a bit mask 1111..1 of same width. | |
| interval | operator& (const interval &x, const interval &y) |
| interval | operator| (const interval &x, const interval &y) |
| interval | operator^ (const interval &, const interval &) |
| interval | operator<< (const interval &, const interval &) |
| interval | operator>> (const interval &, const interval &) |
| interval | operator< (const interval &, const interval &) |
| interval | operator<= (const interval &, const interval &) |
| interval | operator> (const interval &, const interval &) |
| interval | operator>= (const interval &, const interval &) |
| interval | operator== (const interval &, const interval &) |
| interval | operator!= (const interval &, const interval &) |
| interval | min (const interval &x, const interval &y) |
| interval | max (const interval &x, const interval &y) |
| interval | abs (const interval &x) |
Definition at line 213 of file interval.hh.
References interval::hi, interval::lo, max(), and interval::valid.
Referenced by mterm::complexity(), AbsPrim::computeSigOutput(), AbsPrim::infereSigType(), isExpPower(), and isPiPower().
{
if (x.valid) {
if (x.lo >= 0) {
return x;
} else if (x.hi < 0) {
return interval(fabs(x.hi), fabs(x.lo));
} else {
return interval(0, max(fabs(x.lo), x.hi));
}
} else {
return x;
}
}


| int bitmask | ( | double | x | ) | [inline] |
Convert a number 1bbb..b into a bit mask 1111..1 of same width.
Definition at line 114 of file interval.hh.
Referenced by operator&(), and operator|().
{
int v = int(x);
for (int i=1; i<32; i*=2) { v |= v>>i; }
return v;
}

| double max | ( | double | x, |
| double | y | ||
| ) | [inline] |
Definition at line 60 of file interval.hh.
Referenced by abs(), common(), computeBoxComplexity(), computeHorzGap(), MaxPrim::computeSigOutput(), infereBoxType(), FmodPrim::infereSigOrder(), Atan2Prim::infereSigOrder(), PowPrim::infereSigOrder(), RemainderPrim::infereSigOrder(), MaxPrim::infereSigOrder(), MinPrim::infereSigOrder(), infereSigOrder(), MaxPrim::infereSigType(), infereSigType(), insideBoxSimplification(), isBoxHBargraph(), isBoxVBargraph(), DocCompiler::isShortEnough(), isSigHBargraph(), isSigVBargraph(), makeBlockSchema(), makeRecSchema(), max(), max4(), mergeinterval(), splitSchema::place(), mergeSchema::place(), seqSchema::place(), DocCompiler::prepareIntervallicUI(), preparePattern(), boxpp::print(), propagate(), reunion(), UserInterfaceDescription(), sigvisitor::visit(), and writeIdentValue().
{ return (x>y) ? x:y; }

Definition at line 208 of file interval.hh.
References interval::hi, interval::lo, and max().

| double max4 | ( | double | a, |
| double | b, | ||
| double | c, | ||
| double | d | ||
| ) | [inline] |
Definition at line 62 of file interval.hh.
References max().
Referenced by operator*().


| double min | ( | double | x, |
| double | y | ||
| ) | [inline] |
Definition at line 59 of file interval.hh.
Referenced by common(), computeBoxComplexity(), MinPrim::computeSigOutput(), decorateSchema::draw(), MinPrim::infereSigType(), infereSigType(), insideBoxSimplification(), isBoxHBargraph(), isBoxVBargraph(), isSigHBargraph(), isSigVBargraph(), mergeinterval(), min(), min4(), operator|(), DocCompiler::prepareIntervallicUI(), preparePattern(), boxpp::print(), propagate(), reunion(), UserInterfaceDescription(), sigvisitor::visit(), writeIdentValue(), and xVariability().
{ return (x<y) ? x:y; }

Definition at line 203 of file interval.hh.
References interval::hi, interval::lo, and min().

| double min4 | ( | double | a, |
| double | b, | ||
| double | c, | ||
| double | d | ||
| ) | [inline] |
Definition at line 61 of file interval.hh.
References min().
Referenced by operator*().


Definition at line 196 of file interval.hh.
{
return interval(0,1);
}
Definition at line 104 of file interval.hh.
References interval::hi, interval::lo, and interval::valid.
Definition at line 122 of file interval.hh.
References bitmask(), interval::hi, interval::lo, and interval::valid.
{
if (x.valid && y.valid) {
if (x.lo >= 0 & y.lo >= 0) {
return interval(0, bitmask(x.hi) & bitmask(y.hi));
} else if (y.lo >= 0) {
return interval(0, bitmask(y.hi));
} else if (x.lo >= 0) {
return interval(0, bitmask(y.hi));
} else {
return interval();
}
} else if (x.valid & x.lo >= 0) {
return interval(0, bitmask(x.hi));
} else if (y.valid & y.lo >= 0) {
return interval(0, bitmask(y.hi));
} else {
return interval();
}
}

Definition at line 84 of file interval.hh.
References interval::hi, interval::lo, max4(), min4(), and interval::valid.
{
if (x.valid&y.valid) {
double a=x.lo*y.lo;
double b=x.lo*y.hi;
double c=x.hi*y.lo;
double d=x.hi*y.hi;
return interval(min4(a,b,c,d), max4(a,b,c,d));
} else {
return interval();
}
}

Definition at line 74 of file interval.hh.
References interval::hi, interval::lo, and interval::valid.
Definition at line 79 of file interval.hh.
References interval::hi, interval::lo, and interval::valid.
Definition at line 97 of file interval.hh.
References interval::hi, interval::lo, and interval::valid.
Definition at line 171 of file interval.hh.
{
return interval(0,1);
}
| ostream& operator<< | ( | ostream & | dst, |
| const interval & | i | ||
| ) | [inline] |
Definition at line 50 of file interval.hh.
References interval::hi, interval::lo, and interval::valid.
Definition at line 157 of file interval.hh.
{
return interval();
}
Definition at line 176 of file interval.hh.
{
return interval(0,1);
}
Definition at line 191 of file interval.hh.
{
return interval(0,1);
}
Definition at line 181 of file interval.hh.
{
return interval(0,1);
}
Definition at line 186 of file interval.hh.
{
return interval(0,1);
}
Definition at line 162 of file interval.hh.
{
return interval();
}
Definition at line 152 of file interval.hh.
{
return interval();
}
Definition at line 143 of file interval.hh.
References bitmask(), interval::hi, interval::lo, and interval::valid.
{
if (x.valid && y.valid && x.lo >= 0 && y.lo >= 0) {
return interval(0, bitmask(x.hi) | bitmask(y.hi));
} else {
return interval();
}
}

Definition at line 64 of file interval.hh.
References interval::hi, interval::lo, max(), min(), and interval::valid.
Referenced by infereSigType(), and operator|().
{
if (x.valid & y.valid) {
return interval(min(x.lo,y.lo), max(x.hi,y.hi));
} else {
return interval();
}
}


1.8.0