source: PSPA/madxPSPA/src/mad_const.h @ 447

Last change on this file since 447 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 1.7 KB
Line 
1#ifndef MAD_CONST_H
2#define MAD_CONST_H
3
4// types
5
6struct node;
7struct sequence;
8struct expression;
9struct command;
10
11struct constraint /* contains one constraint */
12{
13  char name[NAME_L];
14  int  type;                    /* 1 minimum */
15                                /* 2 maximum */
16                                /* 3 both 1 + 2 */
17                                /* 4 value */
18  int stamp;
19  double value, c_min, c_max, weight;
20  struct expression *ex_value, *ex_c_min, *ex_c_max;
21};
22
23struct constraint_list /* contains list of constraints */
24{
25  int stamp;
26  char name[NAME_L];
27  int  max,                           /* max. pointer array size */
28       curr;                          /* current occupation */
29  struct constraint** constraints;    /* command pointer list */
30};
31
32// interface
33
34struct constraint* delete_constraint(struct constraint*);   // used by mad_match.c
35void               dump_constraint(struct constraint*);     // used by mad_node.c
36
37struct constraint_list* new_constraint_list(int length);
38struct constraint_list* delete_constraint_list(struct constraint_list*);
39//void                  dump_constraint_list(struct constraint_list*);
40
41void fill_constraint_list(int type, struct command*, struct constraint_list*);
42void update_sequ_constraints(struct sequence*, struct constraint_list*);
43void update_node_constraints(struct node*, struct constraint_list*);
44
45int  constraint_name(char* name, int* name_l, int* index);
46int  next_constr_namepos(char* name);
47int  next_constraint(char* name, int* name_l, int* type, double* value, double* c_min, double* c_max, double* weight);
48int  next_global(char* name, int* name_l, int* type, double* value, double* c_min, double* c_max, double* weight);
49
50#endif // MAD_CONST_H
51
Note: See TracBrowser for help on using the repository browser.