|
GAUSS Engine Q. My Constrained Optimization, Constrained Maximum Likelihood, CurveFit, FANPAC, FANPACMT and Maximum Likelihood problems that require keyboard input run fine under GAUSS but hang when run using the GAUSS Engine? Why? A. The problem is that the GAUSS Engine does not automatically hook keyboard input to the calling program for the GAUSS function KEY. You need to provide a callback using GAUSS_HookProgramInputChar() or you can turn off the requests for keyboard input in your GAUSS program. To provide a callback, see the documentation for GAUSS_HookProgramInputChar() in the GAUSS Engine manual. You need to provide a callback function that always returns a zero. Turn off the requests for keyboard input by setting the global variables _co_Key to zero for Constrained Optimization, _cml_Key to zero for Constrained Maximum Likelihood, _cv_Key to zero for CurveFit, _ml_Key to zero for Maximum Likelihood. Keyboard input for sqpSolvemt in the Run-Time Library is disabled by setting c.disableKey to a nonzero value where "c" is an instance of an sqpSolvemt control structure. For example, struct sqpSolvemtControl c; c = sqpSolvemtControlCreate; c.disableKey = 1; The FANPAC applications module comes with NLP, an optimization program that uses keyboard input. This can be disabled by setting _nlp_key to zero in the nlp.dec file. From a FANPAC program it can be disabled by writing a proc with no input or output arguments that sets _nlp_key to zero, and then assigning the pointer to that proc to _fan_nlpGlobals. For example, proc(0)= globs; _nlp_key = 0; endp; _fan_nlpGlobals = &globs; FANPAC MT uses the optimizer sqpSolvemt in the Run-Time Library. To disable keyboard input from a FANPAC MT program, write a procedure that takes an sqpSolvemtControl instance as an input and output argument,and assign a pointer to that procedure to the sqpSolvemtControlProc member of an instance of a fanControl structure. In that procedure set c.disableKey to a nonzero value where "c" is an instance of the sqpSolvemtControl structure. For example, proc sqp(struct sqpSolvemtControl c); c.disableKey = 1; retp(c); endp; struct fanControl f; f = fanControlCreate; f.sqpSolvemtControlProc = &sqp; [Back]
Q. How do I call the GAUSS Engine from VB?
A. You need to write a wrapper (in C) linked to MTENG. You design the
calls in the wrapper so that they can be called from VB. And then you
declare these calls in VB.
|
© Copyright 2004-2009. Aptech Systems, Inc. Black Diamond, WA. All Rights Reserved Worldwide. |