1 // Created on: 1998-09-22
2 // Created by: Philippe MANGIN
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <GeomLib_PolyFunc.hxx>
19 #include <math_Vector.hxx>
22 GeomLib_PolyFunc::GeomLib_PolyFunc(const math_Vector& Coeffs)
23 :myCoeffs(1, Coeffs.Length()-1)
24 { // On construit le polynome derive
25 for (Standard_Integer ii=1; ii<=myCoeffs.Length(); ii++)
26 myCoeffs(ii) = ii*Coeffs(ii+1);
29 Standard_Boolean GeomLib_PolyFunc::Value(const Standard_Real X,
32 Standard_Real * coeff = &myCoeffs(1);
33 Standard_Real * ff = &F;
34 PLib::EvalPolynomial(X, 0, myCoeffs.Length()-1, 1, coeff[0], ff[0]);
38 Standard_Boolean GeomLib_PolyFunc::Derivative(const Standard_Real X,
41 Standard_Real * coeff = &myCoeffs(1);
42 math_Vector Aux(1, 2);
43 Standard_Real * ff = &Aux(1);
44 PLib::EvalPolynomial(X, 1, myCoeffs.Length()-1, 1, coeff[0], ff[0]);
49 Standard_Boolean GeomLib_PolyFunc::Values(const Standard_Real X,
53 Standard_Real * coeff = &myCoeffs(1);
54 math_Vector Aux(1, 2);
55 Standard_Real * ff = &Aux(1);
56 PLib::EvalPolynomial(X, 1, myCoeffs.Length()-1, 1, coeff[0], ff[0]);