Logo Search packages:      
Sourcecode: inkscape version File versions

Piecewise< SBasis > Geom::max ( Piecewise< SBasis > const &  f,
Piecewise< SBasis > const &  g 
)

Return the greater of the two functions pointwise.

Parameters:
f,g two functions

Definition at line 88 of file sbasis-math.cpp.

References Geom::Piecewise< T >::cuts, max(), partition(), Geom::Piecewise< T >::segs, and Geom::Piecewise< T >::size().

                                                                             {
    Piecewise<SBasis> max=partition(f,roots(f-g));
    Piecewise<SBasis> gg =partition(g,max.cuts);
    max = partition(max,gg.cuts);
    for (unsigned i=0; i<max.size(); i++){
        if (max.segs[i](.5)<gg.segs[i](.5)) max.segs[i]=gg.segs[i];
    }
    return max;
}


Generated by  Doxygen 1.6.0   Back to index