#include <obj_funct.h>
Public Member Functions | |
obj_funct (long oDim) | |
constructor | |
void | sifel_value (double *oCH) |
SIFEL preparation. | |
void | user_allocate (void) |
user's allocation | |
void | user_deallocate (void) |
user's deallocation | |
void | user_evaluate (double *oBSF) |
final evaluation | |
double | user_value (double *oCH) |
user's objective value | |
double | value (double *oCH) |
general objective value | |
~obj_funct (void) | |
destructor | |
Public Attributes | |
long | Dim |
number of optimization variables | |
p_double * | Domain |
definition of searched domain | |
char | name [256] |
name of function | |
double * | optimum |
if known, here is optimum | |
char * | outfile |
name of output file | |
double | precision |
if optimum, this is distance to it | |
long | Return_to_domain |
solutions can be outside domain |
class obj_funct
File: obj_funct.h
Description: General definition for all objective functions that can appear in SIFEL project.
Author: Anna Kucerova, anicka@cml.fsv.cvut.cz Matej Leps, leps@cml.fsv.cvut.cz
Definition at line 23 of file obj_funct.h.
obj_funct | ( | long | oDim | ) |
constructor
The constructor obj_funct ( long oDim ) allocates memmory for objective function. Each optimization variable is limited by three values in Domain: [min,max,precision]. Therefore the whole domain is defined by Domain[Dim][3]. User can also specify and allocate optimum, if it is known. If Return_to_domain is set to zero, the algorithm will have chance to find optimum even outside given boundaries. At the end, this function calls obj_funct::user_allocate (), placed in user_obj_funct.cpp, where the user can specify his own allocation statements.
oDim | is number of optimized variables |
Requirements : oDim must be non-negative.
created
,
Definition at line 23 of file obj_funct.cpp.
References Dim, Domain, optimum, outfile, precision, Return_to_domain, and user_allocate().
~obj_funct | ( | void | ) |
destructor
The destructor ~obj_funct () deallocates all basic dynamic variables. It also calls obj_funct::user_deallocate (), placed in user_obj_funct.cpp, where user must specify deleting statements for variables allocated by him in obj_funct::user_allocate ().
created
,
Definition at line 45 of file obj_funct.cpp.
References Dim, Domain, optimum, and user_deallocate().
void sifel_value | ( | double * | oCH | ) |
SIFEL preparation.
The "sifel_value ( double * )" function prepares data for sifel-based optimization. Therefore all statements appropriate to the problem (MEFEL,TRFEL,...) are placed here. If the user want to use optimization without FEM computation, he must comment (delete) all lines in this function.
created
,
The "sifel_value ( double * )" function prepares data for sifel-based optimization. Therefore all statements appropriate to the problem (MEFEL,TRFEL,...) are placed here. If the user want to use optimization without FEM computation, he must comment all lines in this function.
Requirements : Global stochdriver St form "global.h" must be allocated.
created
,
Definition at line 12 of file obj_funct_gefel.cpp.
Referenced by value().
void user_allocate | ( | void | ) |
user's allocation
created
,
This function is here only for linking purposes. Please don't use this file to put here your objective function. See SIFEL/PRG/GEFEL/OPTIM/INSTALL file for instructions, how to create your own optimization problem.
created
,
The function "user_allocate( void )" is here for user. Here can be allocated memory or defined some variables for user-defined objective function, like opening of needed files, definition of known optimum etc. Please, delete all allocated memory in user_deallocate() function.
created
,
This function is here only for linking purposes. Please don't use this file to put here your objective function. See SIFEL/PRG/GEFEL/OPTIM/INSTALL file for instructions, how to create your own optimization problem.
created
,
Definition at line 8 of file pokus.cpp.
Referenced by obj_funct().
void user_deallocate | ( | void | ) |
user's deallocation
created
,
This function is here only for linking purposes. Please don't use this file to put here your objective function. See SIFEL/PRG/GEFEL/OPTIM/INSTALL file for instructions, how to create your own optimization problem.
created
,
In this function "obj_funct::user_deallocate ()" the user must specify deleting statements for variables allocated by him in obj_funct::user_allocate ().
created
,
This function is here only for linking purposes. Please don't use this file to put here your objective function. See SIFEL/PRG/GEFEL/OPTIM/INSTALL file for instructions, how to create your own optimization problem.
created
,
Definition at line 25 of file pokus.cpp.
Referenced by ~obj_funct().
void user_evaluate | ( | double * | BSF | ) |
final evaluation
created
,
This function is here only for linking purposes. Please don't use this file to put here your objective function. See SIFEL/PRG/GEFEL/OPTIM/INSTALL file for instructions, how to create your own optimization problem.
created
,
The "user_evaluate ( double *BSF )" function is called at the end of optimization process. It is called from Optimization algorithm and in BSF user can find best-so-far solution found during optimization. The usual use of this function is to get e.g. the stress-strain diagram of the optimal structure etc.
oBSF | is pointer to the best solution found |
created
,
This function is here only for linking purposes. Please don't use this file to put here your objective function. See SIFEL/PRG/GEFEL/OPTIM/INSTALL file for instructions, how to create your own optimization problem.
created
,
Definition at line 32 of file pokus.cpp.
References user_value().
double user_value | ( | double * | oCH | ) |
user's objective value
Example of objective function, returns sqruare root.
created
,
This function is here only for linking purposes. Please don't use this file to put here your objective function. See SIFEL/PRG/GEFEL/OPTIM/INSTALL file for instructions, how to create your own optimization problem.
created
,
The "user_value ( double *oCH )" function returns value of objective function. Here the user can specify his own objective function, which must be returned be "return()" statement.
oCH | is pointer to actual set of optimized variables ( x[i] ) |
Requirements : oCH must be different from NULL.
double | precision number = objective value f( x[i] ) |
created
,
This function is here only for linking purposes. Please don't use this file to put here your objective function. See SIFEL/PRG/GEFEL/OPTIM/INSTALL file for instructions, how to create your own optimization problem.
created
,
Definition at line 17 of file pokus.cpp.
Referenced by user_evaluate(), and value().
double value | ( | double * | oCH | ) |
general objective value
The "value ( double *oCH )" function returns value of objective function. Calls sifel_value(), where some preparations for appropriate problem (MEFEL,TRFEL,...) are placed and secondly, calls user_value(), which is placed in user_obj_funct.cpp, and where user can specify his own objective function.
oCH | is pointer to actual set of optimized variables ( x[i] ) |
Requirements : oCH must be different from NULL.
double | precision number = objective value f( x[i] ) |
created
,
Definition at line 71 of file obj_funct.cpp.
References sifel_value(), and user_value().
long Dim |
number of optimization variables
Definition at line 36 of file obj_funct.h.
Referenced by obj_funct(), and ~obj_funct().
definition of searched domain
Definition at line 37 of file obj_funct.h.
Referenced by obj_funct(), and ~obj_funct().
char name[256] |
name of function
Definition at line 41 of file obj_funct.h.
double* optimum |
if known, here is optimum
Definition at line 38 of file obj_funct.h.
Referenced by obj_funct(), and ~obj_funct().
char* outfile |
double precision |
if optimum, this is distance to it
Definition at line 39 of file obj_funct.h.
Referenced by obj_funct().
long Return_to_domain |
solutions can be outside domain
Definition at line 42 of file obj_funct.h.
Referenced by obj_funct().