这篇教程C++ INDEX函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中INDEX函数的典型用法代码示例。如果您正苦于以下问题:C++ INDEX函数的具体用法?C++ INDEX怎么用?C++ INDEX使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了INDEX函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: create_chunkvoid create_chunk( int N_u, int N_v, int N_r, double r_min, double r_max, double gamma, long nnodes, pvo_float3_t* pts, long ncells, int* cia, int* cja, uint8_t* types, double* U, float* V ){ int iu, iv, ir, i, k; double theta, phi, r, t, u, v, z; // Mesh spacing double dr = (r_max - r_min)/N_r; /* We compute the values on the sphere by projection from the plane with this z value on the sphere. The closer this value is to 1.0, the lower is the curvature */ z = sqrt(0.5*(1 - gamma*gamma)); for( ir = 0; ir <= N_r; ++ir ) for( iv = 0; iv <= N_v; ++iv ) for( iu = 0; iu <= N_u; ++iu ) { u = -z + ( (2*z)/(double )N_u )*iu; v = -z + ( (2*z)/(double )N_v )*iv; r = r_min + ir*dr; t = sqrt(u*u + v*v + gamma*gamma); k = iu + (N_u+1)*iv + (N_u+1)*(N_v+1)*ir; pts[k][0] = u *r/t; pts[k][1] = v *r/t; pts[k][2] = gamma*r/t; } for( ir = 0; ir < N_r; ++ir ) for( iv = 0; iv < N_v; ++iv ) for( iu = 0; iu < N_u; ++iu ) { k = 8*(iu + N_u*iv + N_u*N_v*ir);#undef INDEX#define INDEX(iu,iv,ir) ( (iu) + (N_u+1)*(iv) + (N_u+1)*(N_v+1)*(ir) ) cja[k+0] = INDEX(iu ,iv ,ir ); cja[k+1] = INDEX(iu+1,iv ,ir ); cja[k+2] = INDEX(iu+1,iv+1,ir ); cja[k+3] = INDEX(iu ,iv+1,ir ); cja[k+4] = INDEX(iu ,iv ,ir+1); cja[k+5] = INDEX(iu+1,iv ,ir+1); cja[k+6] = INDEX(iu+1,iv+1,ir+1); cja[k+7] = INDEX(iu ,iv+1,ir+1); } for( i = 0; i <= ncells; ++i ) cia[i] = 8*i; for( i = 0; i < ncells; ++i ) types[i] = PVO_VTU_HEXAHEDRON; srand( 0 ); for( i = 0; i < nnodes; ++i ) { U[3*i+0] = (1.0*rand())/(1.0*RAND_MAX); U[3*i+1] = (1.0*rand())/(1.0*RAND_MAX); U[3*i+2] = (1.0*rand())/(1.0*RAND_MAX); } for( i = 0; i < ncells; ++i ) V[i] = (1.0*rand())/(1.0*RAND_MAX);}
开发者ID:kraused,项目名称:pvo,代码行数:67,
示例2: ulog_get_entries/* Get the last set of updates seen, (last+1) to n is returned. */krb5_error_codeulog_get_entries(krb5_context context, const kdb_last_t *last, kdb_incr_result_t *ulog_handle){ XDR xdrs; kdb_ent_header_t *indx_log; kdb_incr_update_t *upd; unsigned int indx, count; uint32_t sno; krb5_error_code retval; kdb_log_context *log_ctx; kdb_hlog_t *ulog = NULL; uint32_t ulogentries; INIT_ULOG(context); ulogentries = log_ctx->ulogentries; retval = lock_ulog(context, KRB5_LOCKMODE_SHARED); if (retval) return retval; /* If another process terminated mid-update, reset the ulog and force full * resyncs. */ if (ulog->kdb_state != KDB_STABLE) reset_header(ulog); ulog_handle->ret = get_sno_status(log_ctx, last); if (ulog_handle->ret != UPDATE_OK) goto cleanup; sno = last->last_sno; count = ulog->kdb_last_sno - sno; upd = calloc(count, sizeof(kdb_incr_update_t)); if (upd == NULL) { ulog_handle->ret = UPDATE_ERROR; retval = ENOMEM; goto cleanup; } ulog_handle->updates.kdb_ulog_t_val = upd; for (; sno < ulog->kdb_last_sno; sno++) { indx = sno % ulogentries; indx_log = INDEX(ulog, indx); memset(upd, 0, sizeof(kdb_incr_update_t)); xdrmem_create(&xdrs, (char *)indx_log->entry_data, indx_log->kdb_entry_size, XDR_DECODE); if (!xdr_kdb_incr_update_t(&xdrs, upd)) { ulog_handle->ret = UPDATE_ERROR; retval = KRB5_LOG_CONV; goto cleanup; } /* Mark commitment since we didn't want to decode and encode the incr * update record the first time. */ upd->kdb_commit = indx_log->kdb_commit; upd++; } ulog_handle->updates.kdb_ulog_t_len = count; ulog_handle->lastentry.last_sno = ulog->kdb_last_sno; ulog_handle->lastentry.last_time.seconds = ulog->kdb_last_time.seconds; ulog_handle->lastentry.last_time.useconds = ulog->kdb_last_time.useconds; ulog_handle->ret = UPDATE_OK;cleanup: unlock_ulog(context); return retval;}
开发者ID:DirectXMan12,项目名称:krb5,代码行数:71,
示例3: mexFunction//.........这里部分代码省略......... vector_c = mxGetPr(prhs[1]); if((MAX(mxGetM(prhs[1]),mxGetN(prhs[1])) != dim) || (MIN(mxGetM(prhs[1]),mxGetN(prhs[1])) != 1)) mexErrMsgTxt("Vector is of wrong size."); /* vector y */ vector_y = mxGetPr(prhs[2]); if((MAX(mxGetM(prhs[2]),mxGetN(prhs[2])) != dim) || (MIN(mxGetM(prhs[2]),mxGetN(prhs[2])) != 1)) mexErrMsgTxt("Vector is of wrong size."); /* string identifier of QP solver to be used */ if( mxIsChar( prhs[3] ) != 1) mexErrMsgTxt("Solver must be a string."); buf_len = (mxGetM(prhs[3]) * mxGetN(prhs[3])) + 1; buf_len = (buf_len > 20) ? 20 : buf_len; mxGetString( prhs[3], solver, buf_len ); /* maximal allowed number of iterations */ tmax = mxIsInf( mxGetScalar(prhs[4])) ? INT_MAX : (long)mxGetScalar(prhs[4]); tolabs = mxGetScalar(prhs[5]); /* abs. precision defining stopping cond*/ tolrel = mxGetScalar(prhs[6]); /* rel. precision defining stopping cond*/ /* threshold on lower bound */ thlb = mxIsInf( mxGetScalar(prhs[7])) ? DBL_MAX : (double)mxGetScalar(prhs[7]); verb = (int)mxGetScalar(prhs[8]); /* verbosity on/off */ if( verb == 1 ) { mexPrintf("Settings of QP solver/n"); mexPrintf("solver : %s/n", solver ); mexPrintf("tmax : %d/n", tmax ); mexPrintf("tolabs : %f/n", tolabs ); mexPrintf("tolrel : %f/n", tolrel ); mexPrintf("dim : %d/n", dim ); } /*------------------------------------------------------------------- */ /* Inicialization */ /*------------------------------------------------------------------- */ /* output "solution" vector alpha [dim x 1] */ plhs[0] = mxCreateDoubleMatrix(dim,1,mxREAL); alpha = mxGetPr(plhs[0]); /* allocattes and precomputes diagonal of virtual K matrix */ diag_H = mxCalloc(dim, sizeof(double)); if( diag_H == NULL ) mexErrMsgTxt("Not enough memory."); for(i = 0; i < dim; i++ ) { diag_H[i] = matrix_H[dim*i+i]; } /* counter of access to matrix H */ access = dim; /*------------------------------------------------------------------- */ /* Call QP solver */ /*------------------------------------------------------------------- */ if ( strcmp( solver, "mdm" ) == 0 ) { exitflag = gnpp_mdm( &get_col, diag_H, vector_c, vector_y, dim, tmax, tolabs, tolrel, thlb, alpha, &t, &aHa11, &aHa22, &History, verb ); } else if ( strcmp( solver, "imdm" ) == 0 ) { exitflag = gnpp_imdm( &get_col, diag_H, vector_c, vector_y, dim, tmax, tolabs, tolrel, thlb, alpha, &t, &aHa11, &aHa22, &History, verb ); } else { mexErrMsgTxt("Unknown QP solver identifier!"); } /*------------------------------------------------------------------- */ /* Generate outputs */ /*------------------------------------------------------------------- */ /* exitflag [1x1] */ plhs[1] = mxCreateDoubleMatrix(1,1,mxREAL); *(mxGetPr(plhs[1])) = (double)exitflag; /* t [1x1] */ plhs[2] = mxCreateDoubleMatrix(1,1,mxREAL); *(mxGetPr(plhs[2])) = (double)t; /* access [1x1] */ plhs[3] = mxCreateDoubleMatrix(1,1,mxREAL); *(mxGetPr(plhs[3])) = (double)access; /* History [2 x (t+1)] */ plhs[4] = mxCreateDoubleMatrix(2,t+1,mxREAL); tmp_ptr = mxGetPr( plhs[4] ); for( i = 0; i <= t; i++ ) { tmp_ptr[INDEX(0,i,2)] = History[INDEX(0,i,2)]; tmp_ptr[INDEX(1,i,2)] = History[INDEX(1,i,2)]; } /*------------------------------------------------------------------- */ /* Free used memory */ /*------------------------------------------------------------------- */ mxFree( History ); mxFree( diag_H );}
开发者ID:alviur,项目名称:Action_recognition,代码行数:101,
示例4: mexFunction//.........这里部分代码省略......... } else { W = (double*)mxGetPr(prhs[1]); } // ------------------------------------------------------------------------ // mapTable tmp_ptr = (double*)mxGetPr(prhs[2]); dims = mxGetDimensions(prhs[2]); if (dims[0]*dims[1] != M*4) { mexErrMsgTxt("mapTable must be a matrix [M x 4 (double)]"); } for (int i = 0; i < M*4; ++i) { mapTable[i] = (int)tmp_ptr[i]; } // prepare output matrix plhs[0] = mxCreateNumericMatrix(2, M, mxDOUBLE_CLASS, mxREAL); result = (double*)mxGetPr(plhs[0]); //-------------------------------------------------------------------------- // get Q, G double ** q = (double**)calloc(M, sizeof(double*)); double ** g = (double**)calloc((M-1), sizeof(double*)); int idx_qtemp = 0; double * L; for (int idx = 0; idx < M; ++idx) { // Q tsize = mapTable[INDEX(idx, 1, M)] - mapTable[INDEX(idx, 0, M)] + 1; double * q_temp = (double*)calloc(tsize, sizeof(double)); memcpy(q_temp, W+mapTable[INDEX(idx, 0, M)]-1, tsize*sizeof(double)); // sparse dot product <W_q, PSI_q> cell_ptr = mxGetCell(prhs[3], idx); dims = mxGetDimensions(cell_ptr); cols = dims[1]; rows = dims[0]; uint32_t *psi_temp = (uint32_t*)mxGetPr(cell_ptr); if (lossy) { L = (double*)mxGetPr(mxGetCell(prhs[4], idx)); } q[idx] = (double*)malloc(cols*sizeof(double)); for (int i = 0; i < cols; ++i) { double dotprod = 0.0f; for (int j = 0; j < rows; ++j) { idx_qtemp = psi_temp[(rows*i) + j]; dotprod += q_temp[ idx_qtemp ]; } q[idx][i] = dotprod; if (lossy) { q[idx][i] += L[i]; } } free(q_temp); // G
开发者ID:JVision,项目名称:flandmark,代码行数:67,
示例5: qpbsvm_mex//.........这里部分代码省略......... /* string identifier of QP solver to be used */ if( mxIsChar( prhs[3] ) != 1) mexErrMsgTxt("Solver must be a string."); buf_len = (mxGetM(prhs[3]) * mxGetN(prhs[3])) + 1; buf_len = (buf_len > 20) ? 20 : buf_len; mxGetString( prhs[3], solver, buf_len ); tmax = mxIsInf( mxGetScalar(prhs[4])) ? INT_MAX : (long)mxGetScalar(prhs[4]); tolabs = mxGetScalar(prhs[5]); /* abs. precision defining stopping cond*/ tolrel = mxGetScalar(prhs[6]); /* rel. precision defining stopping cond*/ tolKKT = mxGetScalar(prhs[7]); /* rel. precision defining stopping cond*/ verb = (int)(mxGetScalar(prhs[8])); /* verbosity on/off */ /* output "solution" vector alpha [dim x 1] */ plhs[0] = mxCreateDoubleMatrix(dim,1,mxREAL); x = mxGetPr(plhs[0]); x0 = mxGetPr(prhs[9]); for(i=0; i < dim; i++) x[i] = x0[i]; /* Nabla = H*x + f */ plhs[5] = mxCreateDoubleMatrix(dim,1,mxREAL); Nabla = mxGetPr(plhs[5]); tmp_ptr = mxGetPr(prhs[10]); for(i=0; i < dim; i++) Nabla[i] = tmp_ptr[i]; if( verb > 0 ) { mexPrintf("Settings of QP solver/n"); mexPrintf("nrhs : %d/n", nrhs); mexPrintf("solver : %s/n", solver); mexPrintf("UB : %f/n", UB ); mexPrintf("tmax : %d/n", tmax ); mexPrintf("tolabs : %f/n", tolabs ); mexPrintf("tolrel : %f/n", tolrel ); mexPrintf("dim : %d/n", dim ); mexPrintf("verb : %d/n", verb ); } /*------------------------------------------------------------------- */ /* Inicialization */ /*------------------------------------------------------------------- */ /* allocattes and precomputes diagonal of virtual K matrix */ diag_H = mxCalloc(dim, sizeof(double)); if( diag_H == NULL ) mexErrMsgTxt("Not enough memory."); for(i = 0; i < dim; i++ ) { diag_H[i] = matrix_H[dim*i+i]; } /* counter of access to matrix H */ access = dim; /*------------------------------------------------------------------- */ /* Call QP solver */ /*------------------------------------------------------------------- */ if ( strcmp( solver, "sca" ) == 0 ) { exitflag = qpbsvm_sca( &get_col, diag_H, f, UB, dim, tmax, tolabs, tolrel, tolKKT, x, Nabla, &t, &History, verb ); } else if (strcmp( solver, "scas" ) == 0 ) { exitflag = qpbsvm_scas( &get_col, diag_H, f, UB, dim, tmax, tolabs, tolrel, tolKKT, x, Nabla, &t, &History, verb ); } else if (strcmp( solver, "scamv" ) == 0 ) { exitflag = qpbsvm_scamv( &get_col, diag_H, f, UB, dim, tmax, tolabs, tolrel, tolKKT, x, Nabla, &t, &History, verb ); } else { mexErrMsgTxt("Unknown QP solver identifier!"); } /*------------------------------------------------------------------- */ /* Generate outputs */ /*------------------------------------------------------------------- */ /* exitflag [1x1] */ plhs[1] = mxCreateDoubleMatrix(1,1,mxREAL); *(mxGetPr(plhs[1])) = (double)exitflag; /* t [1x1] */ plhs[2] = mxCreateDoubleMatrix(1,1,mxREAL); *(mxGetPr(plhs[2])) = (double)t; /* access [1x1] */ plhs[3] = mxCreateDoubleMatrix(1,1,mxREAL); *(mxGetPr(plhs[3])) = (double)access; /* History [2 x (t+1)] */ plhs[4] = mxCreateDoubleMatrix(2,t+1,mxREAL); tmp_ptr = mxGetPr( plhs[4] ); for( i = 0; i <= t; i++ ) { tmp_ptr[INDEX(0,i,2)] = History[INDEX(0,i,2)]; tmp_ptr[INDEX(1,i,2)] = History[INDEX(1,i,2)]; } /*------------------------------------------------------------------- */ /* Free used memory */ /*------------------------------------------------------------------- */ mxFree( History ); mxFree( diag_H );}
开发者ID:lambday,项目名称:svc,代码行数:101,
示例6: ALOGIstatus_t ExynosCameraFrameFactory::initPipes(void){ ALOGI("INFO(%s[%d])", __FUNCTION__, __LINE__); int ret = 0; camera_pipe_info_t pipeInfo[3]; ExynosRect tempRect; int maxSensorW = 0, maxSensorH = 0, hwSensorW = 0, hwSensorH = 0; int maxPreviewW = 0, maxPreviewH = 0, hwPreviewW = 0, hwPreviewH = 0; int hwPictureW = 0, hwPictureH = 0; int bayerFormat = CAMERA_BAYER_FORMAT; int previewFormat = m_parameters->getHwPreviewFormat(); int pictureFormat = m_parameters->getPictureFormat(); struct ExynosConfigInfo *config = m_parameters->getConfig(); m_parameters->getMaxSensorSize(&maxSensorW, &maxSensorH); m_parameters->getHwSensorSize(&hwSensorW, &hwSensorH); m_parameters->getMaxPreviewSize(&maxPreviewW, &maxPreviewH); m_parameters->getHwPreviewSize(&hwPreviewW, &hwPreviewH); m_parameters->getHwPictureSize(&hwPictureW, &hwPictureH); ALOGI("INFO(%s[%d]): MaxSensorSize(%dx%d), HWSensorSize(%dx%d)", __FUNCTION__, __LINE__, maxSensorW, maxSensorH, hwSensorW, hwSensorH); ALOGI("INFO(%s[%d]): MaxPreviewSize(%dx%d), HwPreviewSize(%dx%d)", __FUNCTION__, __LINE__, maxPreviewW, maxPreviewH, hwPreviewW, hwPreviewH); ALOGI("INFO(%s[%d]): HWPictureSize(%dx%d)", __FUNCTION__, __LINE__, hwPictureW, hwPictureH); memset(pipeInfo, 0, (sizeof(camera_pipe_info_t) * 3)); /* FLITE pipe */#ifdef FIXED_SENSOR_SIZE tempRect.fullW = maxSensorW + 16; tempRect.fullH = maxSensorH + 10;#else tempRect.fullW = hwSensorW + 16; tempRect.fullH = hwSensorH + 10;#endif tempRect.colorFormat = bayerFormat; pipeInfo[0].rectInfo = tempRect; pipeInfo[0].bufInfo.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; pipeInfo[0].bufInfo.memory = V4L2_CAMERA_MEMORY_TYPE; pipeInfo[0].bufInfo.count = config->current->bufInfo.num_bayer_buffers; /* per frame info */ pipeInfo[0].perFrameNodeGroupInfo.perframeSupportNodeNum = 0; pipeInfo[0].perFrameNodeGroupInfo.perFrameLeaderInfo.perFrameNodeType = PERFRAME_NODE_TYPE_NONE;#ifdef CAMERA_PACKED_BAYER_ENABLE /* packed bayer bytesPerPlane */ pipeInfo[0].bytesPerPlane[0] = ROUND_UP(pipeInfo[0].rectInfo.fullW, 10) * 8 / 5;#endif ret = m_pipes[INDEX(PIPE_FLITE)]->setupPipe(pipeInfo); if (ret < 0) { ALOGE("ERR(%s[%d]):FLITE setupPipe fail, ret(%d)", __FUNCTION__, __LINE__, ret); /* TODO: exception handling */ return INVALID_OPERATION; } /* setParam for Frame rate */ uint32_t min, max, frameRate; struct v4l2_streamparm streamParam; memset(&streamParam, 0x0, sizeof(v4l2_streamparm)); m_parameters->getPreviewFpsRange(&min, &max); if (m_parameters->getScalableSensorMode() == true) frameRate = 24; else frameRate = max; streamParam.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; streamParam.parm.capture.timeperframe.numerator = 1; streamParam.parm.capture.timeperframe.denominator = frameRate; ALOGI("INFO(%s[%d]:set framerate (denominator=%d)", __FUNCTION__, __LINE__, frameRate); ret = setParam(streamParam, PIPE_FLITE); if (ret < 0) { ALOGE("ERR(%s[%d]):FLITE setParam fail, ret(%d)", __FUNCTION__, __LINE__, ret); return INVALID_OPERATION; }#if 0 /* setParam for Frame rate */ int bnsScaleRatio = m_parameters->getBnsScaleRatio(); int bnsSize = 0; ret = m_pipes[PIPE_FLITE]->setControl(V4L2_CID_IS_S_BNS, bnsScaleRatio); if (ret < 0) { ALOGE("ERR(%s[%d]): set BNS(%d) fail, ret(%d)", __FUNCTION__, __LINE__, bnsScaleRatio, ret); } else { ret = m_pipes[PIPE_FLITE]->getControl(V4L2_CID_IS_G_BNS_SIZE, &bnsSize); if (ret < 0) { ALOGE("ERR(%s[%d]): get BNS size fail, ret(%d)", __FUNCTION__, __LINE__, ret); bnsSize = -1; } } int bnsWidth = 0; int bnsHeight = 0; if (bnsSize > 0) { bnsHeight = bnsSize & 0xffff; bnsWidth = bnsSize >> 16;//.........这里部分代码省略.........
开发者ID:TeamEOS,项目名称:hardware_samsung_slsi_exynos,代码行数:101,
示例7: updateGraphvoid updateGraph(){ if(dist) { free(dist); dist = NULL; } if(prev) { free(prev); prev = NULL; } if(graph) { free(graph); graph = NULL; }int r= 0, s=0; dist = (int *) malloc(nl_nsites(nl) * sizeof(int)); prev = (int *) malloc(nl_nsites(nl) * sizeof(int)); graph = (int *) malloc(sizeof(int) * (nl_nsites(nl)) * (nl_nsites(nl))); for(r=0;r<nl_nsites(nl);r++) { dist[r] = INFINITY; prev[r] = UNDEFINED; for(s=0;s<nl_nsites(nl);s++) { graph[INDEX(r, s, nl_nsites(nl))] = 0; } } struct gossip *g = gossip; while(g != NULL) { int len = strlen(gossip_latest(g)); char *lat = (char *) malloc(sizeof(char) * (len+1)); strcpy(lat, gossip_latest(g)); char *addr = lat; char *ctr = index(addr, '/'); *ctr++ = 0; char *payload = index(ctr, '/'); *payload++ = 0; char *token = strtok(payload, ";"); while (token) { //printf("Address = %s/n", addr); //printf("Token = %s/n", token); set_dist(nl, graph, nl_nsites(nl), addr, token, 1); token = strtok(NULL, ";"); } g = gossip_next(g); free(lat); } char *my_addr_str = addr_to_string(my_addr); int my_index = nl_index(nl, my_addr_str); // update connections of immediate neighbours struct file_info *f = file_info; while (f) { char *addr = addr_to_string(f->addr); if(strcmp(addr,my_addr_str ) != 0 && (f->type == FI_INCOMING || (f->type == FI_OUTGOING && f->status == FI_KNOWN && f->u.fi_outgoing.status == FI_CONNECTED))) { set_dist(nl, graph, nl_nsites(nl), addr, my_addr_str, 1); } f = f->next; free(addr); } free(my_addr_str); // call graph on updated graph dijkstra(graph, nl_nsites(nl), my_index, dist, prev); printf("PRINTING GRAPH/n"); for(r=0;r<nl_nsites(nl);r++) { for(s=0;s<nl_nsites(nl);s++) { printf("%d ", graph[INDEX(r, s, nl_nsites(nl))]); } printf("/n"); } printf("/nPRINTING DISTANCE/n"); for(r=0;r<nl_nsites(nl);r++) { printf("Distance to Site [%d] %s = %d/n", r, nl_name(nl,r), dist[r]); } printf("/nPRINTING PREV/n"); for(r=0;r<nl_nsites(nl);r++) { printf("Previous to Site [%d] %s = %d/n", r, nl_name(nl,r), prev[r]); }}
开发者ID:Amanjot1507,项目名称:OS-Work,代码行数:99,
示例8: hqr/*Algorithm taken from Matrix Algorithms Vol. II by G.W. Stewart.Given an upper Hessenberg matrix, H, hqr overwrites it iwth a unitary similartriangular matrix whose diagonals are the eigenvalues of H.I beleive this is called Schur form.n is the size of the matrix H-1 is returned if more than maxiter iterations are required to to deflatethe matrix at any eigenvalue. If everything completes successfully, a 0 isreturned.c, s, r1, r2, and t are arrays of length n, used for scratch work*/int hqr(Complex *H, Complex *Q, Real *c, Complex *s, Complex *r1, Complex *r2, Complex *t, int n, int maxiter, Real epsilon){ int i1, i2, iter, oldi2, i, j; Complex k, tmp; //2. i1 = 1; i2 = n i1 = 0; i2 = n-1;//this is used both as an index and an upper bound in loops, so //it must be n-1, but I must use <= in loops. //3. iter = 0; iter = 0; //4. while(true) while(1) { //5. iter = iter+1 iter += 1; //6. if(iter > maxiter) error return fi if(iter > maxiter) return -1; //7. oldi2 = i2 oldi2 = i2; //8. backsearch(H, i2, i1, i2) backsearch(H, n, i2, &i1, &i2, epsilon); //9. if(i2 = 1) leave hqr fi if(i2 == 0) return 0; //10. if(i2 != oldi2)iter = 0 fi if(i2 != oldi2) iter = 0;//I suppose we moved to the next eigenvalue //11. wilkshift(H[i2-1,i2-1], H[i2-1,i2], H[i2,i2-1], H[i2,i2], k) wilkshift(&INDEX(H,n,(i2-1),(i2-1)), &INDEX(H,n,(i2-1),i2), &INDEX(H,n,i2,(i2-1)), &INDEX(H,n,i2,i2), &k); //12. H[i1,i1] = H[i1,i1] - k INDEX(H,n,i1,i1).real -= k.real; INDEX(H,n,i1,i1).imag -= k.imag; //13. for i = i1 to i2-1 for(i = i1; i <= i2-1; i++) { //14. rotgen(H[i,i], H[i+1, i], c_i, s_i) rotgen(&INDEX(H,n,i,i), &INDEX(H,n,(i+1),i), &c[i], &s[i]); //15. H[i+1, i+1] = H[i+1, i+1] - k INDEX(H,n,(i+1),(i+1)).real -= k.real; INDEX(H,n,(i+1),(i+1)).imag -= k.imag; //16. rotapp(c_i, s_i, H[i, i+1:n], H[i+1,i+1:n]) //Unfortunately, we are now using a row. Before we were looking at //single columns, so I indexed the arrays H[i,j] = H[i + j*n], so //that &INDEX(H,n,i,j) could be used to equal H[i:n,j]. I can't do //that with rows now. //I will be using the array r1 and r2 for these two rows //copy the contents fo the rows to r1,r2 for(j = i+1; j < n; j++) { r1[j].real = INDEX(H,n,i,j).real; r1[j].imag = INDEX(H,n,i,j).imag; r2[j].real = INDEX(H,n,(i+1),j).real; r2[j].imag = INDEX(H,n,(i+1),j).imag; } rotapp(&c[i], &s[i], &r1[i+1], &r2[i+1], t, n-i-1); //now copy the results back to H for(j = i+1; j < n; j++) { INDEX(H,n,i,j).real = r1[j].real; INDEX(H,n,i,j).imag = r1[j].imag; INDEX(H,n,(i+1),j).real = r2[j].real; INDEX(H,n,(i+1),j).imag = r2[j].imag; } }//17. end for i //18. for i = i1 to i2-1 for(i = i1; i <= i2-1; i++) {//.........这里部分代码省略.........
开发者ID:tsarvey,项目名称:spinwaves,代码行数:101,
示例9: righteigvec/*Algorithm taken from Matrix Algorithms Vol. II by G.W. Stewart.REturns the right eigenvectors of the upper tiangular matrix T in the matrix X.T and X and n*n Complex matrices.*/void righteigvec(Complex *T, Complex *X, int n){ int k, i, j; Real dmin, tmp, s; Complex d, tmp_c; //fill X with zeros just in case for(i = 0; i < n; i++) { for(j = 0; j < n; j++) { INDEX(X,n,i,j).real = 0.0; INDEX(X,n,i,j).imag = 0.0; } } //4. for k = n to 1 by -1 for(k = n-1; k >= 0; k--) { //5. X[1:k-1,k] = -T[1:k-1,k] for(i = 0; i <= k-1; i++) { INDEX(X,n,i,k).real = -INDEX(T,n,i,k).real; INDEX(X,n,i,k).imag = -INDEX(T,n,i,k).imag; } //6. X[k,k] = 1 INDEX(X,n,k,k).real = 1.0; INDEX(X,n,k,k).imag = 0.0; //7. X[k+1:n,k] = 0 for(i = k+1; i < n; i++) { INDEX(X,n,i,k).real = 0.0; INDEX(X,n,i,k).imag = 0.0; } //8. dmin = max{eps_M*|T[k,k]|,smallnum} dmin = 0.0; tmp = INDEX(T,n,k,k).real * INDEX(T,n,k,k).real + INDEX(T,n,k,k).imag * INDEX(T,n,k,k).imag; tmp = EPS_M * sqrt(tmp); if(tmp > SMALLNUM) dmin = tmp; else dmin = SMALLNUM; //9. for j = k-1 to 1 by -1 for(j = k-1; j >= 0; j--) { //10. d = T[j,j] - T[k,k] d.real = INDEX(T,n,j,j).real - INDEX(T,n,k,k).real; d.imag = INDEX(T,n,j,j).imag - INDEX(T,n,k,k).imag; //11. if(|d| <= dmin) d = dmin fi if(norm(&d,1) <= dmin) { d.real = dmin; d.imag = 0.0; } //12. if(|X[j,k]|/bignum >= |d|) if(norm(&(INDEX(X,n,j,k)),1)/BIGNUM >= norm(&d,1)) { //13. s = |d|/|X[j,k]| s = norm(&d, 1)/norm(&INDEX(X,n,j,k),1); //14. X[1:k,k] = s*X[1:k,k] for(i = 0; i <= k; i++) { INDEX(X,n,i,k).real = s*INDEX(X,n,i,k).real; INDEX(X,n,i,k).imag = s*INDEX(X,n,i,k).imag; } }//15. endif //16. X[j,k] = X[j,k]/d tmp = INDEX(X,n,j,k).real; INDEX(X,n,j,k).real = INDEX(X,n,j,k).real*d.real + INDEX(X,n,j,k).imag*d.imag; INDEX(X,n,j,k).imag = INDEX(X,n,j,k).imag*d.real - tmp*d.imag; tmp = d.real*d.real + d.imag*d.imag; INDEX(X,n,j,k).real /= tmp; INDEX(X,n,j,k).imag /= tmp; //17. X[1:j-1,k] = X[1:j-1,k] - X[j,k]*T[1:j-1,j] for(i = 0; i <= j-1; i++) { tmp_c = complexMult(INDEX(X,n,j,k), INDEX(T,n,i,j)); INDEX(X,n,i,k).real = INDEX(X,n,i,k).real - tmp_c.real; INDEX(X,n,i,k).imag = INDEX(X,n,i,k).imag - tmp_c.imag; } }//18. end for j //19. X[1:k,k] = X[1:k,k]/||X[1:k,k]||_2//.........这里部分代码省略.........
开发者ID:tsarvey,项目名称:spinwaves,代码行数:101,
示例10: CTL {NAME("prof_gdump"), CTL(opt_prof_gdump)}, {NAME("prof_final"), CTL(opt_prof_final)}, {NAME("prof_leak"), CTL(opt_prof_leak)}, {NAME("prof_accum"), CTL(opt_prof_accum)}};static const ctl_named_node_t arena_i_node[] = { {NAME("purge"), CTL(arena_i_purge)}, {NAME("dss"), CTL(arena_i_dss)}};static const ctl_named_node_t super_arena_i_node[] = { {NAME(""), CHILD(named, arena_i)}};static const ctl_indexed_node_t arena_node[] = { {INDEX(arena_i)}};static const ctl_named_node_t arenas_bin_i_node[] = { {NAME("size"), CTL(arenas_bin_i_size)}, {NAME("nregs"), CTL(arenas_bin_i_nregs)}, {NAME("run_size"), CTL(arenas_bin_i_run_size)}};static const ctl_named_node_t super_arenas_bin_i_node[] = { {NAME(""), CHILD(named, arenas_bin_i)}};static const ctl_indexed_node_t arenas_bin_node[] = { {INDEX(arenas_bin_i)}};
开发者ID:GlassFace,项目名称:sunwell,代码行数:30,
示例11: hessreduce/*Algorithm taken from Matrix Algorithms Vol. II by G.W. Stewart.This function takes a vector A of order n and reduces it to Hessenberg formby Householder transformations.In the future it may be possible to remove H entirely and do the transformationin place.A is an n*n matrix that I am transformingH is an n*n matrix where I will put the resultQ is an n*n matrix where I will accumulate the transformationsu is a vector of length n for scratch work.vH is another vector of length n for scratch work*/void hessreduce(Complex *A, Complex *H, Complex *Q, Complex *u, Complex *vH, int n){ int k, i, j, l; Complex tmp; if(n < 2) return; //Reduce A //H = A copyMat(A,H,n,n); //3. for k = 1 to n-2 for(k = 0; k < n-2; k++) { //Generate the Transformation //housegen(H[k+1:n,k],u,H[k+1,k]) housegen(&INDEX(H,n,(k+1),k),u+k+1,&INDEX(H,n,(k+1),k),n-k-1); //5. Q[k+1:n,k] = u copyVect(u+k+1, &INDEX(Q, n, (k+1), k), n-k-1); //Premultiply the transformation //6. vH = uH*H[k+1:n,k+1:n] for(i = k+1; i < n; i++) { vH[i].real = 0.0; vH[i].imag = 0.0; for(j = k+1; j < n; j++) { tmp = INDEX(H,n,j,i); vH[i].real += u[j].real * tmp.real; vH[i].real += u[j].imag * tmp.imag;//minus minus for hermitian vH[i].imag += u[j].real * tmp.imag; vH[i].imag -= u[j].imag * tmp.real;//minus sign is for hermitian } } //7. H[k+1:n,k+1:n] = H[k+1:n, k+1:n] - u*vH for(i = k+1; i < n; i++) { for(j = k+1; j < n; j++) { INDEX(H,n,i,j).real -= u[i].real *vH[j].real; INDEX(H,n,i,j).real += u[i].imag *vH[j].imag; INDEX(H,n,i,j).imag -= u[i].real *vH[j].imag; INDEX(H,n,i,j).imag -= u[i].imag *vH[j].real; } } //H[k+2:n,k] = 0 for(i = k+2; i < n; i++) { INDEX(H,n,i,k).real = 0.0; INDEX(H,n,i,k).imag = 0.0; } //Postmultiply the transformation //9. v = H[1:n, k+1:n]*u //I will use the variable vH for v (for space). for(i = 0; i < n; i++) { vH[i].real = 0.0; vH[i].imag = 0.0; for(j = k+1; j < n; j++) { tmp = INDEX(H,n,i,j); vH[i].real += tmp.real * u[j].real; vH[i].real -= tmp.imag * u[j].imag; vH[i].imag += tmp.real * u[j].imag; vH[i].imag += tmp.imag * u[j].real; } } //10. H[1:n, k+1:n] = H[1:n,k+1:n] - v*uH for(i = 0; i < n; i++) { for(j = k+1; j < n; j++) { INDEX(H,n,i,j).real -= vH[i].real * u[j].real; INDEX(H,n,i,j).real -= vH[i].imag * u[j].imag; INDEX(H,n,i,j).imag += vH[i].real * u[j].imag; INDEX(H,n,i,j).imag -= vH[i].imag * u[j].real; }//.........这里部分代码省略.........
开发者ID:tsarvey,项目名称:spinwaves,代码行数:101,
示例12: mxmg_c//.........这里部分代码省略......... Detailed Input to Detailed_Input Detailed Output to Detailed_Output -CSPICE Version 1.1.1, 10-NOV-2006 (EDW) Added Parameters section header. -CSPICE Version 1.1.0, 28-AUG-2001 (NJB) Const-qualified input arrays. -CSPICE Version 1.0.0, 16-APR-1999 (NJB)-Index_Entries matrix times matrix n-dimensional_case-&*/{ /* Begin mxmg_c */ /* Local macros We'd like to be able to refer to the elements of the input and output matrices using normal subscripts, for example, m1[2][3]. Since the compiler doesn't know how to compute index offsets for the array arguments, which have user-adjustable size, we must compute the offsets ourselves. To make syntax a little easier to read (we hope), we'll use macros to do the computations. The macro INDEX(width, i,j) computes the index offset from the array base of the element at position [i][j] in a 2-dimensional matrix having the number of columns indicated by width. For example, if the input matrix m1 has 2 rows and 3 columns, the element at position [0][1] would be indicated by m1[ INDEX(3,0,1) ] */ #define INDEX( width, row, col ) ( (row)*(width) + (col) ) /* Local variables */ SpiceDouble innerProduct; SpiceDouble *tmpmat; SpiceDouble *loc_m1; SpiceDouble *loc_m2; SpiceInt col; SpiceInt nelts; SpiceInt row; SpiceInt i; size_t size; /* Allocate space for a temporary copy of the output matrix, which has nrow1 rows and ncol2 columns. */
开发者ID:Boxx-Obspm,项目名称:DOCKing_System,代码行数:67,
示例13: timeTestdouble timeTest(int num){ //linux wall time struct timeval tvBegin, tvEnd, tvDiff; int i; #define N 8 Complex A[N*N]; Real c[N]; Complex s[N], r1[N], r2[N], t[N]; INDEX(A,8,0,0).real = -1.2; INDEX(A,8,0,0).imag = 3.1; INDEX(A,8,0,1).real = 2.4; INDEX(A,8,0,1).imag = -0.1; INDEX(A,8,0,2).real = 0.3; INDEX(A,8,0,2).imag = -1.0; INDEX(A,8,0,3).real = 3.6; INDEX(A,8,0,3).imag = -0.2; INDEX(A,8,0,4).real = 1.0; INDEX(A,8,0,4).imag = 0.0; INDEX(A,8,0,5).real = 0.1; INDEX(A,8,0,5).imag = -3.2; INDEX(A,8,0,6).real = 2.3; INDEX(A,8,0,6).imag = 1.6; INDEX(A,8,0,7).real = 0.4; INDEX(A,8,0,7).imag = -2.3; INDEX(A,8,1,0).real = 1.1; INDEX(A,8,1,0).imag = -0.2; INDEX(A,8,1,1).real = -2.0; INDEX(A,8,1,1).imag = 1.0; INDEX(A,8,1,2).real = 3.2; INDEX(A,8,1,2).imag = 3.8; INDEX(A,8,1,3).real = -2.1; INDEX(A,8,1,3).imag = -1.2; INDEX(A,8,1,4).real = 1.6; INDEX(A,8,1,4).imag = 0.9; INDEX(A,8,1,5).real = -2.1; INDEX(A,8,1,5).imag = -0.1; INDEX(A,8,1,6).real = 1.3; INDEX(A,8,1,6).imag = 2.1; INDEX(A,8,1,7).real = 4.2; INDEX(A,8,1,7).imag = 0.0; INDEX(A,8,2,0).real = -1.2; INDEX(A,8,2,0).imag = 3.1; INDEX(A,8,2,1).real = 2.4; INDEX(A,8,2,1).imag = -0.1; INDEX(A,8,2,2).real = 0.3; INDEX(A,8,2,2).imag = -1.0; INDEX(A,8,2,3).real = 3.6; INDEX(A,8,2,3).imag = -0.2; INDEX(A,8,2,4).real = 1.0; INDEX(A,8,2,4).imag = 0.0; INDEX(A,8,2,5).real = 0.1; INDEX(A,8,2,5).imag = -3.2; INDEX(A,8,2,6).real = 0.0; INDEX(A,8,2,6).imag = 0.0; INDEX(A,8,2,7).real = 0.4; INDEX(A,8,2,7).imag = -2.3; INDEX(A,8,3,0).real = 1.1; INDEX(A,8,3,0).imag = -0.2; INDEX(A,8,3,1).real = -2.0; INDEX(A,8,3,1).imag = 1.0; INDEX(A,8,3,2).real = 3.2; INDEX(A,8,3,2).imag = 3.8; INDEX(A,8,3,3).real = -2.1; INDEX(A,8,3,3).imag = -1.2; INDEX(A,8,3,4).real = 1.6; INDEX(A,8,3,4).imag = 0.9; INDEX(A,8,3,5).real = -2.1; INDEX(A,8,3,5).imag = -0.1; INDEX(A,8,3,6).real = 1.3; INDEX(A,8,3,6).imag = 2.1; INDEX(A,8,3,7).real = 4.2; INDEX(A,8,3,7).imag = 0.0; INDEX(A,8,4,0).real = 1.2; INDEX(A,8,4,0).imag = 3.1; INDEX(A,8,4,1).real = 0.4; INDEX(A,8,4,1).imag = -0.1; INDEX(A,8,4,2).real = 0.3; INDEX(A,8,4,2).imag = -1.0; INDEX(A,8,4,3).real = 3.6; INDEX(A,8,4,3).imag = -0.2; INDEX(A,8,4,4).real = 0.0; INDEX(A,8,4,4).imag = 0.0; INDEX(A,8,4,5).real = 3.1; INDEX(A,8,4,5).imag = -3.2; INDEX(A,8,4,6).real = 2.3; INDEX(A,8,4,6).imag = 1.6; INDEX(A,8,4,7).real = 0.4; INDEX(A,8,4,7).imag = -2.3; INDEX(A,8,5,0).real = 2.1; INDEX(A,8,5,0).imag = -0.2; INDEX(A,8,5,1).real = -2.0; INDEX(A,8,5,1).imag = 1.0; INDEX(A,8,5,2).real = 3.2; INDEX(A,8,5,2).imag = -3.8; INDEX(A,8,5,3).real = 2.1;//.........这里部分代码省略.........
开发者ID:tsarvey,项目名称:spinwaves,代码行数:101,
示例14: ExynosCameraFrameExynosCameraFrame *ExynosCameraFrameFactory::createNewFrame(void){ int ret = 0; ExynosCameraFrameEntity *newEntity[MAX_NUM_PIPES] = {}; ExynosCameraFrame *frame = new ExynosCameraFrame(m_parameters, m_frameCount); int requestEntityCount = 0; setRequestSCP(true); ret = m_initFrameMetadata(frame); if (ret < 0) ALOGE("(%s[%d]): frame(%d) metadata initialize fail", __FUNCTION__, __LINE__, m_frameCount); /* set FLITE pipe to linkageList */ newEntity[INDEX(PIPE_FLITE)] = new ExynosCameraFrameEntity(PIPE_FLITE, ENTITY_TYPE_OUTPUT_ONLY, ENTITY_BUFFER_FIXED); frame->addSiblingEntity(NULL, newEntity[INDEX(PIPE_FLITE)]); requestEntityCount++; /* set ISP pipe to linkageList */ newEntity[INDEX(PIPE_ISP)] = new ExynosCameraFrameEntity(PIPE_ISP, ENTITY_TYPE_INPUT_ONLY, ENTITY_BUFFER_FIXED); frame->addChildEntity(newEntity[INDEX(PIPE_FLITE)], newEntity[INDEX(PIPE_ISP)]); /* set SCC pipe to linkageList */ newEntity[INDEX(PIPE_SCC)] = new ExynosCameraFrameEntity(PIPE_SCC, ENTITY_TYPE_OUTPUT_ONLY, ENTITY_BUFFER_DELIVERY); frame->addSiblingEntity(NULL, newEntity[INDEX(PIPE_SCC)]); requestEntityCount++; /* set SCP pipe to linkageList */ newEntity[INDEX(PIPE_SCP)] = new ExynosCameraFrameEntity(PIPE_SCP, ENTITY_TYPE_OUTPUT_ONLY, ENTITY_BUFFER_FIXED); frame->addSiblingEntity(NULL, newEntity[INDEX(PIPE_SCP)]); requestEntityCount++; /* set GSC pipe to linkageList */ newEntity[INDEX(PIPE_GSC)] = new ExynosCameraFrameEntity(PIPE_GSC, ENTITY_TYPE_INPUT_OUTPUT, ENTITY_BUFFER_FIXED); frame->addSiblingEntity(NULL, newEntity[INDEX(PIPE_GSC)]); /* set GSC-Picture pipe to linkageList */ newEntity[INDEX(PIPE_GSC_PICTURE)] = new ExynosCameraFrameEntity(PIPE_GSC_PICTURE, ENTITY_TYPE_INPUT_OUTPUT, ENTITY_BUFFER_FIXED); frame->addSiblingEntity(NULL, newEntity[INDEX(PIPE_GSC_PICTURE)]); /* set GSC-Video pipe to linkageList */ newEntity[INDEX(PIPE_GSC_VIDEO)] = new ExynosCameraFrameEntity(PIPE_GSC_VIDEO, ENTITY_TYPE_INPUT_OUTPUT, ENTITY_BUFFER_FIXED); frame->addSiblingEntity(NULL, newEntity[INDEX(PIPE_GSC_VIDEO)]); /* set JPEG pipe to linkageList */ newEntity[INDEX(PIPE_JPEG)] = new ExynosCameraFrameEntity(PIPE_JPEG, ENTITY_TYPE_INPUT_OUTPUT, ENTITY_BUFFER_FIXED); frame->addSiblingEntity(NULL, newEntity[INDEX(PIPE_JPEG)]); ret = m_initPipelines(frame); if (ret < 0) { ALOGE("ERR(%s):m_initPipelines fail, ret(%d)", __FUNCTION__, ret); } m_fillNodeGroupInfo(frame); /* TODO: make it dynamic */ frame->setNumRequestPipe(requestEntityCount); m_frameCount++; return frame;}
开发者ID:TeamEOS,项目名称:hardware_samsung_slsi_exynos,代码行数:61,
示例15: read_scroll//.........这里部分代码省略......... msg("you hear a faint cry of anguish in the distance"); else { obj = new_item(); new_monster(obj, randmonster(FALSE), &mp); } when S_ID_POTION: case S_ID_SCROLL: case S_ID_WEAPON: case S_ID_ARMOR: case S_ID_R_OR_S: { static char id_type[S_ID_R_OR_S + 1] = { 0, 0, 0, 0, 0, POTION, SCROLL, WEAPON, ARMOR, R_OR_S }; /* * Identify, let him figure something out */ scr_info[obj->o_which].oi_know = TRUE; msg("this scroll is an %s scroll", scr_info[obj->o_which].oi_name); whatis(TRUE, id_type[obj->o_which]); } when S_MAP: /* * Scroll of magic mapping. */ scr_info[S_MAP].oi_know = TRUE; msg("oh, now this scroll has a map on it"); /* * take all the things we want to keep hidden out of the window */ for (y = 1; y < NUMLINES - 1; y++) for (x = 0; x < NUMCOLS; x++) { pp = INDEX(y, x); switch (ch = pp->p_ch) { case DOOR: case STAIRS: break; case '-': case '|': if (!(pp->p_flags & F_REAL)) { ch = pp->p_ch = DOOR; pp->p_flags |= F_REAL; } break; case ' ': if (pp->p_flags & F_REAL) goto def; pp->p_flags |= F_REAL; ch = pp->p_ch = PASSAGE; /* FALLTHROUGH */ case PASSAGE:pass: if (!(pp->p_flags & F_REAL)) pp->p_ch = PASSAGE; pp->p_flags |= (F_SEEN|F_REAL); ch = PASSAGE; break; case FLOOR: if (pp->p_flags & F_REAL)
开发者ID:ashaindlin,项目名称:rogue,代码行数:67,
示例16: ASSERTvoid LoopUnroller::unroll(otawa::CFG *cfg, BasicBlock *header, VirtualCFG *vcfg) { VectorQueue<BasicBlock*> workList; VectorQueue<BasicBlock*> loopList; VectorQueue<BasicBlock*> virtualCallList; genstruct::Vector<BasicBlock*> doneList; typedef genstruct::Vector<Pair<VirtualBasicBlock*, Edge::kind_t> > BackEdgePairVector; BackEdgePairVector backEdges; bool dont_unroll = false; BasicBlock *unrolled_from; int start; /* Avoid unrolling loops with LOOP_COUNT of 0, since it would create a LOOP_COUNT of -1 for the non-unrolled part of the loop*/ /* if (header && (ipet::LOOP_COUNT(header) == 0)) { dont_unroll = true; } */ //if (header) dont_unroll = true; start = dont_unroll ? 1 : 0; for (int i = start; ((i < 2) && header) || (i < 1); i++) { doneList.clear(); ASSERT(workList.isEmpty()); ASSERT(loopList.isEmpty()); ASSERT(doneList.isEmpty()); workList.put(header ? header : cfg->entry()); doneList.add(header ? header : cfg->entry()); genstruct::Vector<BasicBlock*> bbs; while (!workList.isEmpty()) { BasicBlock *current = workList.get(); if (LOOP_HEADER(current) && (current != header)) { /* we enter another loop */ loopList.put(current); /* add exit edges destinations to the worklist */ for (genstruct::Vector<Edge*>::Iterator exitedge(**EXIT_LIST(current)); exitedge; exitedge++) { if (!doneList.contains(exitedge->target())) { workList.put(exitedge->target()); doneList.add(exitedge->target()); } } } else { VirtualBasicBlock *new_bb = 0; if ((!current->isEntry()) && (!current->isExit())) { /* Duplicate the current basic block */ new_bb = new VirtualBasicBlock(current); new_bb->removeAllProp(&ENCLOSING_LOOP_HEADER); new_bb->removeAllProp(&EXIT_LIST); new_bb->removeAllProp(&REVERSE_DOM); new_bb->removeAllProp(&LOOP_EXIT_EDGE); new_bb->removeAllProp(&LOOP_HEADER); new_bb->removeAllProp(&ENTRY); /* Remember the call block so we can correct its destination when we have processed it */ if (VIRTUAL_RETURN_BLOCK(new_bb)) virtualCallList.put(new_bb); if ((current == header) && (!dont_unroll)) { if (i == 0) { unrolled_from = new_bb; } else { UNROLLED_FROM(new_bb) = unrolled_from; } } /* if (ipet::LOOP_COUNT(new_bb) != -1) { if (i == 0) { new_bb->removeAllProp(&ipet::LOOP_COUNT); } else { int old_count = ipet::LOOP_COUNT(new_bb); new_bb->removeAllProp(&ipet::LOOP_COUNT); ipet::LOOP_COUNT(new_bb) = old_count - (1 - start); ASSERT(ipet::LOOP_COUNT(new_bb) >= 0); } } */ INDEX(new_bb) = idx; idx++; vcfg->addBB(new_bb); bbs.add(current); map.put(current, new_bb); }//.........这里部分代码省略.........
开发者ID:alexjordan,项目名称:otawa,代码行数:101,
示例17: declare_primitive Stores OBJECT in the extra info entry of the Heathen Code Block/n/ Profile Buffer./n/ /n/ This is for mondo bizarro sampler frobnication purposes only./n/ /n/ Only officially designated moby wizards should even think of thinking of/n/ using this most ultra super duper secret primitive. FNORD!/ "); /*-------------------------------------------------------------------------*/ declare_primitive ("%PC-SAMPLE/SET-ZONE!", Prim_pc_sample_set_current_zone, 1, 1, "(index)/n/Set current pc-sampling zone to INDEX (a small exact integer), returning /the previous value if different, else #F if same."); declare_primitive ("%PC-SAMPLE/MAX-ZONE", Prim_pc_sample_get_max_zone, 0, 0, 0); declare_primitive ("%PC-SAMPLE/CLEAR-ZONES!", Prim_pc_sample_clear_zones, 0, 0, "()/nZero zone counts."); declare_primitive ("%PC-SAMPLE/READ-ZONES!", Prim_pc_sample_read_zones, 1, 1, "(flonum-vector)/n/Copy zone counts into FLONUM-VECTOR. Returns the number copied, which /is limited by either the number of zones to the capacity of FLONUM-VECTOR.");}
开发者ID:tali713,项目名称:mit-scheme,代码行数:31,
示例18: assertinline T& matrix<T>::operator() (int i, int j){ assert(i >= 0 && i < m_rows && j >= 0 && j < m_cols); return p[INDEX(i,j)];}
开发者ID:WhuAegeanSea,项目名称:IPOL_AC_RANSAC,代码行数:5,
示例19: ALOGIstatus_t ExynosCameraFrameFactoryFront::initPipes(void){ ALOGI("INFO(%s[%d])", __FUNCTION__, __LINE__); int ret = 0; camera_pipe_info_t pipeInfo[3]; ExynosRect tempRect; int maxSensorW = 0, maxSensorH = 0, hwSensorW = 0, hwSensorH = 0; int maxPreviewW = 0, maxPreviewH = 0, hwPreviewW = 0, hwPreviewH = 0; int maxPictureW = 0, maxPictureH = 0, hwPictureW = 0, hwPictureH = 0; int bayerFormat = V4L2_PIX_FMT_SBGGR12; int previewFormat = m_parameters->getHwPreviewFormat(); int pictureFormat = m_parameters->getPictureFormat(); m_parameters->getMaxSensorSize(&maxSensorW, &maxSensorH); m_parameters->getHwSensorSize(&hwSensorW, &hwSensorH); m_parameters->getMaxPreviewSize(&maxPreviewW, &maxPreviewH); m_parameters->getHwPreviewSize(&hwPreviewW, &hwPreviewH); m_parameters->getMaxPictureSize(&maxPictureW, &maxPictureH); m_parameters->getHwPictureSize(&hwPictureW, &hwPictureH); ALOGI("INFO(%s[%d]): MaxSensorSize(%dx%d), HwSensorSize(%dx%d)", __FUNCTION__, __LINE__, maxSensorW, maxSensorH, hwSensorW, hwSensorH); ALOGI("INFO(%s[%d]): MaxPreviewSize(%dx%d), HwPreviewSize(%dx%d)", __FUNCTION__, __LINE__, maxPreviewW, maxPreviewH, hwPreviewW, hwPreviewH); ALOGI("INFO(%s[%d]): MaxPixtureSize(%dx%d), HwPixtureSize(%dx%d)", __FUNCTION__, __LINE__, maxPictureW, maxPictureH, hwPictureW, hwPictureH); memset(pipeInfo, 0, (sizeof(camera_pipe_info_t) * 3)); /* FLITE pipe */ tempRect.fullW = maxSensorW + 16; tempRect.fullH = maxSensorH + 10; tempRect.colorFormat = bayerFormat; pipeInfo[0].rectInfo = tempRect; pipeInfo[0].bufInfo.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; pipeInfo[0].bufInfo.memory = V4L2_CAMERA_MEMORY_TYPE; pipeInfo[0].bufInfo.count = FRONT_NUM_BAYER_BUFFERS; /* per frame info */ pipeInfo[0].perFrameNodeGroupInfo.perframeSupportNodeNum = 0; pipeInfo[0].perFrameNodeGroupInfo.perFrameLeaderInfo.perFrameNodeType = PERFRAME_NODE_TYPE_NONE;#ifdef CAMERA_PACKED_BAYER_ENABLE /* packed bayer bytesPerPlane */ pipeInfo[0].bytesPerPlane[0] = ROUND_UP(pipeInfo[0].rectInfo.fullW, 10) * 8 / 5;#endif ret = m_pipes[INDEX(PIPE_FLITE_FRONT)]->setupPipe(pipeInfo); if (ret < 0) { ALOGE("ERR(%s[%d]):FLITE setupPipe fail, ret(%d)", __FUNCTION__, __LINE__, ret); /* TODO: exception handling */ return INVALID_OPERATION; } memset(pipeInfo, 0, (sizeof(camera_pipe_info_t) * 3)); /* ISP pipe */ tempRect.fullW = maxSensorW + 16; tempRect.fullH = maxSensorH + 10; tempRect.colorFormat = bayerFormat; pipeInfo[0].rectInfo = tempRect; pipeInfo[0].bufInfo.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; pipeInfo[0].bufInfo.memory = V4L2_CAMERA_MEMORY_TYPE; pipeInfo[0].bufInfo.count = FRONT_NUM_BAYER_BUFFERS; /* per frame info */ pipeInfo[0].perFrameNodeGroupInfo.perframeSupportNodeNum = 3; /* ISP, SCP */ pipeInfo[0].perFrameNodeGroupInfo.perFrameLeaderInfo.perFrameNodeType = PERFRAME_NODE_TYPE_LEADER; pipeInfo[0].perFrameNodeGroupInfo.perFrameLeaderInfo.perframeInfoIndex = PERFRAME_INFO_ISP; pipeInfo[0].perFrameNodeGroupInfo.perFrameLeaderInfo.perFrameVideoID = (FIMC_IS_VIDEO_ISP_NUM - FIMC_IS_VIDEO_SS0_NUM); pipeInfo[0].perFrameNodeGroupInfo.perFrameCaptureInfo[0].perFrameNodeType = PERFRAME_NODE_TYPE_CAPTURE; pipeInfo[0].perFrameNodeGroupInfo.perFrameCaptureInfo[0].perFrameVideoID = (FIMC_IS_VIDEO_SCC_NUM - FIMC_IS_VIDEO_SS0_NUM); pipeInfo[0].perFrameNodeGroupInfo.perFrameCaptureInfo[1].perFrameNodeType = PERFRAME_NODE_TYPE_CAPTURE; pipeInfo[0].perFrameNodeGroupInfo.perFrameCaptureInfo[1].perFrameVideoID = (FIMC_IS_VIDEO_SCP_NUM - FIMC_IS_VIDEO_SS0_NUM);#ifdef CAMERA_PACKED_BAYER_ENABLE /* packed bayer bytesPerPlane */ pipeInfo[0].bytesPerPlane[0] = ROUND_UP(pipeInfo[0].rectInfo.fullW, 10) * 8 / 5;#endif ret = m_pipes[INDEX(PIPE_ISP_FRONT)]->setupPipe(pipeInfo); if (ret < 0) { ALOGE("ERR(%s[%d]):ISP setupPipe fail, ret(%d)", __FUNCTION__, __LINE__, ret); /* TODO: exception handling */ return INVALID_OPERATION; } memset(pipeInfo, 0, (sizeof(camera_pipe_info_t) * 3)); /* SCC output pipe */ tempRect.fullW = hwPictureW; tempRect.fullH = hwPictureH; tempRect.colorFormat = pictureFormat; pipeInfo[0].rectInfo = tempRect; pipeInfo[0].bufInfo.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; pipeInfo[0].bufInfo.memory = V4L2_CAMERA_MEMORY_TYPE; pipeInfo[0].bufInfo.count = FRONT_NUM_PICTURE_BUFFERS; /* per frame info */ pipeInfo[0].perFrameNodeGroupInfo.perframeSupportNodeNum = 0; pipeInfo[0].perFrameNodeGroupInfo.perFrameLeaderInfo.perFrameNodeType = PERFRAME_NODE_TYPE_NONE;//.........这里部分代码省略.........
开发者ID:TeamEOS,项目名称:hardware_samsung_slsi_exynos,代码行数:101,
示例20: store_update/* * Add an update to the log. The update's kdb_entry_sno and kdb_time fields * must already be set. The layout of the update log looks like: * * header log -> [ update header -> xdr(kdb_incr_update_t) ], ... */static krb5_error_codestore_update(kdb_log_context *log_ctx, kdb_incr_update_t *upd){ XDR xdrs; kdb_ent_header_t *indx_log; unsigned int i, recsize; unsigned long upd_size; krb5_error_code retval; kdb_hlog_t *ulog = log_ctx->ulog; uint32_t ulogentries = log_ctx->ulogentries; upd_size = xdr_sizeof((xdrproc_t)xdr_kdb_incr_update_t, upd); recsize = sizeof(kdb_ent_header_t) + upd_size; if (recsize > ulog->kdb_block) { retval = resize(ulog, ulogentries, log_ctx->ulogfd, recsize); if (retval) return retval; } ulog->kdb_state = KDB_UNSTABLE; i = (upd->kdb_entry_sno - 1) % ulogentries; indx_log = INDEX(ulog, i); memset(indx_log, 0, ulog->kdb_block); indx_log->kdb_umagic = KDB_ULOG_MAGIC; indx_log->kdb_entry_size = upd_size; indx_log->kdb_entry_sno = upd->kdb_entry_sno; indx_log->kdb_time = upd->kdb_time; indx_log->kdb_commit = FALSE; xdrmem_create(&xdrs, (char *)indx_log->entry_data, indx_log->kdb_entry_size, XDR_ENCODE); if (!xdr_kdb_incr_update_t(&xdrs, upd)) return KRB5_LOG_CONV; indx_log->kdb_commit = TRUE; retval = sync_update(ulog, indx_log); if (retval) return retval; /* Modify the ulog header to reflect the new update. */ ulog->kdb_last_sno = upd->kdb_entry_sno; ulog->kdb_last_time = upd->kdb_time; if (ulog->kdb_num == 0) { ulog->kdb_num = 1; ulog->kdb_first_sno = upd->kdb_entry_sno; ulog->kdb_first_time = upd->kdb_time; } else if (ulog->kdb_num < ulogentries) { ulog->kdb_num++; } else { /* We are circling; set kdb_first_sno and time to the next update. */ i = upd->kdb_entry_sno % ulogentries; indx_log = INDEX(ulog, i); ulog->kdb_first_sno = indx_log->kdb_entry_sno; ulog->kdb_first_time = indx_log->kdb_time; } ulog->kdb_state = KDB_STABLE; sync_header(ulog); return 0;}
开发者ID:DirectXMan12,项目名称:krb5,代码行数:70,
示例21: ALOGEstatus_t ExynosCameraFrameFactoryFront::stopPipes(void){ int ret = 0; ret = m_pipes[INDEX(PIPE_SCC_FRONT)]->stopThread(); if (ret < 0) { ALOGE("ERR(%s[%d]):SCC stopThread fail, ret(%d)", __FUNCTION__, __LINE__, ret); /* TODO: exception handling */ return INVALID_OPERATION; } ret = m_pipes[INDEX(PIPE_SCP_FRONT)]->stopThread(); if (ret < 0) { ALOGE("ERR(%s[%d]):SCP stopThread fail, ret(%d)", __FUNCTION__, __LINE__, ret); /* TODO: exception handling */ return INVALID_OPERATION; } /* stream off for ISP */ ret = m_pipes[INDEX(PIPE_ISP_FRONT)]->stopThread(); if (ret < 0) { ALOGE("ERR(%s[%d]):ISP stopThread fail, ret(%d)", __FUNCTION__, __LINE__, ret); /* TODO: exception handling */ return INVALID_OPERATION; } ret = m_pipes[INDEX(PIPE_FLITE_FRONT)]->sensorStream(false); if (ret < 0) { ALOGE("ERR(%s[%d]):FLITE sensorStream fail, ret(%d)", __FUNCTION__, __LINE__, ret); /* TODO: exception handling */ return INVALID_OPERATION; } ret = m_pipes[INDEX(PIPE_ISP_FRONT)]->setControl(V4L2_CID_IS_FORCE_DONE, 0x1000); if (ret < 0) { ALOGE("ERR(%s[%d]):ISP setControl fail, ret(%d)", __FUNCTION__, __LINE__, ret); /* TODO: exception handling */ return INVALID_OPERATION; } ret = m_pipes[INDEX(PIPE_FLITE_FRONT)]->stop(); if (ret < 0) { ALOGE("ERR(%s[%d]):FLITE stop fail, ret(%d)", __FUNCTION__, __LINE__, ret); /* TODO: exception handling */ return INVALID_OPERATION; } /* stream off for ISP */ ret = m_pipes[INDEX(PIPE_ISP_FRONT)]->stop(); if (ret < 0) { ALOGE("ERR(%s[%d]):ISP stop fail, ret(%d)", __FUNCTION__, __LINE__, ret); /* TODO: exception handling */ return INVALID_OPERATION; } ret = m_pipes[INDEX(PIPE_SCC_FRONT)]->stop(); if (ret < 0) { ALOGE("ERR(%s[%d]):SCC stop fail, ret(%d)", __FUNCTION__, __LINE__, ret); /* TODO: exception handling */ return INVALID_OPERATION; } ret = m_pipes[INDEX(PIPE_SCP_FRONT)]->stop(); if (ret < 0) { ALOGE("ERR(%s[%d]):SCP stop fail, ret(%d)", __FUNCTION__, __LINE__, ret); /* TODO: exception handling */ return INVALID_OPERATION; } ALOGI("INFO(%s[%d]):Stopping Front [FLITE>3AA>ISP>SCC>SCP] Success!", __FUNCTION__, __LINE__); return NO_ERROR;}
开发者ID:TeamEOS,项目名称:hardware_samsung_slsi_exynos,代码行数:75,
示例22: mexFunction//.........这里部分代码省略......... I = (uint16_T*)mxGetPr(prhs[3]); if((MAX(mxGetM(prhs[3]),mxGetN(prhs[3])) != dim) || (MIN(mxGetM(prhs[3]),mxGetN(prhs[3])) != 1)) mexErrMsgTxt("Vector I is of wrong size."); /* vector x0 */ x0 = mxGetPr(prhs[4]); if((MAX(mxGetM(prhs[4]),mxGetN(prhs[4])) != dim) || (MIN(mxGetM(prhs[4]),mxGetN(prhs[4])) != 1)) mexErrMsgTxt("Vector x0 is of wrong size."); /* maximal allowed number of iterations */ tmax = mxIsInf( mxGetScalar(prhs[5])) ? INT_MAX : (long)mxGetScalar(prhs[5]); /* abs. precision defining stopping cond*/ tolabs = mxGetScalar(prhs[6]); /* rel. precision defining stopping cond*/ tolrel = mxGetScalar(prhs[7]); /* verbosity parameter */ verb = (int)mxGetScalar(prhs[8]); /* verbosity on/off */ /* print input setting if required */ if( verb > 0 ) { mexPrintf("Settings of QP solver:/n"); mexPrintf("tmax : %d/n", tmax ); mexPrintf("tolabs : %f/n", tolabs ); mexPrintf("tolrel : %f/n", tolrel ); mexPrintf("dim : %d/n", dim ); mexPrintf("b : %f/n", b ); mexPrintf("verb : %d/n", verb ); } /*------------------------------------------------------------------- Inicialization ------------------------------------------------------------------- */ /* solution vector x [dim x 1] */ plhs[0] = mxCreateDoubleMatrix(dim,1,mxREAL); x = mxGetPr(plhs[0]); for(i=0; i < dim; i++ ) { x[i] = x0[i]; } /* make diagonal of the Hessian matrix */ diag_H = mxCalloc(dim, sizeof(double)); if( diag_H == NULL ) mexErrMsgTxt("Not enough memory."); /* to replace with memcpy(void *dest, const void *src, size_t n); */ for(i = 0; i < dim; i++ ) { diag_H[i] = matrix_H[dim*i+i]; } /* counter of access to matrix H */ access = dim; /*------------------------------------------------------------------- Call the QP solver. -------------------------------------------------------------------*//* exitflag = qpssvm_solver( &get_col, diag_H, f, b, I, x, dim, tmax, tolabs, tolrel, &t, &History, verb ); */ exitflag = qpssvm_imdm( &get_col, diag_H, f, b, I, x, dim, tmax, tolabs, tolrel, &t, &History, verb ); /*------------------------------------------------------------------- Set up output arguments [x,exitflag,t,access,History] = qpssvm_mex(...) ------------------------------------------------------------------- */ /* exitflag [1x1] */ plhs[1] = mxCreateDoubleMatrix(1,1,mxREAL); *(mxGetPr(plhs[1])) = (double)exitflag; /* t [1x1] */ plhs[2] = mxCreateDoubleMatrix(1,1,mxREAL); *(mxGetPr(plhs[2])) = (double)t; /* access [1x1] */ plhs[3] = mxCreateDoubleMatrix(1,1,mxREAL); *(mxGetPr(plhs[3])) = (double)access; /* History [2 x (t+1)] */ plhs[4] = mxCreateDoubleMatrix(2,t+1,mxREAL); tmp_ptr = mxGetPr( plhs[4] ); for( i = 0; i <= t; i++ ) { tmp_ptr[INDEX(0,i,2)] = History[INDEX(0,i,2)]; tmp_ptr[INDEX(1,i,2)] = History[INDEX(1,i,2)]; } /*------------------------------------------------------------------- Free used memory ------------------------------------------------------------------- */ mxFree( History ); mxFree( diag_H ); return;}
开发者ID:lambday,项目名称:svc,代码行数:101,
示例23: ROUND_UP /* per frame info */ pipeInfo[0].perFrameNodeGroupInfo.perframeSupportNodeNum = 3; /* ISP, SCP */ pipeInfo[0].perFrameNodeGroupInfo.perFrameLeaderInfo.perFrameNodeType = PERFRAME_NODE_TYPE_LEADER; pipeInfo[0].perFrameNodeGroupInfo.perFrameLeaderInfo.perframeInfoIndex = PERFRAME_INFO_ISP; pipeInfo[0].perFrameNodeGroupInfo.perFrameLeaderInfo.perFrameVideoID = (FIMC_IS_VIDEO_ISP_NUM - FIMC_IS_VIDEO_SS0_NUM); pipeInfo[0].perFrameNodeGroupInfo.perFrameCaptureInfo[0].perFrameNodeType = PERFRAME_NODE_TYPE_CAPTURE; pipeInfo[0].perFrameNodeGroupInfo.perFrameCaptureInfo[0].perFrameVideoID = (FIMC_IS_VIDEO_SCC_NUM - FIMC_IS_VIDEO_SS0_NUM); pipeInfo[0].perFrameNodeGroupInfo.perFrameCaptureInfo[1].perFrameNodeType = PERFRAME_NODE_TYPE_CAPTURE; pipeInfo[0].perFrameNodeGroupInfo.perFrameCaptureInfo[1].perFrameVideoID = (FIMC_IS_VIDEO_SCP_NUM - FIMC_IS_VIDEO_SS0_NUM);#ifdef CAMERA_PACKED_BAYER_ENABLE /* packed bayer bytesPerPlane */ pipeInfo[0].bytesPerPlane[0] = ROUND_UP(pipeInfo[0].rectInfo.fullW, 10) * 8 / 5;#endif ret = m_pipes[INDEX(PIPE_ISP)]->setupPipe(pipeInfo); if (ret < 0) { ALOGE("ERR(%s[%d]): ISP setupPipe fail, ret(%d)", __FUNCTION__, __LINE__, ret); /* TODO: exception handling */ return INVALID_OPERATION; } memset(pipeInfo, 0, (sizeof(camera_pipe_info_t) * 3)); /* SCC output pipe */#ifdef FIXED_SENSOR_SIZE tempRect.fullW = maxSensorW; tempRect.fullH = maxSensorH;#else tempRect.fullW = hwSensorW; tempRect.fullH = hwSensorH;
开发者ID:TeamEOS,项目名称:hardware_samsung_slsi_exynos,代码行数:31,
示例24: ulog_get_entries/* Get the last set of updates seen, (last+1) to n is returned. */krb5_error_codeulog_get_entries(krb5_context context, kdb_last_t last, kdb_incr_result_t *ulog_handle){ XDR xdrs; kdb_ent_header_t *indx_log; kdb_incr_update_t *upd; unsigned int indx, count; uint32_t sno; krb5_error_code retval; kdb_log_context *log_ctx; kdb_hlog_t *ulog = NULL; uint32_t ulogentries; INIT_ULOG(context); ulogentries = log_ctx->ulogentries; retval = ulog_lock(context, KRB5_LOCKMODE_SHARED); if (retval) return retval; /* Check to make sure we don't have a corrupt ulog first. */ if (ulog->kdb_state == KDB_CORRUPT) { ulog_handle->ret = UPDATE_ERROR; (void)ulog_lock(context, KRB5_LOCKMODE_UNLOCK); return KRB5_LOG_CORRUPT; } /* * We need to lock out other processes here, such as kadmin.local, since we * are looking at the last_sno and looking up updates. So we can share * with other readers. */ retval = krb5_db_lock(context, KRB5_LOCKMODE_SHARED); if (retval) { (void)ulog_lock(context, KRB5_LOCKMODE_UNLOCK); return retval; } /* If we have the same sno and timestamp, return a nil update. If a * different timestamp, the sno was reused and we need a full resync. */ if (last.last_sno == ulog->kdb_last_sno) { ulog_handle->ret = time_equal(&last.last_time, &ulog->kdb_last_time) ? UPDATE_NIL : UPDATE_FULL_RESYNC_NEEDED; goto cleanup; } /* We may have overflowed the update log or shrunk the log, or the client * may have created its ulog. */ if (last.last_sno > ulog->kdb_last_sno || last.last_sno < ulog->kdb_first_sno) { ulog_handle->lastentry.last_sno = ulog->kdb_last_sno; ulog_handle->ret = UPDATE_FULL_RESYNC_NEEDED; goto cleanup; } sno = last.last_sno; indx = (sno - 1) % ulogentries; indx_log = (kdb_ent_header_t *)INDEX(ulog, indx); if (!time_equal(&indx_log->kdb_time, &last.last_time)) { /* We have time stamp mismatch or we no longer have the slave's last * sno, so we brute force it. */ ulog_handle->ret = UPDATE_FULL_RESYNC_NEEDED; goto cleanup; } count = ulog->kdb_last_sno - sno; upd = calloc(count, sizeof(kdb_incr_update_t)); if (upd == NULL) { ulog_handle->ret = UPDATE_ERROR; retval = ENOMEM; goto cleanup; } ulog_handle->updates.kdb_ulog_t_val = upd; for (; sno < ulog->kdb_last_sno; sno++) { indx = sno % ulogentries; indx_log = (kdb_ent_header_t *)INDEX(ulog, indx); memset(upd, 0, sizeof(kdb_incr_update_t)); xdrmem_create(&xdrs, (char *)indx_log->entry_data, indx_log->kdb_entry_size, XDR_DECODE); if (!xdr_kdb_incr_update_t(&xdrs, upd)) { ulog_handle->ret = UPDATE_ERROR; retval = KRB5_LOG_CONV; goto cleanup; } /* Mark commitment since we didn't want to decode and encode the incr * update record the first time. */ upd->kdb_commit = indx_log->kdb_commit; upd++; } ulog_handle->updates.kdb_ulog_t_len = count; ulog_handle->lastentry.last_sno = ulog->kdb_last_sno; ulog_handle->lastentry.last_time.seconds = ulog->kdb_last_time.seconds;//.........这里部分代码省略.........
开发者ID:Kendra123,项目名称:krb5,代码行数:101,
注:本文中的INDEX函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ INDEXK函数代码示例 C++ INC_STATS函数代码示例 |