本文整理汇总了C++中EX函数的典型用法代码示例。如果您正苦于以下问题:C++ EX函数的具体用法?C++ EX怎么用?C++ EX使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EX函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatePMLEFieldUtilEx
void updatePMLEFieldUtilEx(int xStart, int xEnd, int yStart, int yEnd, int zStart, int zEnd, int xBound, int yBound, int zBound, pmlConstStruct cx[], pmlConstStruct cy[], pmlConstStruct cz[], int n){
int i, j, k; // These are the indexes
int x,y,z;// There are indexes for the pmlConstStruct indexs
long p;
int m;
double dxStore;
double eps;
for (i=xStart;i<xEnd+1;i++){
x = abs(xBound - i)%PML_LAYERS;
for (j=yStart;j<yEnd+1;j++){
y = abs(yBound - j)%PML_LAYERS;
for (k=zStart;k<zEnd+1;k++){
z = abs(zBound - k)%PML_LAYERS;
p = PMLINDEX(i,j,k);
dxStore = DX(p);
m = MATERIALINDEX(i,j,k);
eps = EPSR(m)*EPSNOT;
DX(p) = cy[y].c1*DX(p) + cy[y].c2*(HZ(i,j,k) - HZ(i,j-1,k) - HY(i,j,k) + HY(i,j,k-1) - JSX(m));
EX(i,j,k) = cz[z].c3*EX(i,j,k) + cz[z].c4*(cx[x].c5*DX(p)-cx[x].c6*dxStore)/eps;
}}} // end for
}// end updatePMLEFieldUtilEx
示例2: ZEND_NAMED_FUNCTION
static ZEND_NAMED_FUNCTION(zend_closure_internal_handler) /* {{{ */
{
zend_closure *closure = (zend_closure*)ZEND_CLOSURE_OBJECT(EX(func));
closure->orig_internal_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU);
OBJ_RELEASE((zend_object*)closure);
EX(func) = NULL;
}
示例3: updatePMLHFieldUtilHz
void updatePMLHFieldUtilHz(int xStart, int xEnd, int yStart, int yEnd, int zStart, int zEnd, int xBound, int yBound, int zBound, pmlConstStruct cx[], pmlConstStruct cy[], pmlConstStruct cz[], int n){
int i, j, k; // These are the indexes
int x,y,z;// There are indexes for the pmlConstStruct indexs
long p;
int m;
double bzStore;
double mu;
// Either this, or make cOnes a bigger array with number of elements which are the max of xLen, yLen, zLen
for (i=xStart;i<xEnd+1;i++){
x = abs(xBound - i)%PML_LAYERS;
for (j=yStart;j<yEnd+1;j++){
y = abs(yBound - j)%PML_LAYERS;
for (k=zStart;k<zEnd+1;k++){
z = abs(zBound - k)%PML_LAYERS;
p = PMLINDEX(i,j,k);
bzStore = BZ(p);
mu = MUR(m)*MUNOT;
BZ(p) = cx[x].c1*BZ(p) + cx[x].c2*(EX(i,j+1,k) - EX(i,j,k) + EY(i,j,k) - EY(i+1,j,k) - MSZ(m));
HZ(i,j,k) = cy[y].c3*HZ(i,j,k) + cy[y].c4*(cz[z].c5*BZ(p)-cz[z].c6*bzStore)/mu;
}}} // end for
}// end updatePMLHFieldUtilHz
示例4: zend_closure_internal_handler
static void zend_closure_internal_handler(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
{
zend_closure *closure = (zend_closure*)EX(func)->common.prototype;
closure->orig_internal_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU);
OBJ_RELEASE((zend_object*)closure);
EX(func) = NULL;
}
示例5: php_memoize_return
/* {{{ */
static int php_memoize_return(zend_execute_data *execute_data) {
zend_long ttl = 0;
const zend_function *fbc = EX(func);
if (MG(ini.enabled) && php_memoize_is_memoizing(fbc, &ttl)) {
zend_string *key = php_memoize_key(
&EX(This),
fbc, EX_NUM_ARGS(), EX_VAR_NUM(0));
if (key) {
zval *return_value;
if (EX(opline)->op1_type & IS_CONST) {
return_value = EX_CONSTANT(EX(opline)->op1);
} else {
return_value = EX_VAR(EX(opline)->op1.var);
}
apc_cache_store(php_memoize_cache, key, return_value, ttl, 1);
if (EG(exception)) {
zend_clear_exception();
}
zend_string_release(key);
}
}
if (zend_return_function) {
return zend_return_function(execute_data);
}
return ZEND_USER_OPCODE_DISPATCH;
} /* }}} */
示例6: php_memoize_is_memoized
/* {{{ */
static inline zend_bool php_memoize_is_memoized(const zend_execute_data *execute_data) {
const zend_execute_data *call = EX(call);
const zend_function *fbc = call->func;
if (call && php_memoize_is_memoizing(fbc, NULL)) {
zend_string *key = php_memoize_key(
&call->This,
fbc,
ZEND_CALL_NUM_ARGS(call), ZEND_CALL_ARG(call, 1));
zval *return_value;
if (!key) {
return 0;
}
return_value = EX_VAR(EX(opline)->result.var);
if (apc_cache_fetch(php_memoize_cache, key, php_memoize_time(), &return_value)) {
zend_string_release(key);
return 1;
}
zend_string_release(key);
}
return 0;
} /* }}} */
示例7: zend_closure_call_magic
static void zend_closure_call_magic(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ {
zend_fcall_info fci;
zend_fcall_info_cache fcc;
zval params[2];
memset(&fci, 0, sizeof(zend_fcall_info));
memset(&fci, 0, sizeof(zend_fcall_info_cache));
fci.size = sizeof(zend_fcall_info);
fci.retval = return_value;
fcc.initialized = 1;
fcc.function_handler = (zend_function *) EX(func)->common.arg_info;
fci.params = params;
fci.param_count = 2;
ZVAL_STR(&fci.params[0], EX(func)->common.function_name);
array_init(&fci.params[1]);
zend_copy_parameters_array(ZEND_NUM_ARGS(), &fci.params[1]);
fci.object = Z_OBJ(EX(This));
fcc.object = Z_OBJ(EX(This));
fcc.calling_scope = zend_get_executed_scope();
zend_call_function(&fci, &fcc);
zval_ptr_dtor(&fci.params[0]);
zval_ptr_dtor(&fci.params[1]);
}
示例8: free
void free(void *ptr) {
__asm
POP HL
EX (SP), IX
PCALL(FREE)
EX (SP), IX
JP (HL)
__endasm;
ptr;
}
示例9: wung_execute_ex
void wung_execute_ex(wung_execute_data * execute_data) {
while(1) {
if (EX(opline)->handler==0) {
break;
}
wung_print_opline(EX(opline));
(EX(opline)->handler)(execute_data);
WUNG_NEXT_OPCODE;
}
}
示例10: ZEND_METHOD
/* {{{ proto ErrorException::__construct(string message, int code, int severity [, string filename [, int lineno [, Throwable previous]]])
ErrorException constructor */
ZEND_METHOD(error_exception, __construct)
{
char *message = NULL, *filename = NULL;
zend_long code = 0, severity = E_ERROR, lineno;
zval tmp, *object, *previous = NULL;
int argc = ZEND_NUM_ARGS();
size_t message_len, filename_len;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "|sllslO!", &message, &message_len, &code, &severity, &filename, &filename_len, &lineno, &previous, zend_ce_throwable) == FAILURE) {
zend_class_entry *ce;
if (Z_TYPE(EX(This)) == IS_OBJECT) {
ce = Z_OBJCE(EX(This));
} else if (Z_CE(EX(This))) {
ce = Z_CE(EX(This));
} else {
ce = zend_ce_error_exception;
}
zend_throw_error(NULL, "Wrong parameters for %s([string $message [, long $code, [ long $severity, [ string $filename, [ long $lineno [, Throwable $previous = NULL]]]]]])", ZSTR_VAL(ce->name));
return;
}
object = getThis();
if (message) {
ZVAL_STRING(&tmp, message);
zend_update_property_ex(zend_ce_exception, object, CG(known_strings)[ZEND_STR_MESSAGE], &tmp);
zval_ptr_dtor(&tmp);
}
if (code) {
ZVAL_LONG(&tmp, code);
zend_update_property_ex(zend_ce_exception, object, CG(known_strings)[ZEND_STR_CODE], &tmp);
}
if (previous) {
zend_update_property_ex(zend_ce_exception, object, CG(known_strings)[ZEND_STR_PREVIOUS], previous);
}
ZVAL_LONG(&tmp, severity);
zend_update_property_ex(zend_ce_exception, object, CG(known_strings)[ZEND_STR_SEVERITY], &tmp);
if (argc >= 4) {
ZVAL_STRING(&tmp, filename);
zend_update_property_ex(zend_ce_exception, object, CG(known_strings)[ZEND_STR_FILE], &tmp);
zval_ptr_dtor(&tmp);
if (argc < 5) {
lineno = 0; /* invalidate lineno */
}
ZVAL_LONG(&tmp, lineno);
zend_update_property_ex(zend_ce_exception, object, CG(known_strings)[ZEND_STR_LINE], &tmp);
}
}
示例11: pearson_distances_pairwise_complete_obs_variant
// variant: means by /nrow rather than /npairs when dealing with missing data
// deviates from R's pairwise.complete.obs, but highly similar.
// good results in context of particular biological validations,
// but formal correctness undetermined
void
pearson_distances_pairwise_complete_obs_variant(
double * const d,
const double * const matrix,
int const nrow,
int const ncol
){
std::ptrdiff_t p(0);
t_float EX(0), EY(0), EXX(0), EYY(0), EXY(0), x(0), y(0);
for(int col1(0), end(ncol); col1<(end-1); ++col1){
for(int col2(col1+1); col2<end; ++col2){
// Pearson correlation distance
EX=0, EY=0, EXX=0, EYY=0, EXY=0, x=0, y=0;
unsigned npairs(0);
for(int row(0); row<nrow; ++row){
// R indexes its arrays BY COLUMN
x = matrix[col1*nrow+row];
y = matrix[col2*nrow+row];
if(ISNA(x) || ISNA(y)) continue;
++npairs;
EX += x;
EY += y;
EXX += x*x;
EYY += y*y;
EXY += x*y;
}
if(npairs<1) d[p++] = 2.0;
else d[p++] = 1.0 - (EXY - EX*EY/nrow) / sqrt( (EXX - EX*EX/nrow)*(EYY - EY*EY/nrow) );
}
}
}
示例12: com_call_method
static int com_call_method(zend_string *method, zend_object *object, INTERNAL_FUNCTION_PARAMETERS)
{
zval *args = NULL;
php_com_dotnet_object *obj = (php_com_dotnet_object*)object;
int nargs;
VARIANT v;
int ret = FAILURE;
if (V_VT(&obj->v) != VT_DISPATCH) {
return FAILURE;
}
nargs = ZEND_NUM_ARGS();
if (nargs) {
args = (zval *)safe_emalloc(sizeof(zval), nargs, 0);
zend_get_parameters_array_ex(nargs, args);
}
VariantInit(&v);
if (SUCCESS == php_com_do_invoke_byref(obj, (zend_internal_function*)EX(func), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args)) {
php_com_zval_from_variant(return_value, &v, obj->code_page);
ret = SUCCESS;
VariantClear(&v);
}
if (args) {
efree(args);
}
return ret;
}
示例13: run_pipeline
void run_pipeline() {
if(Register::cycle == 59) {
printf("in main before WB ID_EX.$rt_out = %d\n", ID_EX.$rt_out);
}
WB();
if(Register::cycle == 59) {
printf("in main before DM ID_EX.$rt_out = %d\n", ID_EX.$rt_out);
}
DM();
if(Register::cycle == 59) {
printf("in main before EX ID_EX.$rt_out = %d\n", ID_EX.$rt_out);
}
EX();
if(Register::cycle == 59) {
printf("in main before ID ID_EX.$rt_out = %d\n", ID_EX.$rt_out);
}
ID();
if(Register::cycle == 59) {
printf("in main before IF ID_EX.$rt_out = %d\n", ID_EX.$rt_out);
}
IF();
if(Register::cycle == 59) {
printf("in main after IF ID_EX.$rt_out = %d\n", ID_EX.$rt_out);
}
}
示例14: ZEND_METHOD
/* {{{ proto Closure Closure::fromCallable(callable callable)
Create a closure from a callable using the current scope. */
ZEND_METHOD(Closure, fromCallable)
{
zval *callable;
int success;
char *error = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &callable) == FAILURE) {
return;
}
if (Z_TYPE_P(callable) == IS_OBJECT && instanceof_function(Z_OBJCE_P(callable), zend_ce_closure)) {
/* It's already a closure */
RETURN_ZVAL(callable, 1, 0);
}
/* create closure as if it were called from parent scope */
EG(current_execute_data) = EX(prev_execute_data);
success = zend_create_closure_from_callable(return_value, callable, &error);
EG(current_execute_data) = execute_data;
if (success == FAILURE || error) {
if (error) {
zend_throw_exception_ex(zend_ce_type_error, 0, "Failed to create closure from callable: %s", error);
efree(error);
} else {
zend_throw_exception_ex(zend_ce_type_error, 0, "Failed to create closure from callable");
}
}
}
示例15: srec_csum
/*
* Checksum for SRECORD. Add all the bytes from the record length field through the data, and take
* the ones complement. This includes the address field, which for SRECORDs can be 2 bytes, 3 bytes or
* 4 bytes. In this case, since the upper bytes of the address will be 0 for records of the smaller sizes,
* just add all 4 bytes of the address in all cases.
*
* The arguments are:
*
* buf a pointer to the beginning of the data for the record
* length the length of the data portion of the record
* chunk_len the length of the record starting at the address and including the checksum
* chunk_addr starting address for the data in the record
*
* Returns an unsigned char with the checksum
*/
static unsigned char srec_csum(unsigned char *buf, unsigned int length, int chunk_len, int chunk_addr) {
int sum = chunk_len + (LO(chunk_addr)) + (HI(chunk_addr)) + (EX(chunk_addr)) + (EH(chunk_addr));
unsigned int i;
for(i = 0; i < length; i++) {
sum += buf[i];
}
return ~sum & 0xff;
}