1%define OT_Function_doc 2"Function base class. 3 4Notes 5----- 6A function acts on points to produce points: :math:`f: \Rset^d \rightarrow \Rset^{d'}`. 7 8A function enables to evaluate its gradient and its hessian when mathematically defined. 9 10 11Examples 12-------- 13Create a *Function* from a list of analytical formulas and 14descriptions of the input vector and the output vector : 15 16>>> import openturns as ot 17>>> f = ot.SymbolicFunction(['x0', 'x1'], 18... ['x0 + x1', 'x0 - x1']) 19>>> print(f([1, 2])) 20[3,-1] 21 22 23Create a *Function* from strings: 24 25>>> import openturns as ot 26>>> f = ot.SymbolicFunction('x', '2.0*sqrt(x)') 27>>> print(f(([16],[4]))) 28 [ y0 ] 290 : [ 8 ] 301 : [ 4 ] 31 32 33Create a *Function* from a Python function: 34 35>>> def a_function(X): 36... return [X[0] + X[1]] 37>>> f = ot.PythonFunction(2, 1, a_function) 38>>> print(f(((10, 5),(6, 7)))) 39 [ y0 ] 400 : [ 15 ] 411 : [ 13 ] 42 43 44See :class:`~openturns.PythonFunction` for further details. 45 46Create a *Function* from a Python class: 47 48>>> class FUNC(OpenTURNSPythonFunction): 49... def __init__(self): 50... super(FUNC, self).__init__(2, 1) 51... self.setInputDescription(['R', 'S']) 52... self.setOutputDescription(['T']) 53... def _exec(self, X): 54... Y = [X[0] + X[1]] 55... return Y 56>>> F = FUNC() 57>>> myFunc = Function(F) 58>>> print(myFunc((1.0, 2.0))) 59[3] 60 61 62See :class:`~openturns.PythonFunction` for further details. 63 64Create a *Function* from another *Function*: 65 66>>> f = ot.SymbolicFunction(ot.Description.BuildDefault(4, 'x'), 67... ['x0', 'x0 + x1', 'x0 + x2 + x3']) 68 69Then create another function by setting x1=4 and x3=10: 70 71>>> g = ot.ParametricFunction(f, [3, 1], [10.0, 4.0], True) 72>>> print(g.getInputDescription()) 73[x0,x2] 74>>> print(g((1, 2))) 75[1,5,13] 76 77Or by setting x0=6 and x2=5: 78 79>>> g = ot.ParametricFunction(f, [3, 1], [6.0, 5.0], False) 80>>> print(g.getInputDescription()) 81[x3,x1] 82>>> print(g((1, 2))) 83[6,8,12] 84 85 86Create a *Function* from another *Function* 87and by using a comparison operator: 88 89>>> analytical = ot.SymbolicFunction(['x0','x1'], ['x0 + x1']) 90>>> indicator = ot.IndicatorFunction(ot.LevelSet(analytical, ot.Less(), 0.0)) 91>>> print(indicator([2, 3])) 92[0] 93>>> print(indicator([2, -3])) 94[1] 95 96Create a *Function* from a collection of functions: 97 98>>> functions = list() 99>>> functions.append(ot.SymbolicFunction(['x1', 'x2', 'x3'], 100... ['x1^2 + x2', 'x1 + x2 + x3'])) 101>>> functions.append(ot.SymbolicFunction(['x1', 'x2', 'x3'], 102... ['x1 + 2 * x2 + x3', 'x1 + x2 - x3'])) 103>>> myFunction = ot.AggregatedFunction(functions) 104>>> print(myFunction([1.0, 2.0, 3.0])) 105[3,6,8,0] 106 107Create a *Function* which is the linear combination *linComb* 108of the functions defined in *functionCollection* with scalar weights 109defined in *scalarCoefficientColl*: 110 111:math:`functionCollection = (f_1, \hdots, f_N)` 112where :math:`\forall 1 \leq i \leq N, \, f_i: \Rset^n \rightarrow \Rset^{p}` 113and :math:`scalarCoefficientColl = (c_1, \hdots, c_N) \in \Rset^N` 114then the linear combination is: 115 116.. math:: 117 118 linComb: \left|\begin{array}{rcl} 119 \Rset^n & \rightarrow & \Rset^{p} \\ 120 \vect{X} & \mapsto & \displaystyle \sum_i c_if_i (\vect{X}) 121 \end{array}\right. 122 123>>> myFunction2 = ot.LinearCombinationFunction(functions, [2.0, 4.0]) 124>>> print(myFunction2([1.0, 2.0, 3.0])) 125[38,12] 126 127 128Create a *Function* which is the linear combination 129*vectLinComb* of the scalar functions defined in 130*scalarFunctionCollection* with vectorial weights defined in 131*vectorCoefficientColl*: 132 133If :math:`scalarFunctionCollection = (f_1, \hdots, f_N)` 134where :math:`\forall 1 \leq i \leq N, \, f_i: \Rset^n \rightarrow \Rset` 135and :math:`vectorCoefficientColl = (\vect{c}_1, \hdots, \vect{c}_N)` 136where :math:`\forall 1 \leq i \leq N, \, \vect{c}_i \in \Rset^p` 137 138.. math:: 139 140 vectLinComb: \left|\begin{array}{rcl} 141 \Rset^n & \rightarrow & \Rset^{p} \\ 142 \vect{X} & \mapsto & \displaystyle \sum_i \vect{c}_if_i (\vect{X}) 143 \end{array}\right. 144 145>>> functions=list() 146>>> functions.append(ot.SymbolicFunction(['x1', 'x2', 'x3'], 147... ['x1 + 2 * x2 + x3'])) 148>>> functions.append(ot.SymbolicFunction(['x1', 'x2', 'x3'], 149... ['x1^2 + x2'])) 150>>> myFunction2 = ot.DualLinearCombinationFunction(functions, [[2., 4.], [3., 1.]]) 151>>> print(myFunction2([1, 2, 3])) 152[25,35] 153 154 155Create a *Function* from values of the inputs and the outputs: 156 157>>> inputSample = [[1.0, 1.0], [2.0, 2.0]] 158>>> outputSample = [[4.0], [5.0]] 159>>> database = ot.DatabaseFunction(inputSample, outputSample) 160>>> x = [1.8]*database.getInputDimension() 161>>> print(database(x)) 162[5] 163 164 165Create a *Function* which is the composition function 166:math:`f\circ g`: 167 168>>> g = ot.SymbolicFunction(['x1', 'x2'], 169... ['x1 + x2','3 * x1 * x2']) 170>>> f = ot.SymbolicFunction(['x1', 'x2'], ['2 * x1 - x2']) 171>>> composed = ot.ComposedFunction(f, g) 172>>> print(composed([3, 4])) 173[-22]" 174%enddef 175%feature("docstring") OT::FunctionImplementation 176OT_Function_doc 177 178// --------------------------------------------------------------------- 179 180%define OT_Function_getCallsNumber_doc 181"Accessor to the number of times the function has been called. 182 183Returns 184------- 185calls_number : int 186 Integer that counts the number of times the function has been called 187 since its creation." 188%enddef 189%feature("docstring") OT::FunctionImplementation::getCallsNumber 190OT_Function_getCallsNumber_doc 191 192// --------------------------------------------------------------------- 193 194%define OT_Function_getEvaluationCallsNumber_doc 195"Accessor to the number of times the function has been called. 196 197Returns 198------- 199evaluation_calls_number : int 200 Integer that counts the number of times the function has been called 201 since its creation." 202%enddef 203%feature("docstring") OT::FunctionImplementation::getEvaluationCallsNumber 204OT_Function_getEvaluationCallsNumber_doc 205 206// --------------------------------------------------------------------- 207 208%define OT_Function_getGradientCallsNumber_doc 209"Accessor to the number of times the gradient of the function has been called. 210 211Returns 212------- 213gradient_calls_number : int 214 Integer that counts the number of times the gradient of the 215 Function has been called since its creation. 216 Note that if the gradient is implemented by a finite difference method, 217 the gradient calls number is equal to 0 and the different calls are 218 counted in the evaluation calls number." 219%enddef 220%feature("docstring") OT::FunctionImplementation::getGradientCallsNumber 221OT_Function_getGradientCallsNumber_doc 222 223// --------------------------------------------------------------------- 224 225%define OT_Function_getHessianCallsNumber_doc 226"Accessor to the number of times the hessian of the function has been called. 227 228Returns 229------- 230hessian_calls_number : int 231 Integer that counts the number of times the hessian of the 232 Function has been called since its creation. 233 Note that if the hessian is implemented by a finite difference method, 234 the hessian calls number is equal to 0 and the different calls are counted 235 in the evaluation calls number." 236%enddef 237%feature("docstring") OT::FunctionImplementation::getHessianCallsNumber 238OT_Function_getHessianCallsNumber_doc 239 240// --------------------------------------------------------------------- 241%define OT_Function_getMarginal_doc 242"Accessor to marginal. 243 244Parameters 245---------- 246indices : int or list of ints 247 Set of indices for which the marginal is extracted. 248 249Returns 250------- 251marginal : :class:`~openturns.Function` 252 Function corresponding to either :math:`f_i` or 253 :math:`(f_i)_{i \in indices}`, with :math:`f:\Rset^n \rightarrow \Rset^p` 254 and :math:`f=(f_0 , \dots, f_{p-1})`." 255%enddef 256%feature("docstring") OT::FunctionImplementation::getMarginal 257OT_Function_getMarginal_doc 258 259// --------------------------------------------------------------------- 260 261%define OT_Function_getImplementation_doc 262"Accessor to the evaluation, gradient and hessian functions. 263 264Returns 265------- 266function : :class:`~openturns.FunctionImplementation` 267 The evaluation, gradient and hessian function. 268 269Examples 270-------- 271>>> import openturns as ot 272>>> f = ot.SymbolicFunction(['x1', 'x2'], 273... ['2 * x1^2 + x1 + 8 * x2 + 4 * cos(x1) * x2 + 6']) 274>>> print(f.getImplementation()) 275input : [x1,x2] 276output : [y0] 277evaluation : 2 * x1^2 + x1 + 8 * x2 + 4 * cos(x1) * x2 + 6 278gradient : 279| d(y) / d(x1) = (1)+(4*x1)+((-4*((x2)*(sin(x1))))) 280| d(y) / d(x2) = (8)+((4*(cos(x1)))) 281 282hessian : 283| d^2(y) / d(x1)^2 = (4)+((-4*((x2)*(cos(x1))))) 284| d^2(y) / d(x2)d(x1) = (-4*(sin(x1))) 285| d^2(y) / d(x2)^2 = 0" 286%enddef 287%feature("docstring") OT::FunctionImplementation::getImplementation 288OT_Function_getImplementation_doc 289 290// --------------------------------------------------------------------- 291 292%define OT_Function_getEvaluation_doc 293"Accessor to the evaluation function. 294 295Returns 296------- 297function : :class:`~openturns.EvaluationImplementation` 298 The evaluation function. 299 300Examples 301-------- 302>>> import openturns as ot 303>>> f = ot.SymbolicFunction(['x1', 'x2'], 304... ['2 * x1^2 + x1 + 8 * x2 + 4 * cos(x1) * x2 + 6']) 305>>> print(f.getEvaluation()) 306[x1,x2]->[2 * x1^2 + x1 + 8 * x2 + 4 * cos(x1) * x2 + 6]" 307%enddef 308%feature("docstring") OT::FunctionImplementation::getEvaluation 309OT_Function_getEvaluation_doc 310 311// --------------------------------------------------------------------- 312 313%define OT_Function_getGradient_doc 314"Accessor to the gradient function. 315 316Returns 317------- 318gradient : :class:`~openturns.GradientImplementation` 319 The gradient function." 320%enddef 321%feature("docstring") OT::FunctionImplementation::getGradient 322OT_Function_getGradient_doc 323 324// --------------------------------------------------------------------- 325 326%define OT_Function_getHessian_doc 327"Accessor to the hessian function. 328 329Returns 330------- 331hessian : :class:`~openturns.HessianImplementation` 332 The hessian function." 333%enddef 334%feature("docstring") OT::FunctionImplementation::getHessian 335OT_Function_getHessian_doc 336 337// --------------------------------------------------------------------- 338 339%define OT_Function_setEvaluation_doc 340"Accessor to the evaluation function. 341 342Parameters 343---------- 344function : :class:`~openturns.EvaluationImplementation` 345 The evaluation function." 346%enddef 347%feature("docstring") OT::FunctionImplementation::setEvaluation 348OT_Function_setEvaluation_doc 349 350// --------------------------------------------------------------------- 351 352%define OT_Function_setGradient_doc 353"Accessor to the gradient function. 354 355Parameters 356---------- 357gradient_function : :class:`~openturns.GradientImplementation` 358 The gradient function. 359 360Examples 361-------- 362>>> import openturns as ot 363>>> f = ot.SymbolicFunction(['x1', 'x2'], 364... ['2 * x1^2 + x1 + 8 * x2 + 4 * cos(x1) * x2 + 6']) 365>>> f.setGradient(ot.CenteredFiniteDifferenceGradient( 366... ot.ResourceMap.GetAsScalar('CenteredFiniteDifferenceGradient-DefaultEpsilon'), 367... f.getEvaluation()))" 368%enddef 369%feature("docstring") OT::FunctionImplementation::setGradient 370OT_Function_setGradient_doc 371 372// --------------------------------------------------------------------- 373 374%define OT_Function_setHessian_doc 375"Accessor to the hessian function. 376 377Parameters 378---------- 379hessian_function : :class:`~openturns.HessianImplementation` 380 The hessian function. 381 382Examples 383-------- 384>>> import openturns as ot 385>>> f = ot.SymbolicFunction(['x1', 'x2'], 386... ['2 * x1^2 + x1 + 8 * x2 + 4 * cos(x1) * x2 + 6']) 387>>> f.setHessian(ot.CenteredFiniteDifferenceHessian( 388... ot.ResourceMap.GetAsScalar('CenteredFiniteDifferenceHessian-DefaultEpsilon'), 389... f.getEvaluation()))" 390%enddef 391%feature("docstring") OT::FunctionImplementation::setHessian 392OT_Function_setHessian_doc 393 394// --------------------------------------------------------------------- 395 396%define OT_Function_gradient_doc 397"Return the Jacobian transposed matrix of the function at a point. 398 399Parameters 400---------- 401point : sequence of float 402 Point where the Jacobian transposed matrix is calculated. 403 404Returns 405------- 406gradient : :class:`~openturns.Matrix` 407 The Jacobian transposed matrix of the function at *point*. 408 409Examples 410-------- 411>>> import openturns as ot 412>>> f = ot.SymbolicFunction(['x1', 'x2'], 413... ['2 * x1^2 + x1 + 8 * x2 + 4 * cos(x1) * x2 + 6','x1 + x2']) 414>>> print(f.gradient([3.14, 4])) 415[[ 13.5345 1 ] 416 [ 4.00001 1 ]]" 417%enddef 418%feature("docstring") OT::FunctionImplementation::gradient 419OT_Function_gradient_doc 420 421// --------------------------------------------------------------------- 422 423%define OT_Function_hessian_doc 424"Return the hessian of the function at a point. 425 426Parameters 427---------- 428point : sequence of float 429 Point where the hessian of the function is calculated. 430 431Returns 432------- 433hessian : :class:`~openturns.SymmetricTensor` 434 Hessian of the function at *point*. 435 436Examples 437-------- 438>>> import openturns as ot 439>>> f = ot.SymbolicFunction(['x1', 'x2'], 440... ['2 * x1^2 + x1 + 8 * x2 + 4 * cos(x1) * x2 + 6','x1 + x2']) 441>>> print(f.hessian([3.14, 4])) 442sheet #0 443[[ 20 -0.00637061 ] 444 [ -0.00637061 0 ]] 445sheet #1 446[[ 0 0 ] 447 [ 0 0 ]]" 448%enddef 449%feature("docstring") OT::FunctionImplementation::hessian 450OT_Function_hessian_doc 451 452// --------------------------------------------------------------------- 453 454%define OT_Function_getDescription_doc 455"Accessor to the description of the inputs and outputs. 456 457Returns 458------- 459description : :class:`~openturns.Description` 460 Description of the inputs and the outputs. 461 462Examples 463-------- 464>>> import openturns as ot 465>>> f = ot.SymbolicFunction(['x1', 'x2'], 466... ['2 * x1^2 + x1 + 8 * x2 + 4 * cos(x1) * x2 + 6']) 467>>> print(f.getDescription()) 468[x1,x2,y0]" 469%enddef 470%feature("docstring") OT::FunctionImplementation::getDescription 471OT_Function_getDescription_doc 472 473// --------------------------------------------------------------------- 474 475%define OT_Function_setDescription_doc 476"Accessor to the description of the inputs and outputs. 477 478Parameters 479---------- 480description : sequence of str 481 Description of the inputs and the outputs. 482 483Examples 484-------- 485>>> import openturns as ot 486>>> f = ot.SymbolicFunction(['x1', 'x2'], 487... ['2 * x1^2 + x1 + 8 * x2 + 4 * cos(x1) * x2 + 6']) 488>>> print(f.getDescription()) 489[x1,x2,y0] 490>>> f.setDescription(['a','b','y']) 491>>> print(f.getDescription()) 492[a,b,y]" 493%enddef 494%feature("docstring") OT::FunctionImplementation::setDescription 495OT_Function_setDescription_doc 496 497// --------------------------------------------------------------------- 498 499%define OT_Function_setInputDescription_doc 500"Accessor to the description of the input vector. 501 502Parameters 503---------- 504description : :class:`~openturns.Description` 505 Description of the input vector." 506%enddef 507%feature("docstring") OT::FunctionImplementation::setInputDescription 508OT_Function_setInputDescription_doc 509 510// --------------------------------------------------------------------- 511 512%define OT_Function_getInputDescription_doc 513"Accessor to the description of the input vector. 514 515Returns 516------- 517description : :class:`~openturns.Description` 518 Description of the input vector. 519 520Examples 521-------- 522>>> import openturns as ot 523>>> f = ot.SymbolicFunction(['x1', 'x2'], 524... ['2 * x1^2 + x1 + 8 * x2 + 4 * cos(x1) * x2 + 6']) 525>>> print(f.getInputDescription()) 526[x1,x2]" 527%enddef 528%feature("docstring") OT::FunctionImplementation::getInputDescription 529OT_Function_getInputDescription_doc 530 531// --------------------------------------------------------------------- 532 533%define OT_Function_setOutputDescription_doc 534"Accessor to the description of the output vector. 535 536Parameters 537---------- 538description : :class:`~openturns.Description` 539 Description of the output vector." 540%enddef 541%feature("docstring") OT::FunctionImplementation::setOutputDescription 542OT_Function_setOutputDescription_doc 543 544// --------------------------------------------------------------------- 545 546%define OT_Function_getOutputDescription_doc 547"Accessor to the description of the output vector. 548 549Returns 550------- 551description : :class:`~openturns.Description` 552 Description of the output vector. 553 554Examples 555-------- 556>>> import openturns as ot 557>>> f = ot.SymbolicFunction(['x1', 'x2'], 558... ['2 * x1^2 + x1 + 8 * x2 + 4 * cos(x1) * x2 + 6']) 559>>> print(f.getOutputDescription()) 560[y0]" 561%enddef 562%feature("docstring") OT::FunctionImplementation::getOutputDescription 563OT_Function_getOutputDescription_doc 564 565// --------------------------------------------------------------------- 566 567%define OT_Function_getInputDimension_doc 568"Accessor to the dimension of the input vector. 569 570Returns 571------- 572inputDim : int 573 Dimension of the input vector :math:`d`. 574 575Examples 576-------- 577>>> import openturns as ot 578>>> f = ot.SymbolicFunction(['x1', 'x2'], 579... ['2 * x1^2 + x1 + 8 * x2 + 4 * cos(x1) * x2 + 6']) 580>>> print(f.getInputDimension()) 5812" 582%enddef 583%feature("docstring") OT::FunctionImplementation::getInputDimension 584OT_Function_getInputDimension_doc 585 586// --------------------------------------------------------------------- 587 588%define OT_Function_getOutputDimension_doc 589"Accessor to the number of the outputs. 590 591Returns 592------- 593number_outputs : int 594 Dimension of the output vector :math:`d'`. 595 596Examples 597-------- 598>>> import openturns as ot 599>>> f = ot.SymbolicFunction(['x1', 'x2'], 600... ['2 * x1^2 + x1 + 8 * x2 + 4 * cos(x1) * x2 + 6']) 601>>> print(f.getOutputDimension()) 6021" 603%enddef 604%feature("docstring") OT::FunctionImplementation::getOutputDimension 605OT_Function_getOutputDimension_doc 606 607// --------------------------------------------------------------------- 608 609%define OT_Function_getParameterDimension_doc 610"Accessor to the dimension of the parameter. 611 612Returns 613------- 614parameterDimension : int 615 Dimension of the parameter." 616%enddef 617%feature("docstring") OT::FunctionImplementation::getParameterDimension 618OT_Function_getParameterDimension_doc 619 620// --------------------------------------------------------------------- 621 622%define OT_Function_draw_doc 623"Draw the output of function as a :class:`~openturns.Graph`. 624 625Available usages: 626 draw(*inputMarg, outputMarg, CP, xiMin, xiMax, ptNb*) 627 628 draw(*firstInputMarg, secondInputMarg, outputMarg, CP, xiMin_xjMin, xiMax_xjMax, ptNbs*) 629 630 draw(*xiMin, xiMax, ptNb*) 631 632 draw(*xiMin_xjMin, xiMax_xjMax, ptNbs*) 633 634Parameters 635---------- 636outputMarg, inputMarg : int, :math:`outputMarg, inputMarg \geq 0` 637 *outputMarg* is the index of the marginal to draw as a function of the marginal 638 with index *inputMarg*. 639firstInputMarg, secondInputMarg : int, :math:`firstInputMarg, secondInputMarg \geq 0` 640 In the 2D case, the marginal *outputMarg* is drawn as a function of the 641 two marginals with indexes *firstInputMarg* and *secondInputMarg*. 642CP : sequence of float 643 Central point. 644xiMin, xiMax : float 645 Define the interval where the curve is plotted. 646xiMin_xjMin, xiMax_xjMax : sequence of float of dimension 2. 647 In the 2D case, define the intervals where the curves are plotted. 648ptNb : int :math:`ptNb > 0` or list of ints of dimension 2 :math:`ptNb_k > 0, k=1,2` 649 The number of points to draw the curves. 650 651Notes 652----- 653We note :math:`f: \Rset^n \rightarrow \Rset^p` 654where :math:`\vect{x} = (x_1, \dots, x_n)` and 655:math:`f(\vect{x}) = (f_1(\vect{x}), \dots,f_p(\vect{x}))`, 656with :math:`n\geq 1` and :math:`p\geq 1`. 657 658- In the first usage: 659 660Draws graph of the given 1D *outputMarg* marginal 661:math:`f_k: \Rset^n \rightarrow \Rset` as a function of the given 1D *inputMarg* 662marginal with respect to the variation of :math:`x_i` in the interval 663:math:`[x_i^{min}, x_i^{max}]`, when all the other components of 664:math:`\vect{x}` are fixed to the corresponding ones of the central point *CP*. 665Then OpenTURNS draws the graph: 666:math:`t\in [x_i^{min}, x_i^{max}] \mapsto f_k(CP_1, \dots, CP_{i-1}, t, CP_{i+1} \dots, CP_n)`. 667 668- In the second usage: 669 670Draws the iso-curves of the given *outputMarg* marginal :math:`f_k` as a 671function of the given 2D *firstInputMarg* and *secondInputMarg* marginals 672with respect to the variation of :math:`(x_i, x_j)` in the interval 673:math:`[x_i^{min}, x_i^{max}] \times [x_j^{min}, x_j^{max}]`, when all the 674other components of :math:`\vect{x}` are fixed to the corresponding ones of the 675central point *CP*. Then OpenTURNS draws the graph: 676:math:`(t,u) \in [x_i^{min}, x_i^{max}] \times [x_j^{min}, x_j^{max}] \mapsto f_k(CP_1, \dots, CP_{i-1}, t, CP_{i+1}, \dots, CP_{j-1}, u, CP_{j+1} \dots, CP_n)`. 677 678- In the third usage: 679 680The same as the first usage but only for function :math:`f: \Rset \rightarrow \Rset`. 681 682- In the fourth usage: 683 684The same as the second usage but only for function :math:`f: \Rset^2 \rightarrow \Rset`. 685 686 687Examples 688-------- 689>>> import openturns as ot 690>>> from openturns.viewer import View 691>>> f = ot.SymbolicFunction('x', 'sin(2*pi_*x)*exp(-x^2/2)') 692>>> graph = f.draw(-1.2, 1.2, 100) 693>>> View(graph).show()" 694%enddef 695%feature("docstring") OT::FunctionImplementation::draw 696OT_Function_draw_doc 697 698// --------------------------------------------------------------------- 699 700%define OT_Function_getParameter_doc 701"Accessor to the parameter values. 702 703Returns 704------- 705parameter : :class:`~openturns.Point` 706 The parameter values." 707%enddef 708%feature("docstring") OT::FunctionImplementation::getParameter 709OT_Function_getParameter_doc 710 711// --------------------------------------------------------------------- 712 713%define OT_Function_setParameter_doc 714"Accessor to the parameter values. 715 716Parameters 717---------- 718parameter : sequence of float 719 The parameter values." 720%enddef 721%feature("docstring") OT::FunctionImplementation::setParameter 722OT_Function_setParameter_doc 723 724// --------------------------------------------------------------------- 725 726%define OT_Function_getParameterDescription_doc 727"Accessor to the parameter description. 728 729Returns 730------- 731parameter : :class:`~openturns.Description` 732 The parameter description." 733%enddef 734%feature("docstring") OT::FunctionImplementation::getParameterDescription 735OT_Function_getParameterDescription_doc 736 737// --------------------------------------------------------------------- 738 739%define OT_Function_setParameterDescription_doc 740"Accessor to the parameter description. 741 742Parameters 743---------- 744parameter : :class:`~openturns.Description` 745 The parameter description." 746%enddef 747%feature("docstring") OT::FunctionImplementation::setParameterDescription 748OT_Function_setParameterDescription_doc 749 750// --------------------------------------------------------------------- 751 752%define OT_Function_parameterGradient_doc 753"Accessor to the gradient against the parameter. 754 755Returns 756------- 757gradient : :class:`~openturns.Matrix` 758 The gradient." 759%enddef 760%feature("docstring") OT::FunctionImplementation::parameterGradient 761OT_Function_parameterGradient_doc 762 763// --------------------------------------------------------------------- 764 765%define OT_Function_isLinear_doc 766"Accessor to the linearity of the function. 767 768Returns 769------- 770linear : bool 771 *True* if the function is linear, *False* otherwise." 772%enddef 773%feature("docstring") OT::FunctionImplementation::isLinear 774OT_Function_isLinear_doc 775 776// --------------------------------------------------------------------- 777 778%define OT_Function_isLinearlyDependent_doc 779"Accessor to the linearity of the function with regard to a specific variable. 780 781Parameters 782---------- 783index : int 784 The index of the variable with regard to which linearity is evaluated. 785 786Returns 787------- 788linear : bool 789 *True* if the function is linearly dependent on the specified variable, *False* otherwise." 790%enddef 791%feature("docstring") OT::FunctionImplementation::isLinearlyDependent 792OT_Function_isLinearlyDependent_doc 793