piecewise.cpp revision 90a3966dd44e306d23febc15ebd65cde07d7a4dd
/*
* piecewise.cpp - Piecewise function class
*
* Copyright 2007 Michael Sloan <mgsloan@gmail.com>
* Copyright 2007 JF Barraud
*
* modify it either under the terms of the GNU Lesser General Public
* License version 2.1 as published by the Free Software Foundation
* (the "LGPL") or, at your option, under the terms of the Mozilla
* Public License Version 1.1 (the "MPL"). If you do not alter this
* notice, a recipient may use your version of this file under either
* the MPL or the LGPL.
*
* You should have received a copy of the LGPL along with this library
* in the file COPYING-LGPL-2.1; if not, output to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* You should have received a copy of the MPL along with this library
* in the file COPYING-MPL-1.1
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
* OF ANY KIND, either express or implied. See the LGPL or the MPL for
* the specific language governing rights and limitations.
*
*/
#include <iterator>
#include <map>
namespace Geom {
return ret;
}
divide(Piecewise<SBasis> const &a, Piecewise<SBasis> const &b, double tol, unsigned k, double zero) {
}
return ret;
}
Piecewise<SBasis> divide(Piecewise<SBasis> const &a, SBasis const &b, double tol, unsigned k, double zero){
}
Piecewise<SBasis> divide(SBasis const &a, Piecewise<SBasis> const &b, double tol, unsigned k, double zero){
}
//TODO: have a better look at sgn(b).
}
SBasis c,r=a;
//TODO: what is a good relative tol? atm, c=a/b +/- (tol/a)%...
k+=1;
//assert(b.at0()!=0 && b.at1()!=0);
for (unsigned i=0; i<k; i++){
c[i]=ci;
}
}
return c0;
}
//-- compose(pw<T>,SBasis) ---------------
/*
the purpose of the following functions is only to reduce the code in piecewise.h
TODO: use a vector<pairs<double,unsigned> > instead of a map<double,unsigned>.
*/
}
}
// Also map 0 and 1 to the first value above(or =) g(0) and g(1).
unsigned i=0;
result[0.]=i;
}
unsigned i=0;
result[1.]=i;
}
return(result);
}
SBasis const &g){
} else { //g([t0,t1]) is contained in level idx0!...
}
//move idx back from levels f.cuts
idx+=1;
return idx;
}
for (unsigned i=0; i<f.size(); i++){
}
}
return result;
}
std::vector<std::vector<double> > multi_roots(Piecewise<SBasis> const &f, std::vector<double> const &values) {
for (unsigned i=0; i<f.size(); i++) {
}
}
}
return result;
}
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :