Parent Directory | Revision Log

Revision **67** -
(**show annotations**)
(**download**)
(**as text**)

*Wed Nov 30 16:31:29 2005 UTC*
(16 years, 5 months ago)
by *johnpye*

File MIME type: text/x-chdr

File size: 8756 byte(s)

File MIME type: text/x-chdr

File size: 8756 byte(s)

Standardised the "if seen" #defines to [ASC|ASCTK|ASCPY|ASCXX]_FILENAME_H Fixed compile on FC3

1 | /* |

2 | * SlvProc.h |

3 | * by Ken Tyner and Ben Allan |

4 | * Created: 6/97 |

5 | * Version: $Revision: 1.4 $ |

6 | * Version control file: $RCSfile: SlvProc.h,v $ |

7 | * Date last modified: $Date: 2003/08/23 18:43:08 $ |

8 | * Last modified by: $Author: ballan $ |

9 | * |

10 | * This file is part of the ASCEND Tcl/Tk interface |

11 | * |

12 | * Copyright 1997, Carnegie Mellon University |

13 | * |

14 | * The ASCEND Tcl/Tk interface is free software; you can redistribute |

15 | * it and/or modify it under the terms of the GNU General Public License as |

16 | * published by the Free Software Foundation; either version 2 of the |

17 | * License, or (at your option) any later version. |

18 | * |

19 | * The ASCEND Tcl/Tk interface is distributed in hope that it will be |

20 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |

21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |

22 | * General Public License for more details. |

23 | * |

24 | * You should have received a copy of the GNU General Public License |

25 | * along with the program; if not, write to the Free Software Foundation, |

26 | * Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the file named |

27 | * COPYING. COPYING is found in ../compiler. |

28 | * |

29 | * This probe implementation constitutes a total rework of the probe |

30 | * first created by Abbott, 1994. |

31 | */ |

32 | |

33 | /** @file |

34 | * Solver analysis and monitoring procedures. |

35 | * <pre> |

36 | * To include this header, you must include the following: |

37 | * #include "tcl.h" |

38 | * #include "utilities/ascConfig.h" |

39 | * #include "interface/HelpProc.h" |

40 | * #include "interface/SlvProc.h" (which is sort of obvious) |

41 | * </pre> |

42 | */ |

43 | |

44 | #ifndef ASCTK_SLVPROC_H |

45 | #define ASCTK_SLVPROC_H |

46 | |

47 | #define SLVMONITORPREFIX "slvmon" |

48 | |

49 | extern int Asc_VarAnalyzeCmd(ClientData cdata, Tcl_Interp *interp, |

50 | int argc, CONST84 char *argv[]); |

51 | /**< |

52 | * <!-- int Asc_VarAnalyzeCmd; --> |

53 | * This function will analyze the elements in the current slv_system to see |

54 | * whether they satisfy the proximity queries. The variable type supported is |

55 | * the "solver_var". It can be used to analyse variables or relations for |

56 | * proximity to a "othervalue". rel?abs will determine whether |

57 | * the queries are done relatively or using absolute values. tolerance must |

58 | * be set appropriately based on rel?abs. The queries ?scaling?lower?upper |

59 | * pertain to the nominal,lower_bound, and upper_bound of a solver_var with |

60 | * respect to the value of the solver_var. "residual" pertains to the residual |

61 | * of a relation as compared to 0.0. If for any of the queries, |

62 | * the values are too close to zero, then "absolute" queries are made. |

63 | * Internal units are used for all queries.<br><br> |

64 | * |

65 | * Examples: |

66 | * -# __var_analyze 20 46 lower rel 0.2; |

67 | * will analyse (indexes 20 through 46 inclusive) all solver_vars |

68 | * that have values which are within 20% of their lower_bounds. |

69 | * -# __var_analyze 20 46 lower abs 0.2; |

70 | * will analyse (indexes 20 through 46 inclusive) all solver_vars |

71 | * that have values which are within 0.2 of their lower_bounds. |

72 | * -# __var_analyze 20 46 other rel 0.2 15.0; |

73 | * will analyse (indexes 20 through 46 inclusive) all solver_vars |

74 | * that have values which are within 20% of 15.0. |

75 | * |

76 | * Will be return a formatted string with of the form: |

77 | * {index b_close} {index b_far} where index is the original probe list index. |

78 | * See the source for more details.<br><br> |

79 | * |

80 | * Registered as \"__var_analyze low high scaling?lower?upper?other rel?abs tolerance <othervalue>. |

81 | */ |

82 | extern int Asc_RelAnalyzeCmd(ClientData cdata, Tcl_Interp *interp, |

83 | int argc, CONST84 char *argv[]); |

84 | /**< |

85 | * <!-- int Asc_RelAnalyzeCmd; --> |

86 | * See Asc_VarAnalyzeCmd(). |

87 | * |

88 | * Registered as \"__rel_analyze low high residual?other rel?abs tolerance <othervalue>. |

89 | */ |

90 | |

91 | STDHLF_H(Asc_SolveMonitorCmd); |

92 | |

93 | extern int Asc_SolveMonitorCmd(ClientData, Tcl_Interp *, int, CONST84 char **); |

94 | /**< status = Asc_SolveMonitorCmd((cdata,interp,argc,argv); */ |

95 | /** Registered as */ |

96 | #define Asc_SolveMonitorCmdHN "slv_monitor" |

97 | /* which should eventually be __something, when we clean up the slv_ mess */ |

98 | /** Usage: */ |

99 | #define Asc_SolveMonitorCmdHU \ |

100 | "slv_monitor takes no arguments yet" |

101 | /** Short help text */ |

102 | #define Asc_SolveMonitorCmdHS \ |

103 | "Returns the name of a monitor command to watch var/rel changes" |

104 | /** Long help text part 1 */ |

105 | #define Asc_SolveMonitorCmdHL1 "Eventually this should take an argument " |

106 | /** Long help text part 2 */ |

107 | #define Asc_SolveMonitorCmdHL2 "that is the id of a tcl solver token.\n" |

108 | /** Long help text part 3 */ |

109 | #define Asc_SolveMonitorCmdHL3 "\ |

110 | * This creates a monitor and returns its symbolic handle.\n\ |

111 | * Multiple monitors can exist and are manipulated by their\n\ |

112 | * symbolic handles.\n\ |

113 | * A monitor may be used on a series of unrelated slv_system_t.\n\ |

114 | * Currently, this function gets its slv_system_t from g_solvsys_cur,\n\ |

115 | * but it should be changed to take a slvsys interface id when\n\ |

116 | * the solver interface is changed to work by name.\n\ |

117 | " |

118 | /* |

119 | * because they need to be defined in a visible place, the info strings |

120 | * for the monitors created follow: |

121 | */ |

122 | /** Short help text */ |

123 | #define SolveMonitorHS \ |

124 | "Returns the list of changes in residuals, variables, or steps in variables" |

125 | /** Usage */ |

126 | #define SolveMonitorHU \ |

127 | "slvmonN destroy OR slvmonN slvsysname change <var,rel> OR\n\ |

128 | slvmonN slvsysname geometry w h x y rmin rmax vmax OR \n\ |

129 | slvmonN slvsysname plotdata <value,speed,residual>\n\ |

130 | " |

131 | /** Long help text part 1 */ |

132 | #define SolveMonitorHL1 \ |

133 | "\ |

134 | * s change var return scaled values that changed\n\ |

135 | * s change rel return scaled residuals that changed\n\ |

136 | * Returns a tcl list whose elements are the changed values\n\ |

137 | * with master list indices {index value}\n\ |

138 | * values are scaled by nominals, or 1 if nominal is 0.\n\ |

139 | * Scaled values > vmax (or rmax) will be returned as having the\n\ |

140 | * value of the max, rather than their TRUE value.\n\ |

141 | " |

142 | /** Long help text part 2 */ |

143 | #define SolveMonitorHL2 \ |

144 | "\n\ |

145 | * s geometry w h x y rmin rmax vmax\n\ |

146 | * sets conversion parameters for plotdata (w h x y)\n\ |

147 | * and limits for data values. This is called with a window\n\ |

148 | * size or range change that will require new drawing.\n\ |

149 | * x,y is the upper left corner of a coordinate space like a tk canvas.\n\ |

150 | * w,h is the width and height of the space in distinctly plottable points\n\ |

151 | * The 0 line of the area is y + h/2 for values. The values will be\n\ |

152 | * spread evenly over the width in order of increasing solver master index.\n\ |

153 | " |

154 | /** Long help text part 3 */ |

155 | #define SolveMonitorHL3 \ |

156 | "\n\ |

157 | * s plotdata value return plot info for scaled values that changed\n\ |

158 | * s plotdata speed return plot info for scaled rates of value change\n\ |

159 | * s plotdata residual return plot info for scaled residuals that changed\n\ |

160 | *\n\ |

161 | " |

162 | /** Long help text part 4 */ |

163 | #define SolveMonitorHL4 \ |

164 | "\ |

165 | * Each option returns a list of {x y index} for changed values of the\n\ |

166 | * variables or relations. The x,y are coordinates at which a point\n\ |

167 | * should be plotted based on a transformation derived from whxy info\n\ |

168 | * last obtained by the geometry command of the monitor.\n\ |

169 | " |

170 | /** Long help text part 5 */ |

171 | #define SolveMonitorHL5 \ |

172 | "\ |

173 | * The transformation may specify the same coordinate for more than\n\ |

174 | * one relation or variable.\n\ |

175 | * If this function raises a floating point exception, it will\n\ |

176 | * not return data, but an error.\n\ |

177 | " |

178 | /** Long help text part 6 */ |

179 | #define SolveMonitorHL6 \ |

180 | "\ |

181 | * value: The variable values v are scaled by nominal.\n\ |

182 | * They are then reduced to vmax if abs(v) > vmax.\n\ |

183 | * They are then scaled to the plotting region. The\n\ |

184 | * returned value is {plotx ploty mastervarindex} for\n\ |

185 | * all variables that changed since the last call or geometry.\n\ |

186 | " |

187 | /** Long help text part 7 */ |

188 | #define SolveMonitorHL7 \ |

189 | "\ |

190 | * speed: The variable values v are scaled by nominal.\n\ |

191 | * They are then reduced to vmax if abs(v) > vmax.\n\ |

192 | * The delta in the scaled value since the last call\n\ |

193 | * is calculated. If the delta has changed, it is scaled\n\ |

194 | * to the plotting region and returned as\n\ |

195 | * {plotx ploty mastervarindex} for\n\ |

196 | * all variables that had a step size change.\n\ |

197 | " |

198 | /** Long help text part 8 */ |

199 | #define SolveMonitorHL8 \ |

200 | "\ |

201 | * residual: The relation residuals, as scaled by nominals and reduced\n\ |

202 | * to rmax if necessary, which have changed since the last call\n\ |

203 | * are transformed to a dual log scale in the plot region.\n\ |

204 | * Residuals < rmin considered as rmin. Residuals < 0 plotted\n\ |

205 | * in the lower half of the plot region. Distance from the\n\ |

206 | * vertical center of the canvas indicates the residual magnitude" |

207 | /* end o spew */ |

208 | |

209 | #endif /* ASCTK_SLVPROC_H */ |

210 |

john.pye@anu.edu.au | ViewVC Help |

Powered by ViewVC 1.1.22 |