1%define OT_OptimizationProblem_doc 2"Base class to define an optimization problem. 3 4This represents a general optimization problem: 5 6.. math:: 7 8 \min_{x\in B} f(x) \\ 9 g(x) = 0 \\ 10 h(x) \ge 0 11 12where *B* is problem's bounds, *f* is the objective function, *g* are equality constraints, and *h* are inequality constraints. 13 14Available constructors: 15 OptimizationProblem(*objective*) 16 17 OptimizationProblem(*objective, equality, inequality, bounds*) 18 19Parameters 20---------- 21objective : :class:`~openturns.Function` 22 Objective function. Additional constraints and bounds must always be 23 consistent with the objective input dimension. 24equality : :class:`~openturns.Function` 25 Equality constraints. 26inequality : :class:`~openturns.Function` 27 Inequality constraints. 28bounds : :class:`~openturns.Interval` 29 Bounds. 30 31Examples 32-------- 33 34Define an optimization problem to find the minimum of the Rosenbrock function: 35 36>>> import openturns as ot 37>>> rosenbrock = ot.SymbolicFunction(['x1', 'x2'], ['(1-x1)^2+100*(x2-x1^2)^2']) 38>>> problem = ot.OptimizationProblem(rosenbrock)" 39 40%enddef 41 42%feature("docstring") OT::OptimizationProblemImplementation 43OT_OptimizationProblem_doc 44 45// --------------------------------------------------------------------- 46 47%define OT_OptimizationProblem_getBounds_doc 48"Accessor to bounds. 49 50Returns 51------- 52bounds : :class:`~openturns.Interval` 53 Problem bounds." 54 55%enddef 56 57%feature("docstring") OT::OptimizationProblemImplementation::getBounds 58OT_OptimizationProblem_getBounds_doc 59 60// --------------------------------------------------------------------- 61 62%define OT_OptimizationProblem_getDimension_doc 63"Accessor to input dimension. 64 65Returns 66------- 67dimension : int 68 Input dimension of objective function." 69 70%enddef 71 72%feature("docstring") OT::OptimizationProblemImplementation::getDimension 73OT_OptimizationProblem_getDimension_doc 74 75// --------------------------------------------------------------------- 76 77%define OT_OptimizationProblem_getEqualityConstraint_doc 78"Accessor to equality constraints. 79 80Returns 81------- 82equality : :class:`~openturns.Function` 83 Describe equality constraints." 84 85%enddef 86 87%feature("docstring") OT::OptimizationProblemImplementation::getEqualityConstraint 88OT_OptimizationProblem_getEqualityConstraint_doc 89 90// --------------------------------------------------------------------- 91 92%define OT_OptimizationProblem_getInequalityConstraint_doc 93"Accessor to inequality constraints. 94 95Returns 96------- 97inequality : :class:`~openturns.Function` 98 Describe inequality constraints." 99 100%enddef 101 102%feature("docstring") OT::OptimizationProblemImplementation::getInequalityConstraint 103OT_OptimizationProblem_getInequalityConstraint_doc 104 105// --------------------------------------------------------------------- 106 107%define OT_OptimizationProblem_getLevelFunction_doc 108"Accessor to level function. 109 110Returns 111------- 112level : :class:`~openturns.Function` 113 Level function." 114 115%enddef 116 117%feature("docstring") OT::OptimizationProblemImplementation::getLevelFunction 118OT_OptimizationProblem_getLevelFunction_doc 119 120// --------------------------------------------------------------------- 121 122%define OT_OptimizationProblem_getLevelValue_doc 123"Accessor to level value. 124 125Returns 126------- 127value : float 128 Level value." 129 130%enddef 131 132%feature("docstring") OT::OptimizationProblemImplementation::getLevelValue 133OT_OptimizationProblem_getLevelValue_doc 134 135// --------------------------------------------------------------------- 136 137%define OT_OptimizationProblem_getObjective_doc 138"Accessor to objective function. 139 140Returns 141------- 142objective : :class:`~openturns.Function` 143 Objective function." 144 145%enddef 146 147%feature("docstring") OT::OptimizationProblemImplementation::getObjective 148OT_OptimizationProblem_getObjective_doc 149 150// --------------------------------------------------------------------- 151 152%define OT_OptimizationProblem_hasBounds_doc 153"Test whether bounds had been specified. 154 155Returns 156------- 157value : bool 158 *True* if bounds had been set for this problem, *False* otherwise." 159 160%enddef 161 162%feature("docstring") OT::OptimizationProblemImplementation::hasBounds 163OT_OptimizationProblem_hasBounds_doc 164 165// --------------------------------------------------------------------- 166 167%define OT_OptimizationProblem_hasEqualityConstraint_doc 168"Test whether equality constraints had been specified. 169 170Returns 171------- 172value : bool 173 *True* if equality constraints had been set for this problem, *False* otherwise." 174 175%enddef 176 177%feature("docstring") OT::OptimizationProblemImplementation::hasEqualityConstraint 178OT_OptimizationProblem_hasEqualityConstraint_doc 179 180// --------------------------------------------------------------------- 181 182%define OT_OptimizationProblem_hasInequalityConstraint_doc 183"Test whether inequality constraints had been specified. 184 185Returns 186------- 187value : bool 188 *True* if inequality constraints had been set for this problem, *False* otherwise." 189 190%enddef 191 192%feature("docstring") OT::OptimizationProblemImplementation::hasInequalityConstraint 193OT_OptimizationProblem_hasInequalityConstraint_doc 194 195// --------------------------------------------------------------------- 196 197%define OT_OptimizationProblem_hasLevelFunction_doc 198"Test whether level function had been specified. 199 200Returns 201------- 202value : bool 203 *True* if level function had been set for this problem, *False* otherwise." 204 205%enddef 206 207%feature("docstring") OT::OptimizationProblemImplementation::hasLevelFunction 208OT_OptimizationProblem_hasLevelFunction_doc 209 210// --------------------------------------------------------------------- 211 212%define OT_OptimizationProblem_hasMultipleObjective_doc 213"Test whether objective function is a scalar or vector function. 214 215Returns 216------- 217value : bool 218 *False* if objective function is scalar, *True* otherwise." 219 220%enddef 221 222%feature("docstring") OT::OptimizationProblemImplementation::hasMultipleObjective 223OT_OptimizationProblem_hasMultipleObjective_doc 224 225// --------------------------------------------------------------------- 226 227%define OT_OptimizationProblem_isMinimization_doc 228"Test whether this is a minimization or maximization problem. 229 230Returns 231------- 232value : bool 233 *True* if this is a minimization problem (default), *False* otherwise." 234 235%enddef 236 237%feature("docstring") OT::OptimizationProblemImplementation::isMinimization 238OT_OptimizationProblem_isMinimization_doc 239 240// --------------------------------------------------------------------- 241 242%define OT_OptimizationProblem_setBounds_doc 243"Accessor to bounds. 244 245Parameters 246---------- 247bounds : :class:`~openturns.Interval` 248 Problem bounds." 249 250%enddef 251 252%feature("docstring") OT::OptimizationProblemImplementation::setBounds 253OT_OptimizationProblem_setBounds_doc 254 255// --------------------------------------------------------------------- 256 257%define OT_OptimizationProblem_setEqualityConstraint_doc 258"Accessor to equality constraints. 259 260Parameters 261---------- 262equalityConstraint : :class:`~openturns.Function` 263 Equality constraints." 264 265%enddef 266 267%feature("docstring") OT::OptimizationProblemImplementation::setEqualityConstraint 268OT_OptimizationProblem_setEqualityConstraint_doc 269 270// --------------------------------------------------------------------- 271 272%define OT_OptimizationProblem_setInequalityConstraint_doc 273"Accessor to inequality constraints. 274 275Parameters 276---------- 277inequalityConstraint : :class:`~openturns.Function` 278 Inequality constraints." 279 280%enddef 281 282%feature("docstring") OT::OptimizationProblemImplementation::setInequalityConstraint 283OT_OptimizationProblem_setInequalityConstraint_doc 284 285// --------------------------------------------------------------------- 286 287%define OT_OptimizationProblem_setLevelFunction_doc 288"Accessor to level function. 289 290Parameters 291---------- 292levelFunction : :class:`~openturns.Function` 293 Level function." 294 295%enddef 296 297%feature("docstring") OT::OptimizationProblemImplementation::setLevelFunction 298OT_OptimizationProblem_setLevelFunction_doc 299 300// --------------------------------------------------------------------- 301 302%define OT_OptimizationProblem_setLevelValue_doc 303"Accessor to level value. 304 305Parameters 306---------- 307levelValue : float 308 Level value." 309 310%enddef 311 312%feature("docstring") OT::OptimizationProblemImplementation::setLevelValue 313OT_OptimizationProblem_setLevelValue_doc 314 315%define OT_OptimizationProblem_setMinimization_doc 316"Tell whether this is a minimization or maximization problem. 317 318Parameters 319---------- 320minimization : bool 321 *True* if this is a minimization problem, *False* otherwise." 322 323%enddef 324 325%feature("docstring") OT::OptimizationProblemImplementation::setMinimization 326OT_OptimizationProblem_setMinimization_doc 327 328// --------------------------------------------------------------------- 329 330%define OT_OptimizationProblem_setObjective_doc 331"Accessor to objective function. 332 333Parameters 334---------- 335objectiveFunction : :class:`~openturns.Function` 336 Objective function. 337 338Notes 339----- 340Constraints and bounds are cleared if the objective has a different input 341dimension in order to keep the problem valid at all time." 342%enddef 343 344%feature("docstring") OT::OptimizationProblemImplementation::setObjective 345OT_OptimizationProblem_setObjective_doc 346 347// --------------------------------------------------------------------- 348 349%define OT_OptimizationProblem_hasResidualFunction_doc 350"Test whether a least-square problem is defined. 351 352Returns 353------- 354value : bool 355 *True* if this is a least-squares problem, *False* otherwise." 356%enddef 357 358%feature("docstring") OT::OptimizationProblemImplementation::hasResidualFunction 359OT_OptimizationProblem_hasResidualFunction_doc 360 361// --------------------------------------------------------------------- 362 363%define OT_OptimizationProblem_getResidualFunction_doc 364"Accessor to the residual function. 365 366Returns 367------- 368residualFunction : :class:`~openturns.Function` 369 Residual function." 370%enddef 371 372%feature("docstring") OT::OptimizationProblemImplementation::getResidualFunction 373OT_OptimizationProblem_getLevelFunction_doc 374 375// --------------------------------------------------------------------- 376 377%define OT_OptimizationProblem_setResidualFunction_doc 378"Accessor to the residual function. 379 380Parameters 381---------- 382residualFunction : :class:`~openturns.Function` 383 Residual function." 384%enddef 385 386%feature("docstring") OT::OptimizationProblemImplementation::setResidualFunction 387OT_OptimizationProblem_setLevelFunction_doc 388 389// --------------------------------------------------------------------- 390 391%define OT_OptimizationProblem_setVariablesType_doc 392"Accessor to the variables type. 393 394Parameters 395---------- 396variablesType : :class:`~openturns.Indices` 397 Types of the variables. 398 399Notes 400----- 401Possible values for each variable are `ot.OptimizationProblemImplementation.CONTINUOUS`, `ot.OptimizationProblemImplementation.INTEGER` and `ot.OptimizationProblemImplementation.BINARY`." 402%enddef 403 404%feature("docstring") OT::OptimizationProblemImplementation::setVariablesType 405OT_OptimizationProblem_setVariablesType_doc 406 407// --------------------------------------------------------------------- 408 409%define OT_OptimizationProblem_getVariablesType_doc 410"Accessor to the variables type. 411 412Returns 413------- 414variablesType : :class:`~openturns.Indices` 415 Types of the variables. 416 417Notes 418----- 419Possible values for each variable are `ot.OptimizationProblemImplementation.CONTINUOUS`, `ot.OptimizationProblemImplementation.INTEGER` and ot.OptimizationProblemImplementation.`BINARY`." 420%enddef 421 422%feature("docstring") OT::OptimizationProblemImplementation::getVariablesType 423OT_OptimizationProblem_getVariablesType_doc 424 425// --------------------------------------------------------------------- 426 427%define OT_OptimizationProblem_isContinuous_doc 428"Check if the problem is continuous. 429 430Returns 431------- 432isContinuous : bool 433 Returns True if all variables are continuous." 434%enddef 435 436%feature("docstring") OT::OptimizationProblemImplementation::isContinuous 437OT_OptimizationProblem_isContinuous_doc 438 439 440 441 442 443 444