obj_funct Class Reference

#include <obj_funct.h>

List of all members.

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_doubleDomain
 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

Detailed Description

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

Id
obj_funct.h,v 1.6 2003/12/05 20:31:07 leps Exp

Definition at line 23 of file obj_funct.h.


Constructor & Destructor Documentation

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.

Parameters:
oDim is number of optimized variables

Requirements : oDim must be non-negative.

created

Date
2003/12/05 20:31:07

,

Author
leps

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

Date
2003/12/05 20:31:07

,

Author
leps

Definition at line 45 of file obj_funct.cpp.

References Dim, Domain, optimum, and user_deallocate().


Member Function Documentation

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

Date
2003/12/23 16:09:11

,

Author
leps

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

Date
2003/12/05 17:14:53

,

Author
leps

Definition at line 12 of file obj_funct_gefel.cpp.

Referenced by value().

void user_allocate ( void   ) 

user's allocation

created

Date
2003/12/23 16:15:00

,

Author
leps

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

Date
2003/12/22 13:00:17

,

Author
leps

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

Date
2004/03/19 13:58:35

,

Author
leps

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

Date
2003/12/05 20:43:50

,

Author
leps

Definition at line 8 of file pokus.cpp.

Referenced by obj_funct().

void user_deallocate ( void   ) 

user's deallocation

created

Date
2003/12/23 16:15:00

,

Author
leps

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

Date
2003/12/22 13:00:17

,

Author
leps

In this function "obj_funct::user_deallocate ()" the user must specify deleting statements for variables allocated by him in obj_funct::user_allocate ().

created

Date
2004/03/19 13:58:35

,

Author
leps

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

Date
2003/12/05 20:43:50

,

Author
leps

Definition at line 25 of file pokus.cpp.

Referenced by ~obj_funct().

void user_evaluate ( double *  BSF  ) 

final evaluation

created

Date
2003/12/23 16:15:00

,

Author
leps

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

Date
2003/12/22 13:00:17

,

Author
leps

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.

Parameters:
oBSF is pointer to the best solution found

created

Date
2004/03/19 13:58:35

,

Author
leps

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

Date
2003/12/05 20:43:50

,

Author
leps

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

Date
2003/12/23 16:15:00

,

Author
leps

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

Date
2003/12/22 13:00:17

,

Author
leps

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.

Parameters:
oCH is pointer to actual set of optimized variables ( x[i] )

Requirements : oCH must be different from NULL.

Return values:
double precision number = objective value f( x[i] )

created

Date
2004/03/19 13:58:35

,

Author
leps

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

Date
2003/12/05 20:43:50

,

Author
leps

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.

Parameters:
oCH is pointer to actual set of optimized variables ( x[i] )

Requirements : oCH must be different from NULL.

Return values:
double precision number = objective value f( x[i] )

created

Date
2003/12/05 20:31:07

,

Author
leps

Definition at line 71 of file obj_funct.cpp.

References sifel_value(), and user_value().


Member Data Documentation

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

name of output file

Definition at line 40 of file obj_funct.h.

Referenced by obj_funct().

double precision

if optimum, this is distance to it

Definition at line 39 of file obj_funct.h.

Referenced by obj_funct().

solutions can be outside domain

Definition at line 42 of file obj_funct.h.

Referenced by obj_funct().


The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.2