- 积分
- 0
- 注册时间
- 2008-7-14
- 仿真币
-
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2008-12-17 19:47:17
|
显示全部楼层
来自 北京大兴
这是那个mdi_c.h
*
****PreView Module: %W% %G%
*/
#ifndef MDI_C_H
#define MDI_C_H 1
/*--------------------------------------------------------------------------*/
#if !(defined(__hpux) || defined(_AIX) || defined(vax) || defined(_WIN32) || defined(WIN32) || defined(_X86_))
# define vc_initialize_user vc_initialize_user_
#endif
#if defined(WIN32) || defined(_WIN32)
# define vc_initialize_user __declspec(dllexport) vc_initialize_user
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*----------------------------------------------------------------------------*/
/*-- NOTE: You cannot create a new function type merely by adding entries --*/
/*-- to this table. When this table is changed other changes must be --*/
/*-- incorporated into the expression subsystem. --*/
/*----------------------------------------------------------------------------*/
typedef enum {
/* Result Par 1 Par 2 Par 3 Par 4 Par 5 */
_fn_Rstart = 100,
fn_R_, /* REAL - - - - - */
fn_R_R, /* REAL REAL - - - - */
fn_R_RR, /* REAL REAL REAL - - - */
fn_R_RRR, /* REAL REAL REAL REAL - - */
fn_R_i, /* REAL int - - - - */
fn_R_s, /* REAL char * - - - - */
fn_R_k, /* REAL KEY - - - - */
fn_R_kk, /* REAL KEY KEY - - - */
fn_R_kkk, /* REAL KEY KEY KEY - - */
fn_R_a, /* REAL array - - - - */
fn_R_aa, /* REAL array array - - - */
fn_R_aR, /* REAL array REAL - - - */
fn_R_sR, /* REAL char * REAL - - - */
fn_R_ksRRRR, /* array KEY char * REAL REAL REAL REAL */
fn_R_ss, /* REAL char * char * - - - */
fn_R_aaR, /* REAL array array REAL - - */
fn_R_sss, /* REAL char * char * char * */
fn_R_ii, /* REAL int int - - - */
fn_R_kR, /* REAL KEY REAL */
fn_R_kkRR, /* REAL KEY KEY REAL REAL */
fn_R_ki, /* REAL KEY int - - - */
fn_R_sRR, /* REAL char * REAL REAL - - */
fn_R_kkis, /* REAL KEY KEY int char * - */
_fn_Rend = 199,
/* Result Par 1 Par 2 Par 3 Par 4 Par 5 */
_fn_sstart = 200,
fn_s_, /* char * - - - - - */
fn_s_s, /* char * char * - - - - */
fn_s_ss, /* char * char * char * - - - */
fn_s_sss, /* char * char * char * char * - - */
fn_s_i, /* char * int - - - - */
fn_s_si, /* char * char * int - - - */
fn_s_ssi, /* char * char * char * int - - */
fn_s_sii, /* char * char * int int - - */
fn_s_R, /* char * REAL - - - - */
fn_s_k, /* char * KEY - - - - */
fn_s_ks, /* char * KEY char * - - - */
fn_s_ssss, /* char * char * char * char * char * - */
fn_s_a, /* char * array - - - - */
fn_s_sa, /* char * char * array - - - */
fn_s_sR, /* char * char * REAL - - - */
_fn_send = 299,
/* Result Par 1 Par 2 Par 3 Par 4 Par 5 */
_fn_istart = 300,
fn_i_, /* int - - - - - */
fn_i_i, /* int int - - - - */
fn_i_ii, /* int int int - - - */
fn_i_iii, /* int int int int - - */
fn_i_R, /* int REAL - - - - */
fn_i_s, /* int char * - - - - */
fn_i_ss, /* int char * char * - - - */
fn_i_sss, /* int char * char * char * - - */
fn_i_ssss, /* int char * char * char * - - */
fn_i_k, /* int KEY - - - - */
fn_i_kk, /* int KEY KEY - - - */
fn_i_kkk, /* int KEY KEY KEY - - */
fn_i_ks, /* int KEY char * - - - */
fn_i_a, /* int array - - - - */
fn_i_aR, /* int array REAL - - - */
fn_i_si, /* int char * int - - - */
fn_i_ssi, /* int char * char * int - - */
fn_i_as, /* int array char * - - - */
fn_i_sssssi, /* int char * char * char * char * char * int */
fn_i_ksii, /* int KEY char * int int - */
fn_i_sR, /* int char * REAL - - - */
fn_i_ka, /* int key array */
fn_i_kssi, /* int key char * char * int */
fn_i_kss, /* int key char * char * */
fn_i_aaRRi, /* int array array REAL REAL int */
fn_i_Rii, /* int REAL int int */
fn_i_kssssi, /* int KEY char * char * char * char * int */
fn_i_ki, /* int key int */
fn_i_kR, /* int key REAL */
fn_i_kiiis, /* int KEY int int int char * */
fn_i_kRiis, /* int KEY REAL int int char * */
fn_i_kRiiis, /* int KEY REAL int int int char * */
fn_i_kki, /* int KEY KEY int - - */
fn_i_kkii, /* int KEY KEY int int - */
fn_i_kii, /* int KEY int int - - */
_fn_iend = 399,
/* Result Par 1 Par 2 Par 3 Par 4 Par 5 */
_fn_kstart = 400,
fn_k_, /* KEY - - - - - */
fn_k_k, /* KEY KEY - - - - */
fn_k_kk, /* KEY KEY KEY - - - */
fn_k_kkk, /* KEY KEY KEY KEY - - */
fn_k_ks, /* KEY KEY char * - - - */
fn_k_kss, /* KEY KEY char * char * - - */
fn_k_s, /* KEY char * - - - - */
fn_k_i, /* KEY KEY - - - - */
fn_k_ki, /* KEY KEY int - - - */
_fn_kend = 499,
/* Result Par 1 Par 2 Par 3 Par 4 Par 5 */
_fn_astart = 500,
fn_a_, /* array - - - - - */
fn_a_a, /* array array - - - - */
fn_a_aa, /* array array array - - - */
fn_a_aaa, /* array array array array - - */
fn_a_aaaa, /* array array array array array - */
fn_a_aai, /* array array array int - - */
fn_a_aak, /* array array array KEY - - */
fn_a_aaR, /* array array array REAL - - */
fn_a_aas, /* array array array char * - - */
fn_a_ak, /* array array KEY - - - */
fn_a_akk, /* array array KEY KEY - - */
fn_a_aks, /* array array KEY char * - - */
fn_a_akss, /* array array KEY char * char * - */
fn_a_i, /* array int - - - - */
fn_a_ai, /* array array int - - - */
fn_a_aR, /* array array REAL - - - */
fn_a_as, /* array array char * - - - */
fn_a_asi, /* array array char * int - - */
fn_a_k, /* array KEY - - - - */
fn_a_kk, /* array KEY KEY - - - */
fn_a_kkk, /* array KEY KEY KEY - - */
fn_a_kkkk, /* array KEY KEY KEY KEY - */
fn_a_ks, /* array KEY char * - - - */
fn_a_kss, /* array KEY char * char * - - */
fn_a_kRs, /* array KEY REAL char * - - */
fn_a_kks, /* array KEY KEY char * - - */
fn_a_kkks, /* array KEY KEY KEY char * - */
fn_a_RRR, /* array REAL REAL REAL - - */
fn_a_RRi, /* array REAL REAL int - - */
fn_a_kkR, /* array KEY KEY REAL - - */
fn_a_s, /* array char * - - - - */
fn_a_ss, /* array char * char * - - - */
fn_a_aRRRR, /* array array REAL REAL REAL REAL */
fn_a_aii, /* array array int int - - */
fn_a_iikkkkRRR,/* array int int KEY KEY KEY KEY REAL REAL REAL */
fn_a_iikRRR, /* array int int KEY REAL REAL REAL - */
fn_a_ikRRR, /* array int KEY REAL REAL REAL - */
fn_a_iaai, /* array int array array int - - */
fn_a_iaaRRR, /* array int array array REAL REAL REAL */
fn_a_kkkii, /* array KEY KEY KEY int int */
fn_a_kiiiisi,/* array KEY int int int int string int*/
fn_a_aaaai, /* array array array array array int */
fn_a_ki, /* array array int */
fn_a_aasi, /* array array array string int */
fn_a_aiRai, /* array array int REAL array int */
fn_a_iR, /* array int REAL */
fn_a_iasi, /* array int array string int */
fn_a_aaRRi, /* array array array REAL REAL int */
fn_a_aasiaii,/* array array array string int array int int */
fn_a_sss, /* array char * char * char * - - */
fn_a_kR, /* array KEY REAL */
fn_a_kiR, /* array KEY int REAL */
fn_a_kki, /* array KEY KEY int */
fn_a_kkki, /* array KEY KEY KEY int */
fn_a_kkRi, /* array KEY KEY REAL int */
fn_a_aaai, /* array array array array int */
fn_a_kRi, /* array KEY REAL int - - */
fn_a_kkii, /* array KEY KEY int int */
fn_a_kkkRi, /* array KEY KEY KEY REAL int */
fn_a_aaaaa, /* array array array array array array */
fn_a_aaas, /* array array array array char * */
fn_a_aaaaas, /* array array array array array array char * */
fn_a_aaki, /* array array array KEY int */
_fn_aend = 599
} ArgType;
typedef void (*FUNCTION)();
void vc_function_add(
char *, /* User name of function */
FUNCTION, /* Function pointer */
ArgType , /* Argument type */
int , /* Argument count */
int /* Units type encoding */
);
void vc_function_remove(
char * /* User name of function */
);
#define vc_MAX_RANK 7 /* Only 2 are usable in this release. */
typedef int vc_DIMS[vc_MAX_RANK]; /* Used to describe the dimensions of the array */
typedef int vc_BNDS[vc_MAX_RANK][2]; /* Used for extracting subsets of the matrix, */
/* or for computing an index into the values */
/* vector given a set of indexes. */
typedef enum {
EXPR_T_NONE,
EXPR_T_REAL,
EXPR_T_INT,
EXPR_T_STRING,
EXPR_T_KEY,
EXPR_T_ENUM,
EXPR_T_ARRAY,
EXPR_T_LOCORI
} EXPR_TYPE;
typedef void *vc_ARRAY;
typedef union {
int i; /* Use for both ints and keys */
double d;
char *s;
} s_vc_EL;
typedef s_vc_EL *vc_EL;
/*----------------------------------------------------------------------------*/
/*-- Definitions --*/
/*-- N - total number of elements in the tensor, irrespective of its --*/
/*-- dimension (for a 5x1, N = 5; for a 3x3x3, N = 27). --*/
/*-- --*/
/*-- Parameters --*/
/*-- Index - integer from 0 through N-1, selects the Nth element of --*/
/*-- the vc_ARRAY. --*/
/*-- --*/
/*-- Count - An integer indicating the number of elements in the --*/
/*-- preceding array or submatrix parameter. --*/
/*-- --*/
/*-- Dims - An integer array of the same rank as the tensor object --*/
/*-- contained in the vc_ARRAY. Each entry indicates the --*/
/*-- dimension in a particular direction. Values of [3,5] --*/
/*-- would indicate that this vc_ARRAY is a 3x5 matrix with --*/
/*-- 15 elements total. --*/
/*-- --*/
/*-- Rank - An integer value from 1 through vc_MAX_RANK indicating --*/
/*-- the rank of the tensor object encapsulated by this --*/
/*-- vc_ARRAY. --*/
/*-- --*/
/*-- ColumnVector - An integer representing a boolean value as to --*/
/*-- whether this tensor is a column vector or a row vector. --*/
/*-- This only applies to objects of rank one. --*/
/*-- --*/
/*-- Values- A pointer to one or more vc_EL objects. To declare a --*/
/*-- local array of vc_EL objects, use the s_vc_EL type as --*/
/*-- in --*/
/*-- #define nValues 10 --*/
/*-- s_vc_EL Values[nValues]; --*/
/*-- ... --*/
/*-- Values.d = i / 2.4; --*/
/*-- ... --*/
/*-- vc_array_set_values(A, Values, 0, nValues); --*/
/*-- --*/
/*-- Bounds- A two-dimensional array of integers used to indicate the --*/
/*-- lower and sometimes upper array bounds to be used when --*/
/*-- accessing a vc_ARRAY. --*/
/*-- --*/
/*----------------------------------------------------------------------------*/
vc_ARRAY* vc_array_create (vc_DIMS Dims, int Rank, int ColumnVector);
void vc_array_set_values (vc_ARRAY A, vc_EL Values, int Index, int Count);
void vc_array_get_values (vc_ARRAY A, vc_EL Values, int Index, int Count);
double* vc_array_values (vc_ARRAY A);
void vc_array_set_dims (vc_ARRAY A, vc_DIMS Dims, int Rank, int ColumnVector);
void vc_array_get_dims (vc_ARRAY A, vc_DIMS Dims, int *Rank, int *ColumnVector);
int vc_array_compute_index (vc_ARRAY A, vc_BNDS Bounds, int nBounds);
/* Put index values into the first location of each Bounds value. */
void vc_array_form_submatrix (vc_ARRAY A, vc_BNDS Bounds, int nIndex);
int vc_array_element_count (vc_ARRAY A);
int vc_array_same_shape (vc_ARRAY A1, vc_ARRAY A2);
vc_EL vc_array_elements (vc_ARRAY A);
void vc_array_set_element_type (vc_ARRAY A, EXPR_TYPE ElementType);
EXPR_TYPE vc_array_element_type (vc_ARRAY A);
void vc_array_coerce_element_type (vc_ARRAY A, EXPR_TYPE ElementType);
void vc_array_set_string_element (vc_ARRAY A, char *Value, int Index);
int vc_array_source_object (vc_ARRAY A);
void vc_error (char *Msg, ...);
/*--------------------------------------------------------------------------*/
typedef void (*DOE_FN)(int nVars, int nCases, int **TrialMatrix, int *nTrials);
void vc_doe_add (DOE_FN TheFn, int Which); /* Which should be 1, 2 or 3 */
/*--------------------------------------------------------------------------*/
/* DO NOT MODIFY ANY STRUCTURE FIELD BEGINNING WITH "p_" */
struct s_oi {
void (*p_AppEval)(struct s_oi *opt_info);
void *p_AppData;
int p_Analysis;
int p_SaveDiffs;
int p_AnalysisCalls;
int p_Model;
int *p_DesignVar;
double *DesignVal; /* MUST be modified by optimization algorithm */
int p_nVars;
double *p_LowerBound;
double *p_UpperBound;
int *p_Objective;
double *p_ObjectiveVal; /* Design function values */
int p_nObjs;
int *p_ObjUnits;
int *p_Constraint;
double *p_ConstraintVal; /* Design function values */
int p_nCons;
int *p_ConUnits;
/* You may modify any of this data at your whim */
int Characteristic; /* minimize = 0; maximize = 1 */
int MaximumIterations;
double ConvergenceTolerance;
int DifferencingTechnique;/* forward = 0 or centered = 1 */
double ScaledPerturbation; /* Perturbation value for differencing */
int p_Algorithm; /* user1 = 1; user2 = 2; user3 = 3 */
double *p_UserParameters;
int p_nUserPars;
int p_oResset;
int p_nRes;
int p_Aborted;
int Init; /* Set to FALSE (0) when your initialization is complete */
int NewIteration; /* MUST be set to TRUE (1) when a new iteration is beginning before calling vc_opt_solver_submit*/
int Iteration; /* Updated by vc_opt_solver_submit when a NewIteration is detected */
int ReturnCode; /* Not used by ADAMS/View, may be used to convey termination status from optimizer */
int IterationsBeforeRescale; /* Values direct from parameter */
int SlpConvergenceIterations;
int AbortOnError; /* Set from ON_OBJECTIVE_ERROR parameter */
};
typedef struct s_oi OPT_INFO;
typedef void (*OPT_FN)(OPT_INFO *opt_info);
void vc_opt_add (OPT_FN TheFn, int Which); /* Which should be 1, 2 or 3 */
void vc_opt_solver_submit (OPT_INFO *opt_info);
# ifdef __cplusplus
}
# endif
/*--------------------------------------------------------------------------*/
#endif |
|