Subversion Repositories Scribus

Rev

Rev 15347 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
15347 fschmid 1
/*
2
 *  sbasis-math.h - some std functions to work with (pw)s-basis
12065 fschmid 3
 *
4
 *  Authors:
5
 *   Jean-Francois Barraud
6
 *
7
 * Copyright (C) 2006-2007 authors
8
 *
9
 * This library is free software; you can redistribute it and/or
10
 * modify it either under the terms of the GNU Lesser General Public
11
 * License version 2.1 as published by the Free Software Foundation
12
 * (the "LGPL") or, at your option, under the terms of the Mozilla
13
 * Public License Version 1.1 (the "MPL"). If you do not alter this
14
 * notice, a recipient may use your version of this file under either
15
 * the MPL or the LGPL.
16
 *
17
 * You should have received a copy of the LGPL along with this library
18
 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
18122 mrdocs 19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
12065 fschmid 20
 * You should have received a copy of the MPL along with this library
21
 * in the file COPYING-MPL-1.1
22
 *
23
 * The contents of this file are subject to the Mozilla Public License
24
 * Version 1.1 (the "License"); you may not use this file except in
25
 * compliance with the License. You may obtain a copy of the License at
26
 * http://www.mozilla.org/MPL/
27
 *
28
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
29
 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
30
 * the specific language governing rights and limitations.
31
 */
32
 
33
//this a first try to define sqrt, cos, sin, etc...
34
//TODO: define a truncated compose(sb,sb, order) and extend it to pw<sb>.
35
//TODO: in all these functions, compute 'order' according to 'tol'.
36
//TODO: use template to define the pw version automatically from the sb version?
37
 
38
#ifndef SEEN_GEOM_SB_CALCULS_H
39
#define SEEN_GEOM_SB_CALCULS_H
40
 
41
 
42
#include "sbasis.h"
43
#include "piecewise.h"
44
 
45
namespace Geom{
46
//-|x|---------------------------------------------------------------
47
Piecewise<SBasis> abs(          SBasis const &f);
48
Piecewise<SBasis> abs(Piecewise<SBasis>const &f);
49
 
50
//- max(f,g), min(f,g) ----------------------------------------------
51
Piecewise<SBasis> max(          SBasis  const &f,           SBasis  const &g);
52
Piecewise<SBasis> max(Piecewise<SBasis> const &f,           SBasis  const &g);
53
Piecewise<SBasis> max(          SBasis  const &f, Piecewise<SBasis> const &g);
54
Piecewise<SBasis> max(Piecewise<SBasis> const &f, Piecewise<SBasis> const &g);
55
Piecewise<SBasis> min(          SBasis  const &f,           SBasis  const &g);
56
Piecewise<SBasis> min(Piecewise<SBasis> const &f,           SBasis  const &g);
57
Piecewise<SBasis> min(          SBasis  const &f, Piecewise<SBasis> const &g);
58
Piecewise<SBasis> min(Piecewise<SBasis> const &f, Piecewise<SBasis> const &g);
59
 
60
//-sign(x)---------------------------------------------------------------
61
Piecewise<SBasis> signSb(          SBasis const &f);
62
Piecewise<SBasis> signSb(Piecewise<SBasis>const &f);
63
 
64
//-Sqrt---------------------------------------------------------------
65
Piecewise<SBasis> sqrt(          SBasis const &f, double tol=1e-3, int order=3);
66
Piecewise<SBasis> sqrt(Piecewise<SBasis>const &f, double tol=1e-3, int order=3);
67
 
68
//-sin/cos--------------------------------------------------------------
69
Piecewise<SBasis> cos(          SBasis  const &f, double tol=1e-3, int order=3);
70
Piecewise<SBasis> cos(Piecewise<SBasis> const &f, double tol=1e-3, int order=3);
71
Piecewise<SBasis> sin(          SBasis  const &f, double tol=1e-3, int order=3);
72
Piecewise<SBasis> sin(Piecewise<SBasis> const &f, double tol=1e-3, int order=3);
73
//-Log---------------------------------------------------------------
74
Piecewise<SBasis> log(          SBasis const &f, double tol=1e-3, int order=3);
75
Piecewise<SBasis> log(Piecewise<SBasis>const &f, double tol=1e-3, int order=3);
76
 
77
//--1/x------------------------------------------------------------
78
//TODO: change this...
79
Piecewise<SBasis> reciprocalOnDomain(Interval range, double tol=1e-3);
80
Piecewise<SBasis> reciprocal(          SBasis const &f, double tol=1e-3, int order=3);
81
Piecewise<SBasis> reciprocal(Piecewise<SBasis>const &f, double tol=1e-3, int order=3);
82
 
83
}
84
 
85
#endif //SEEN_GEOM_PW_SB_CALCULUS_H
86
/*
87
  Local Variables:
88
  mode:c++
89
  c-file-style:"stroustrup"
90
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
91
  indent-tabs-mode:nil
92
  fill-column:99
93
  End:
94
*/
15347 fschmid 95
// vim: filetype = cpp:expandtab:shiftwidth = 4:tabstop = 8:softtabstop = 4:encoding = utf-8:textwidth = 99 :