这篇教程C++ B函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中B函数的典型用法代码示例。如果您正苦于以下问题:C++ B函数的具体用法?C++ B怎么用?C++ B使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了B函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: f // Don't crash here. void f() { X x = X(); (void)noexcept(B(declval<B>())); }
开发者ID:wdu,项目名称:clang,代码行数:5,
示例2: Generatebool Field::initializeBuffers(ID3D11Device* device){ Dictionnary* dico; VertexType* vertices; Buffers* buffer; unsigned long* indices; int index; int vertexCount; int indexCount; float fMax = fSpacing * (unSize/2); float fMin = -fMax; float fDiff; bool filled; filled = true; fDiff = fMax - fMin; Generate(); vertexCount = (unSize-1) * (unSize-1) * 20; indexCount = vertexCount; if ((dico = Dictionnary::getInstance()) == nullptr) return false; vertices = new VertexType[vertexCount]; if (vertices == false) return (false); indices = new unsigned long[indexCount]; if (indices == false) { delete []vertices; return (false); } buffer = new Buffers(); if (buffer == nullptr) { delete []vertices; delete []indices; return (false); } index = 0; DirectX::XMVECTOR vec1; DirectX::XMVECTOR vec2; DirectX::XMVECTOR normal; for(unsigned int i = 0; i < (unSize - 1); i++) { float fZ = fMin + i * fSpacing; for(unsigned int j = 0; j < (unSize - 1); j++) { float fX = fMin + j * fSpacing; if(filled) { DirectX::XMFLOAT3 A(fX, vectPoints[i][j], fZ); DirectX::XMFLOAT3 B(fX, vectPoints[i + 1][j], fZ + fSpacing); DirectX::XMFLOAT3 C(fX + fSpacing, vectPoints[i + 1][j + 1], fZ + fSpacing); DirectX::XMFLOAT3 D(fX + fSpacing, vectPoints[i][j + 1], fZ); vec1 = DirectX::XMLoadFloat3(&DirectX::XMFLOAT3(B.x - A.x, B.y - A.y, B.z - A.z)); vec2 = DirectX::XMLoadFloat3(&DirectX::XMFLOAT3(C.x - A.x, C.y - A.y, C.z - A.z)); normal = DirectX::XMVector3Cross(vec1, vec2); setVertices(fX, vectPoints[i][j], fZ, i, j, vertices, indices, &index, normal, (fX + fMax) / fMax * 2, (fZ + fMax) / fMax * 2); setVertices(fX, vectPoints[i + 1][j], fZ + fSpacing, i, j, vertices, indices, &index, normal, (fX + fMax) / fMax * 2, (fZ + fSpacing + fMax) / fMax * 2); setVertices(fX + fSpacing, vectPoints[i + 1][j + 1], fZ + fSpacing, i, j, vertices, indices, &index, normal, (fX + fSpacing + fMax) / fMax * 2, (fZ + fSpacing + fMax) / fMax * 2); /*vec1 = DirectX::XMLoadFloat3(&DirectX::XMFLOAT3(C.x - B.x, C.y - B.y, C.z - B.z)); vec2 = DirectX::XMLoadFloat3(&DirectX::XMFLOAT3(D.x - B.x, D.y - B.y, D.z - B.z)); normal = DirectX::XMVector3Cross(vec1, vec2); setVertices(fX, vectPoints[i + 1][j], fZ + fSpacing, i, j, vertices, indices, &index, normal, (fX + fMax) / fMax * 2, (fZ + fSpacing + fMax) / fMax * 2); setVertices(fX + fSpacing, vectPoints[i + 1][j + 1], fZ + fSpacing, i, j, vertices, indices, &index, normal, (fX + fSpacing + fMax) / fMax * 2, (fZ + fSpacing + fMax) / fMax * 2); setVertices(fX + fSpacing, vectPoints[i][j + 1], fZ, i, j, vertices, indices, &index, normal, (fX + fSpacing + fMax) / fMax * 2, (fZ + fMax) / fMax * 2);*/ vec1 = DirectX::XMLoadFloat3(&DirectX::XMFLOAT3(D.x - C.x, D.y - C.y, D.z - C.z)); vec2 = DirectX::XMLoadFloat3(&DirectX::XMFLOAT3(A.x - C.x, A.y - C.y, A.z - C.z)); normal = DirectX::XMVector3Cross(vec1, vec2); setVertices(fX + fSpacing, vectPoints[i + 1][j + 1], fZ + fSpacing, i, j, vertices, indices, &index, normal, (fX + fSpacing + fMax) / fMax * 2, (fZ +fSpacing + fMax) / fMax * 2); setVertices(fX + fSpacing, vectPoints[i][j + 1], fZ, i, j, vertices, indices, &index, normal, (fX + fSpacing + fMax) / fMax * 2, (fZ + fMax) / fMax * 2); setVertices(fX, vectPoints[i][j], fZ, i, j, vertices, indices, &index, normal, (fX + fMax) / fMax * 2, (fZ + fMax) / fMax * 2); /*vec1 = DirectX::XMLoadFloat3(&DirectX::XMFLOAT3(A.x - D.x, A.y - D.y, A.z - D.z)); vec2 = DirectX::XMLoadFloat3(&DirectX::XMFLOAT3(B.x - D.x, B.y - D.y, B.z - D.z)); normal = DirectX::XMVector3Cross(vec1, vec2); setVertices(fX + fSpacing, vectPoints[i][j + 1], fZ, i, j, vertices, indices, &index, normal, (fX + fSpacing + fMax) / fMax * 2, (fZ + fMax) / fMax * 2); setVertices(fX, vectPoints[i][j], fZ, i, j, vertices, indices, &index, normal, (fX + fMax) / fMax * 2, (fZ + fMax) / fMax * 2); setVertices(fX, vectPoints[i + 1][j], fZ + fSpacing, i, j, vertices, indices, &index, normal, (fX + fMax) / fMax * 2, (fZ + fSpacing + fMax) / fMax * 2); */ /*setVertices(fX, vectPoints[i + 1][j], fZ + fSpacing, i, j, vertices, indices, &index); setVertices(fX, vectPoints[i + 1][j], fZ + fSpacing, i, j, vertices, indices, &index); setVertices(fX, vectPoints[i][j + 1], fZ, i, j, vertices, indices, &index); setVertices(fX, vectPoints[i + 1][j], fZ + fSpacing, i, j, vertices, indices, &index);*/ }//.........这里部分代码省略.........
开发者ID:SimoHayha,项目名称:LevelEditor,代码行数:101,
示例3: MPI_Comm_sizeint ParpackSolver::Solve(int nev) { /* Get MPI info */ int nprocs, me; MPI_Comm_size(MPI_COMM_WORLD, &nprocs); MPI_Comm_rank(MPI_COMM_WORLD, &me); MPI_Fint fcomm = MPI_Comm_c2f(MPI_COMM_WORLD); /* Select number of working Ritz vectors */ if(ncv == -1) ncv = 2*nev; ncv = std::min(ncv, n-1); /* Initialize matrix descriptors */ xdesc = pcontext->new_descriptor(n, 1, divup(n,nprocs), 1); Bdesc = pcontext->new_descriptor(n, ncv, divup(n,nprocs), ncv); assert(nloc == Bdesc->num_local_rows() && nloc == xdesc->num_local_rows()); assert(ncv == Bdesc->num_local_cols() && 1 == xdesc->num_local_cols()); /* Allocate local memory for eigenvector matrix $B$ */ Bvalues = (real*) opsec_malloc(Bdesc->local_size() * sizeof(real)); real sigma; int iparam[11], ipntr[11]; /* Set PARPACK parameters */ char bmat[] = "I"; char which[] = "LA"; char howmny[] = "All"; iparam[0] = 1; // ishfts iparam[2] = maxitr; // maxitr iparam[6] = 1; // mode /* Allocate working memory */ int lworkl = ncv*(ncv + 8); real* workl = (real*) opsec_calloc(lworkl, sizeof(real)); real* workd = (real*) opsec_calloc(3*nloc, sizeof(real)); real* resid = (real*) opsec_calloc(nloc, sizeof(real)); int* select = (int*) opsec_calloc(ncv, sizeof(int)); /* Begin reverse communication loop */ int itr = 0; int info = 0; int ido = 0; while(ido != 99) { parpack_psaupd(&fcomm, &ido, bmat, &nloc, which, &nev, &tol, resid, &ncv, Bvalues, &nloc, iparam, ipntr, workd, workl, &lworkl, &info); if(ido == 1 || ido == -1) { /* Compute y = A*x (don't forget Fortran indexing conventions!) */ slp::Matrix<real> A(Adesc, Avalues); slp::Matrix<real> x(xdesc, &workd[ipntr[0] - 1]); slp::Matrix<real> y(xdesc, &workd[ipntr[1] - 1]); slp::multiply(A, x, y); } } if(me == 0) { opsec_info("Number of Implicit Arnoldi update iterations taken is %d/n", iparam[2]); opsec_info(" info = %d/n", info); opsec_info(" nconv = %d, nev = %d/n", iparam[4], nev); time_t t = time(NULL); opsec_info("Time: %s/n", ctime(&t)); opsec_info("Post-processing Ritz values and vectors/n"); } /* Check return code */ if(info < 0) { /* Error encountered. Abort. */ if(me == 0) opsec_error("parpack_psaupd returned error: info = %d/n", info); return info; } else { /* Save number of successfully computed eigenvalues */ nconv = iparam[4]; evals.resize(nconv); /* Retrieve eigenvalues and eigenvectors */ int rvec = 1; int ierr; parpack_pseupd(&fcomm, &rvec, howmny, select, &evals[0], Bvalues, &nloc, &sigma, bmat, &nloc, which, &nev, &tol, resid, &ncv, Bvalues, &nloc, iparam, ipntr, workd, workl, &lworkl, &ierr); if(ierr != 0) { if(me == 0) opsec_error("parpack_pseupd returned error: ierr = %d/n", ierr); } } if(me == 0) { time_t t = time(NULL); opsec_info("Time: %s/n", ctime(&t)); }#if 0 { int i;//.........这里部分代码省略.........
开发者ID:jwgcarlson,项目名称:OPSEC,代码行数:101,
示例4: GetGeometry void TotalLagrangian::CalculateAll( MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, ProcessInfo& rCurrentProcessInfo, bool CalculateStiffnessMatrixFlag, bool CalculateResidualVectorFlag ) { KRATOS_TRY const unsigned int number_of_nodes = GetGeometry().size(); const unsigned int dim = GetGeometry().WorkingSpaceDimension(); unsigned int StrainSize; if ( dim == 2 ) StrainSize = 3; else StrainSize = 6; Matrix B( StrainSize, number_of_nodes * dim ); Matrix F( dim, dim ); Matrix D( StrainSize, StrainSize ); Matrix C( dim, dim ); Vector StrainVector( StrainSize ); Vector StressVector( StrainSize ); Matrix DN_DX( number_of_nodes, dim ); //resizing as needed the LHS unsigned int MatSize = number_of_nodes * dim; if ( CalculateStiffnessMatrixFlag == true ) //calculation of the matrix is required { if ( rLeftHandSideMatrix.size1() != MatSize ) rLeftHandSideMatrix.resize( MatSize, MatSize, false ); noalias( rLeftHandSideMatrix ) = ZeroMatrix( MatSize, MatSize ); //resetting LHS } //resizing as needed the RHS if ( CalculateResidualVectorFlag == true ) //calculation of the matrix is required { if ( rRightHandSideVector.size() != MatSize ) rRightHandSideVector.resize( MatSize, false ); rRightHandSideVector = ZeroVector( MatSize ); //resetting RHS } //reading integration points and local gradients const GeometryType::IntegrationPointsArrayType& integration_points = GetGeometry().IntegrationPoints( mThisIntegrationMethod ); const GeometryType::ShapeFunctionsGradientsType& DN_De = GetGeometry().ShapeFunctionsLocalGradients( mThisIntegrationMethod ); const Matrix& Ncontainer = GetGeometry().ShapeFunctionsValues( mThisIntegrationMethod ); //calculating actual jacobian GeometryType::JacobiansType J; GetGeometry().Jacobian( J ); //KRATOS_WATCH(J) //auxiliary terms Vector BodyForce; for ( unsigned int PointNumber = 0; PointNumber < integration_points.size(); PointNumber++ ) { //Calculating the cartesian derivatives (it is avoided storing them to minimize storage) noalias( DN_DX ) = prod( DN_De[PointNumber], mInvJ0[PointNumber] ); //deformation gradient noalias( F ) = prod( J[PointNumber], mInvJ0[PointNumber] ); //strain calculation noalias( C ) = prod( trans( F ), F ); CalculateStrain( C, StrainVector ); Comprobate_State_Vector( StrainVector ); mConstitutiveLawVector[PointNumber]->CalculateMaterialResponse( StrainVector, F, StressVector, D, rCurrentProcessInfo, GetProperties(), GetGeometry(), row( Ncontainer, PointNumber ),//.........这里部分代码省略.........
开发者ID:KratosCSIC,项目名称:trunk,代码行数:101,
示例5: panel_eid_fixupstatic void panel_eid_fixup(uint16_t *mfr_name, uint16_t *product_code){ B("%s: enter./n", __func__); *mfr_name = 0x0101; *product_code = 0x0;}
开发者ID:eoghan2t9,项目名称:Wildfire_S_3.0_Kernel,代码行数:6,
示例6: Astruct A;struct B{ operator A();};struct A{ A(A const&){}};A a{B()};
开发者ID:CCJY,项目名称:coliru,代码行数:13,
示例7: inv/** Purpose ------- CHEGST reduces a complex Hermitian-definite generalized eigenproblem to standard form. If ITYPE = 1, the problem is A*x = lambda*B*x, and A is overwritten by inv(U**H)*A*inv(U) or inv(L)*A*inv(L**H) If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or B*A*x = lambda*x, and A is overwritten by U*A*U**H or L**H*A*L. B must have been previously factorized as U**H*U or L*L**H by CPOTRF. Arguments --------- @param[in] itype INTEGER = 1: compute inv(U**H)*A*inv(U) or inv(L)*A*inv(L**H); = 2 or 3: compute U*A*U**H or L**H*A*L. @param[in] uplo magma_uplo_t - = MagmaUpper: Upper triangle of A is stored and B is factored as U**H*U; - = MagmaLower: Lower triangle of A is stored and B is factored as L*L**H. @param[in] n INTEGER The order of the matrices A and B. N >= 0. @param[in,out] A COMPLEX array, dimension (LDA,N) On entry, the Hermitian matrix A. If UPLO = MagmaUpper, the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = MagmaLower, the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. /n On exit, if INFO = 0, the transformed matrix, stored in the same format as A. @param[in] lda INTEGER The leading dimension of the array A. LDA >= max(1,N). @param[in] B COMPLEX array, dimension (LDB,N) The triangular factor from the Cholesky factorization of B, as returned by CPOTRF. @param[in] ldb INTEGER The leading dimension of the array B. LDB >= max(1,N). @param[out] info INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value @ingroup magma_cheev_comp ********************************************************************/extern "C" magma_int_tmagma_chegst( magma_int_t itype, magma_uplo_t uplo, magma_int_t n, magmaFloatComplex *A, magma_int_t lda, magmaFloatComplex *B, magma_int_t ldb, magma_int_t *info){#define A(i, j) (A + (j)*lda + (i))#define B(i, j) (B + (j)*ldb + (i))#define dA(i, j) (dw + (j)*ldda + (i))#define dB(i, j) (dw + n*ldda + (j)*lddb + (i)) const char* uplo_ = lapack_uplo_const( uplo ); magma_int_t nb; magma_int_t k, kb, kb2; magmaFloatComplex c_one = MAGMA_C_ONE; magmaFloatComplex c_neg_one = MAGMA_C_NEG_ONE; magmaFloatComplex c_half = MAGMA_C_HALF; magmaFloatComplex c_neg_half = MAGMA_C_NEG_HALF; magmaFloatComplex *dw; magma_int_t ldda = n; magma_int_t lddb = n; float d_one = 1.0; int upper = (uplo == MagmaUpper); /* Test the input parameters. */ *info = 0; if (itype < 1 || itype > 3) { *info = -1; } else if (! upper && uplo != MagmaLower) { *info = -2; } else if (n < 0) { *info = -3; } else if (lda < max(1,n)) { *info = -5; } else if (ldb < max(1,n)) {//.........这里部分代码省略.........
开发者ID:cjy7117,项目名称:FT-MAGMA,代码行数:101,
示例8: Int_MPIData#include "../konoha_mpi.h"/* ------------------------------------------------------------------------ *//* TYPEMAP */TYPEMAP Int_MPIData(CTX ctx, ksfp_t *sfp _RIX){ MPID(data, new_O(MPIData, knh_getcid(ctx, B("konoha.mpi.MPIData")))); MPID_INIT(data, new_Int(ctx, sfp[1].ivalue), MPI_LONG, CLASS_Int, O_cid(sfp[1].o)); RETURN_(data);}TYPEMAP int___MPIData(CTX ctx, ksfp_t *sfp _RIX){ MPID(data, new_O(MPIData, knh_getcid(ctx, B("konoha.mpi.MPIData")))); MPID_INIT(data, sfp[1].a, MPI_LONG, CLASS_Array, O_cid(sfp[1].o)); RETURN_(data);}TYPEMAP Float_MPIData(CTX ctx, ksfp_t *sfp _RIX){ MPID(data, new_O(MPIData, knh_getcid(ctx, B("konoha.mpi.MPIData")))); MPID_INIT(data, new_Float_(ctx, CLASS_Float, sfp[1].fvalue), MPI_DOUBLE, CLASS_Float, O_cid(sfp[1].o)); RETURN_(data);}TYPEMAP float___MPIData(CTX ctx, ksfp_t *sfp _RIX){ MPID(data, new_O(MPIData, knh_getcid(ctx, B("konoha.mpi.MPIData")))); MPID_INIT(data, sfp[1].a, MPI_DOUBLE, CLASS_Array, O_cid(sfp[1].o)); RETURN_(data);
开发者ID:imasahiro,项目名称:konohascript,代码行数:31,
示例9: Aint A(int x){ int arr[5]; return B(arr[4]);}
开发者ID:nickchow0,项目名称:cs107e.github.io,代码行数:5,
示例10: mainint main(int argc, char *argv[]){ int my_ID, myrow, mycol, /* my index and row and column index */ root=0, /* ID of root rank */ Num_procs, /* number of ranks */ nprow, npcol, /* row, column dimensions of rank grid */ order, /* matrix order */ mynrows, myfrow, /* my number of rows and index of first row*/ mylrow, /* and last row */ /*myncols,*/ myfcol,/* my number of cols and index of first row*/ mylcol, /* and last row */ *mm, /* arrays that hold m_i's and n_j's */ *nn, /*nb,*/ /* block factor for SUMMA */ inner_block_flag, /* flag to select local DGEMM blocking */ error=0, /* error flag */ *ranks, /* work array for row and column ranks */ /*lda, ldb, ldc,*/ /* leading array dimensions of a, b, and c */ iter, iterations; long lda, ldb, ldc, nb, myncols; /* make long to avoid integer overflow */ double RESTRICT *a, *b, *c, /* arrays that hold local a, b, c */ *work1, *work2, /* work arrays to pass to dpmmmult */ local_dgemm_time, /* timing parameters */ dgemm_time, avgtime; double forder, nflops, /* float matrix order + total flops */ checksum, /* array checksum for verification test */ checksum_local=0.0, ref_checksum; /* reference checkcum for verification */ MPI_Group world_group, temp_group; MPI_Comm comm_row, /* communicators for row and column ranks */ comm_col; /* of rank grid */ int shortcut; /* true if only doing initialization */ /* initialize */ MPI_Init(&argc,&argv); MPI_Comm_rank( MPI_COMM_WORLD, &my_ID ); MPI_Comm_size( MPI_COMM_WORLD, &Num_procs );/*********************************************************************** process, test and broadcast input parameters*********************************************************************/ if (my_ID == root) { printf("Parallel Research Kernels version %s/n", PRKVERSION); printf("MPI Dense matrix-matrix multiplication: C = A x B/n"); if (argc != 5) { printf("Usage: %s <# iterations> <matrix order> <outer block size> ", *argv); printf("<local block flag (non-zero=yes, zero=no)>/n"); error = 1; goto ENDOFTESTS; } iterations = atoi(*++argv); if(iterations < 1){ printf("ERROR: iterations must be positive: %d /n",iterations); error = 1; goto ENDOFTESTS; } order = atoi(*++argv); if (order < 0) { shortcut = 1; order = -order; } else shortcut = 0; if (order < Num_procs) { printf("ERROR: matrix order too small: %d/n", order); error = 1; goto ENDOFTESTS; } nb = atol(*++argv); /* a non-positive tile size means no outer level tiling */ inner_block_flag = atoi(*++argv); ENDOFTESTS:; } bail_out(error); MPI_Bcast(&order, 1, MPI_INT, root, MPI_COMM_WORLD); MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); MPI_Bcast(&nb, 1, MPI_LONG, root, MPI_COMM_WORLD); MPI_Bcast(&shortcut, 1, MPI_INT, root, MPI_COMM_WORLD); MPI_Bcast(&inner_block_flag, 1, MPI_INT, root, MPI_COMM_WORLD); /* compute rank grid to most closely match a square; to do so, compute largest divisor of Num_procs, using hare-brained method. The small term epsilon is used to guard against roundoff errors in case Num_procs is a perfect square */ nprow = (int) (sqrt((double) Num_procs + epsilon)); while (Num_procs%nprow) nprow--; npcol = Num_procs/nprow; if (my_ID == root) {//.........这里部分代码省略.........
开发者ID:elliottslaughter,项目名称:Kernels,代码行数:101,
示例11: fast_inclusionunsigned int fast_inclusion(const tetra *t, const point *p) { auto &a = *t->p[0], &b = *t->p[1], &c = *t->p[2], &d = *t->p[3]; Eigen::Matrix<double, 3, 3> A; A.col(0) << b.x - a.x, b.y - a.y, b.z - a.z; A.col(1) << c.x - a.x, c.y - a.y, c.z - a.z; A.col(2) << d.x - a.x, d.y - a.y, d.z - a.z; if (verbose == 3) std::cout << A << std::endl; Eigen::Matrix<double, 3, 1> x, B(p->x - a.x, p->y - a.y, p->z - a.z); x = A.inverse() * B; double sum = 0; for (unsigned int i = 0; i < 3; ++i) { if (std::abs(x[i]) < 1e-10) x[i] = 0; if (x[i] < 0) return 0; // outside else sum += x[i]; } if (std::abs(sum - 1) < 1e-10) sum = 1;//return exact_inclusion(t, p); if (std::abs(sum) < 1e-10) sum = 0; if (sum > 1) return 0; // outside if (sum == 0) return 1; // vertex 0 double u(x[0]), v(x[1]), w(x[2]); if (u == 1) { return 2; // vertex 1 } else if (u > 0) { if (v > 0) { if (w > 0) { if (sum == 1) return 14; // surface 321 else return 15; // inside } else { if (sum == 1) return 6; // edge 21 else return 7; // surface 012 } } else { if (w > 0) { if (sum == 1) return 10; // edge 31 else return 11; // surface 031 } else { return 3; // edge 10 } } } else { if (v == 1) return 4; // vertex 2 else if (v > 0) { if (w > 0) { if (sum == 1) return 12; // edge 32//.........这里部分代码省略.........
开发者ID:LeonineKing1199,项目名称:Regulus,代码行数:101,
示例12: magma_zhegst_gpuextern "C" magma_int_tmagma_zhegst_gpu(magma_int_t itype, char uplo, magma_int_t n, cuDoubleComplex *da, magma_int_t ldda, cuDoubleComplex *db, magma_int_t lddb, magma_int_t *info){/* -- MAGMA (version 1.3.0) -- Univ. of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver November 2012 Purpose ======= ZHEGST_GPU reduces a complex Hermitian-definite generalized eigenproblem to standard form. If ITYPE = 1, the problem is A*x = lambda*B*x, and A is overwritten by inv(U**H)*A*inv(U) or inv(L)*A*inv(L**H) If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or B*A*x = lambda*x, and A is overwritten by U*A*U**H or L**H*A*L. B must have been previously factorized as U**H*U or L*L**H by ZPOTRF. Arguments ========= ITYPE (input) INTEGER = 1: compute inv(U**H)*A*inv(U) or inv(L)*A*inv(L**H); = 2 or 3: compute U*A*U**H or L**H*A*L. UPLO (input) CHARACTER*1 = 'U': Upper triangle of A is stored and B is factored as U**H*U; = 'L': Lower triangle of A is stored and B is factored as L*L**H. N (input) INTEGER The order of the matrices A and B. N >= 0. DA (device input/output) COMPLEX*16 array, dimension (LDA,N) On entry, the Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. On exit, if INFO = 0, the transformed matrix, stored in the same format as A. LDDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N). DB (device input) COMPLEX*16 array, dimension (LDB,N) The triangular factor from the Cholesky factorization of B, as returned by ZPOTRF. LDDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N). INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value =====================================================================*/ char uplo_[2] = {uplo, 0}; magma_int_t nb; magma_int_t k, kb, kb2; cuDoubleComplex c_one = MAGMA_Z_ONE; cuDoubleComplex c_neg_one = MAGMA_Z_NEG_ONE; cuDoubleComplex c_half = MAGMA_Z_HALF; cuDoubleComplex c_neg_half = MAGMA_Z_NEG_HALF; cuDoubleComplex *w; magma_int_t lda; magma_int_t ldb; double d_one = 1.0; int upper = lapackf77_lsame(uplo_, "U"); /* Test the input parameters. */ *info = 0; if (itype<1 || itype>3){ *info = -1; }else if ((! upper) && (! lapackf77_lsame(uplo_, "L"))) { *info = -2; } else if (n < 0) { *info = -3; } else if (ldda < max(1,n)) { *info = -5; }else if (lddb < max(1,n)) { *info = -7; } if (*info != 0) { magma_xerbla( __func__, -(*info) ); return *info; } /* Quick return */ if ( n == 0 )//.........这里部分代码省略.........
开发者ID:cjy7117,项目名称:DVFS-MAGMA,代码行数:101,
示例13: foo void foo (int) { struct B { virtual ~B() {} }; B(); }
开发者ID:AlexDenisov,项目名称:clang,代码行数:4,
示例14: initialize_module_sx_obj2//.........这里部分代码省略......... /* Byte-vector with size: 1 is_init: 0 index: 64 binding: anonymous */ static const void *G001651[] = {I(a9,86,45,00)}; /* Byte-vector with size: 1 is_init: 0 index: 65 binding: anonymous */ static const void *G001653[] = {I(a9,86,45,00)}; /* Byte-vector with size: 1 is_init: 0 index: 66 binding: anonymous */ static const void *G001655[] = {I(a9,86,45,00)}; /* Byte-vector with size: 1 is_init: 0 index: 67 binding: anonymous */ static const void *G001657[] = {I(a9,86,45,00)}; /* Byte-vector with size: 1 is_init: 0 index: 68 binding: anonymous */ static const void *G001659[] = {I(a9,86,45,00)}; /* Byte-vector with size: 1 is_init: 0 index: 69 binding: anonymous */ static const void *G001661[] = {I(a9,86,45,00)}; /* Byte-vector with size: 1 is_init: 0 index: 70 binding: anonymous */ static const void *G001663[] = {I(a9,86,45,00)}; eul_allocate_static_cons(cons_1685, NULL, NULL); eul_allocate_static_cons(cons_1684, NULL, eul_as_static(cons_1685)); eul_allocate_static_cons(cons_1683, NULL, eul_as_static(cons_1684)); eul_allocate_static_cons(cons_1682, NULL, eul_as_static(cons_1683)); eul_allocate_static_cons(cons_1693, NULL, NULL); eul_allocate_static_cons(cons_1692, NULL, eul_as_static(cons_1693)); eul_allocate_static_cons(cons_1700, NULL, NULL); eul_allocate_static_cons(cons_1699, NULL, eul_as_static(cons_1700)); eul_allocate_static_cons(cons_1702, NULL, NULL); eul_allocate_static_cons(cons_1705, NULL, NULL); eul_allocate_static_cons(cons_1704, NULL, eul_as_static(cons_1705)); /* Byte-vector with size: 1065 is_init: 0 index: 123 binding: top-level */ static const void *G001665[] = {I(a9,24,00,00),B(sx_obj1 ,3),I(24,00,00,00),B(boot1 ,26),I(3c,01,23,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,72),I(23,00,00,00),B(sx_obj2 ,73),I(23,00,00,00),B(sx_obj2 ,74),I(23,00,00,00),B(sx_obj2 ,70),I(3b,00,23,00),B(sx_obj2 ,75),I(23,00,00,00),B(sx_obj2 ,71),I(24,00,00,00),B(boot1 ,26),I(3c,06,23,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,76),I(23,00,00,00),B(sx_obj2 ,73),I(23,00,00,00),B(sx_obj2 ,74),I(23,00,00,00),B(sx_obj2 ,69),I(3b,00,23,00),B(sx_obj2 ,75),I(23,00,00,00),B(sx_obj2 ,77),I(24,00,00,00),B(boot1 ,26),I(3c,06,23,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,78),I(23,00,00,00),B(sx_obj2 ,73),I(23,00,00,00),B(sx_obj2 ,74),I(23,00,00,00),B(sx_obj2 ,68),I(3b,00,23,00),B(sx_obj2 ,75),I(23,00,00,00),B(sx_obj2 ,79),I(24,00,00,00),B(boot1 ,26),I(3c,06,23,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,80),I(23,00,00,00),B(sx_obj2 ,73),I(23,00,00,00),B(sx_obj2 ,74),I(23,00,00,00),B(sx_obj2 ,67),I(3b,00,23,00),B(sx_obj2 ,75),I(23,00,00,00),B(sx_obj2 ,81),I(24,00,00,00),B(boot1 ,26),I(3c,06,1f,03),I(1f,03,1f,03),I(1f,03,24,00),B(boot1 ,26),I(3c,04,24,00),B(mop_class ,81),I(23,00,00,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,82),I(23,00,00,00),B(sx_obj2 ,83),I(1f,09,23,00),B(sx_obj2 ,84),I(1f,06,23,00),B(sx_obj2 ,85),I(23,00,00,00),B(sx_obj2 ,86),I(24,00,00,00),B(mop_gf ,2),I(3c,09,1b,89),B(sx_obj2 ,11),I(2a,24,00,00),B(sx_obj2 ,11),I(24,00,00,00),B(boot1 ,26),I(3c,01,24,00),B(boot1 ,26),I(3c,00,24,00),B(mop_class ,81),I(23,00,00,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,87),I(23,00,00,00),B(sx_obj2 ,83),I(1f,05,23,00),B(sx_obj2 ,84),I(1f,06,23,00),B(sx_obj2 ,85),I(86,24,00,00),B(mop_gf ,2),I(3c,09,1b,89),B(sx_obj2 ,24),I(2a,24,00,00),B(sx_obj2 ,24),I(24,00,00,00),B(boot1 ,26),I(3c,01,23,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,88),I(23,00,00,00),B(sx_obj2 ,73),I(23,00,00,00),B(sx_obj2 ,74),I(23,00,00,00),B(sx_obj2 ,66),I(3b,00,23,00),B(sx_obj2 ,75),I(23,00,00,00),B(sx_obj2 ,89),I(24,00,00,00),B(boot1 ,26),I(3c,06,23,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,90),I(23,00,00,00),B(sx_obj2 ,73),I(23,00,00,00),B(sx_obj2 ,74),I(23,00,00,00),B(sx_obj2 ,65),I(3b,00,23,00),B(sx_obj2 ,75),I(23,00,00,00),B(sx_obj2 ,91),I(24,00,00,00),B(boot1 ,26),I(3c,06,1c,1c),I(24,00,00,00),B(boot1 ,26),I(3c,02,24,00),B(mop_class ,81),I(23,00,00,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,92),I(23,00,00,00),B(sx_obj2 ,83),I(1f,07,23,00),B(sx_obj2 ,84),I(1f,06,23,00),B(sx_obj2 ,85),I(23,00,00,00),B(sx_obj2 ,93),I(24,00,00,00),B(mop_gf ,2),I(3c,09,1b,89),B(sx_obj2 ,9),I(2a,24,00,00),B(sx_obj2 ,11),I(24,00,00,00),B(boot1 ,26),I(3c,01,24,00),B(boot1 ,26),I(3c,00,24,00),B(mop_class ,81),I(23,00,00,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,94),I(23,00,00,00),B(sx_obj2 ,83),I(1f,05,23,00),B(sx_obj2 ,84),I(1f,06,23,00),B(sx_obj2 ,85),I(86,24,00,00),B(mop_gf ,2),I(3c,09,1b,89),B(sx_obj2 ,7),I(2a,24,00,00),B(sx_obj2 ,7),I(24,00,00,00),B(boot1 ,26),I(3c,01,24,00),B(boot1 ,26),I(3c,00,24,00),B(mop_class ,81),I(23,00,00,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,95),I(23,00,00,00),B(sx_obj2 ,83),I(1f,05,23,00),B(sx_obj2 ,84),I(1f,06,23,00),B(sx_obj2 ,85),I(86,24,00,00),B(mop_gf ,2),I(3c,09,1b,89),B(sx_obj2 ,28),I(2a,24,00,00),B(sx_obj1 ,3),I(24,00,00,00),B(boot1 ,26),I(3c,01,23,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,76),I(23,00,00,00),B(sx_obj2 ,73),I(23,00,00,00),B(sx_obj2 ,74),I(23,00,00,00),B(sx_obj2 ,64),I(3b,00,23,00),B(sx_obj2 ,75),I(23,00,00,00),B(sx_obj2 ,77),I(24,00,00,00),B(boot1 ,26),I(3c,06,23,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,96),I(23,00,00,00),B(sx_obj2 ,73),I(23,00,00,00),B(sx_obj2 ,74),I(23,00,00,00),B(sx_obj2 ,63),I(3b,00,23,00),B(sx_obj2 ,75),I(23,00,00,00),B(sx_obj2 ,97),I(24,00,00,00),B(boot1 ,26),I(3c,06,1c,1c),I(24,00,00,00),B(boot1 ,26),I(3c,02,24,00),B(mop_class ,81),I(23,00,00,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,98),I(23,00,00,00),B(sx_obj2 ,83),I(1f,07,23,00),B(sx_obj2 ,84),I(1f,06,23,00),B(sx_obj2 ,85),I(23,00,00,00),B(sx_obj2 ,99),I(24,00,00,00),B(mop_gf ,2),I(3c,09,1b,89),B(sx_obj2 ,25),I(2a,24,00,00),B(sx_obj1 ,27),I(24,00,00,00),B(boot1 ,26),I(3c,01,23,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,78),I(23,00,00,00),B(sx_obj2 ,73),I(23,00,00,00),B(sx_obj2 ,74),I(23,00,00,00),B(sx_obj2 ,62),I(3b,00,23,00),B(sx_obj2 ,75),I(23,00,00,00),B(sx_obj2 ,79),I(24,00,00,00),B(boot1 ,26),I(3c,06,1b,24),B(boot1 ,26),I(3c,01,24,00),B(mop_class ,81),I(23,00,00,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,100),I(23,00,00,00),B(sx_obj2 ,83),I(1f,06,23,00),B(sx_obj2 ,84),I(1f,06,23,00),B(sx_obj2 ,85),I(23,00,00,00),B(sx_obj2 ,101),I(24,00,00,00),B(mop_gf ,2),I(3c,09,1b,89),B(sx_obj2 ,29),I(2a,24,00,00),B(sx_obj2 ,29),I(24,00,00,00),B(boot1 ,26),I(3c,01,23,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,72),I(23,00,00,00),B(sx_obj2 ,73),I(23,00,00,00),B(sx_obj2 ,74),I(23,00,00,00),B(sx_obj2 ,61),I(3b,00,23,00),B(sx_obj2 ,75),I(23,00,00,00),B(sx_obj2 ,71),I(24,00,00,00),B(boot1 ,26),I(3c,06,23,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,76),I(23,00,00,00),B(sx_obj2 ,73),I(23,00,00,00),B(sx_obj2 ,74),I(23,00,00,00),B(sx_obj2 ,60),I(3b,00,23,00),B(sx_obj2 ,75),I(23,00,00,00),B(sx_obj2 ,77),I(24,00,00,00),B(boot1 ,26),I(3c,06,1c,1c),I(24,00,00,00),B(boot1 ,26),I(3c,02,24,00),B(mop_class ,81),I(23,00,00,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,102),I(23,00,00,00),B(sx_obj2 ,83),I(1f,07,23,00),B(sx_obj2 ,84),I(1f,06,23,00),B(sx_obj2 ,85),I(23,00,00,00),B(sx_obj2 ,103),I(24,00,00,00),B(mop_gf ,2),I(3c,09,1b,89),B(sx_obj2 ,22),I(2a,24,00,00),B(sx_obj2 ,29),I(24,00,00,00),B(boot1 ,26),I(3c,01,24,00),B(boot1 ,26),I(3c,00,24,00),B(mop_class ,81),I(23,00,00,00),B(sx_obj2 ,71),I(23,00,00,00),B(sx_obj2 ,104),I(23,00,00,00),B(sx_obj2 ,83),I(1f,05,23,00),B(sx_obj2 ,84),I(1f,06,23,00),B(sx_obj2 ,85),I(86,24,00,00),B(mop_gf ,2),I(3c,09,1b,89),B(sx_obj2 ,32),I(2a,83,24,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(boot1 ,26),I(3c,00,23,00),B(sx_obj2 ,105),I(1f,03,24,00),B(mop_class ,16),I(24,00,00,00),B(mop_class ,63),I(1f,05,1f,05),I(24,00,00,00),B(mop_gf ,16),I(3c,06,1b,89),B(sx_obj2 ,33),I(2a,83,24,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(boot1 ,26),I(3c,00,23,00),B(sx_obj2 ,106),I(1f,03,24,00),B(mop_class ,16),I(24,00,00,00),B(mop_class ,63),I(1f,05,1f,05),I(24,00,00,00),B(mop_gf ,16),I(3c,06,1b,89),B(sx_obj2 ,40),I(2a,83,24,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(boot1 ,26),I(3c,00,23,00),B(sx_obj2 ,107),I(1f,03,24,00),B(mop_class ,16),I(24,00,00,00),B(mop_class ,63),I(1f,05,1f,05),I(24,00,00,00),B(mop_gf ,16),I(3c,06,1b,89),B(sx_obj2 ,18),I(2a,83,24,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(boot1 ,26),I(3c,00,23,00),B(sx_obj2 ,108),I(1f,03,24,00),B(mop_class ,16),I(24,00,00,00),B(mop_class ,63),I(1f,05,1f,05),I(24,00,00,00),B(mop_gf ,16),I(3c,06,1b,89),B(sx_obj2 ,3),I(2a,83,24,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(boot1 ,26),I(3c,00,23,00),B(sx_obj2 ,109),I(1f,03,24,00),B(mop_class ,16),I(24,00,00,00),B(mop_class ,63),I(1f,05,1f,05),I(24,00,00,00),B(mop_gf ,16),I(3c,06,1b,89),B(sx_obj2 ,31),I(2a,83,24,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(boot1 ,26),I(3c,00,23,00),B(sx_obj2 ,110),I(1f,03,24,00),B(mop_class ,16),I(24,00,00,00),B(mop_class ,63),I(1f,05,1f,05),I(24,00,00,00),B(mop_gf ,16),I(3c,06,1b,89),B(sx_obj2 ,4),I(2a,83,24,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(boot1 ,26),I(3c,00,23,00),B(sx_obj2 ,111),I(1f,03,24,00),B(mop_class ,16),I(24,00,00,00),B(mop_class ,63),I(1f,05,1f,05),I(24,00,00,00),B(mop_gf ,16),I(3c,06,1b,89),B(sx_obj2 ,17),I(2a,83,24,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(boot1 ,26),I(3c,00,23,00),B(sx_obj2 ,112),I(1f,03,24,00),B(mop_class ,16),I(24,00,00,00),B(mop_class ,63),I(1f,05,1f,05),I(24,00,00,00),B(mop_gf ,16),I(3c,06,1b,89),B(sx_obj2 ,12),I(2a,83,24,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(boot1 ,26),I(3c,00,23,00),B(sx_obj2 ,113),I(1f,03,24,00),B(mop_class ,16),I(24,00,00,00),B(mop_class ,63),I(1f,05,1f,05),I(24,00,00,00),B(mop_gf ,16),I(3c,06,1b,89),B(sx_obj2 ,14),I(2a,24,00,00),B(sx_obj2 ,33),I(8a,03,02,83),I(24,00,00,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,33),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,114),I(23,00,00,00),B(sx_obj2 ,59),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,33),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,33),I(8a,03,02,83),I(24,00,00,00),B(sx_obj2 ,11),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,33),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,114),I(23,00,00,00),B(sx_obj2 ,58),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,33),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,33),I(2a,24,00,00),B(sx_obj2 ,11),I(2a,24,00,00),B(sx_obj2 ,40),I(8a,03,02,83),I(24,00,00,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,40),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,115),I(23,00,00,00),B(sx_obj2 ,57),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,40),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,40),I(8a,03,02,83),I(24,00,00,00),B(sx_obj2 ,24),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,40),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,115),I(23,00,00,00),B(sx_obj2 ,56),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,40),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,40),I(2a,24,00,00),B(sx_obj2 ,24),I(2a,24,00,00),B(sx_obj2 ,18),I(8a,03,02,83),I(24,00,00,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,18),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,116),I(23,00,00,00),B(sx_obj2 ,55),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,18),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,18),I(8a,03,02,83),I(24,00,00,00),B(sx_obj2 ,9),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,18),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,116),I(23,00,00,00),B(sx_obj2 ,54),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,18),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,18),I(2a,24,00,00),B(sx_obj2 ,9),I(2a,24,00,00),B(sx_obj2 ,3),I(8a,03,02,83),I(24,00,00,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,3),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,117),I(23,00,00,00),B(sx_obj2 ,53),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,3),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,3),I(8a,03,02,83),I(24,00,00,00),B(sx_obj2 ,7),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,3),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,117),I(23,00,00,00),B(sx_obj2 ,52),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,3),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,3),I(2a,24,00,00),B(sx_obj2 ,7),I(2a,24,00,00),B(sx_obj2 ,31),I(8a,03,02,83),I(24,00,00,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,31),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,118),I(23,00,00,00),B(sx_obj2 ,51),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,31),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,31),I(8a,03,02,83),I(24,00,00,00),B(sx_obj2 ,28),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,31),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,118),I(23,00,00,00),B(sx_obj2 ,50),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,31),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,31),I(2a,24,00,00),B(sx_obj2 ,28),I(2a,24,00,00),B(sx_obj2 ,4),I(8a,03,02,83),I(24,00,00,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,4),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,119),I(23,00,00,00),B(sx_obj2 ,49),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,4),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,4),I(8a,03,02,83),I(24,00,00,00),B(sx_obj2 ,25),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,4),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,119),I(23,00,00,00),B(sx_obj2 ,48),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,4),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,4),I(2a,24,00,00),B(sx_obj2 ,25),I(2a,24,00,00),B(sx_obj2 ,17),I(8a,03,02,83),I(24,00,00,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,17),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,120),I(23,00,00,00),B(sx_obj2 ,47),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,17),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,17),I(8a,03,02,83),I(24,00,00,00),B(sx_obj2 ,29),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,17),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,120),I(23,00,00,00),B(sx_obj2 ,46),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,17),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,17),I(2a,24,00,00),B(sx_obj2 ,29),I(2a,24,00,00),B(sx_obj2 ,12),I(8a,03,02,83),I(24,00,00,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,12),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,121),I(23,00,00,00),B(sx_obj2 ,45),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,12),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,12),I(8a,03,02,83),I(24,00,00,00),B(sx_obj2 ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,12),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,121),I(23,00,00,00),B(sx_obj2 ,44),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,12),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,12),I(2a,24,00,00),B(sx_obj2 ,22),I(2a,24,00,00),B(sx_obj2 ,14),I(8a,03,02,83),I(24,00,00,00),B(mop_class ,22),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,14),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,122),I(23,00,00,00),B(sx_obj2 ,43),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,14),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,14),I(8a,03,02,83),I(24,00,00,00),B(sx_obj2 ,32),I(24,00,00,00),B(boot1 ,40),I(3c,02,24,00),B(boot1 ,26),I(3c,00,24,00),B(sx_obj2 ,14),I(8a,04,02,1c),I(1c,24,00,00),B(boot ,8),I(3c,02,1f,04),I(1f,04,23,00),B(sx_obj2 ,122),I(23,00,00,00),B(sx_obj2 ,42),I(3b,01,1f,03),I(24,00,00,00),B(mop_meth ,3),I(3c,04,24,00),B(sx_obj2 ,14),I(1c,24,00,00),B(mop_meth ,5),I(3c,02,2a,24),B(sx_obj2 ,14),I(2a,24,00,00),B(sx_obj2 ,32),I(45,b6,00,00)}; /* Byte-vector with size: 4 is_init: 0 index: 124 binding: setq-binding! */ static const void *G001725[] = {I(ab,1c,83,1d),I(24,00,00,00),B(sx_obj2 ,25),I(09,45,02,00)}; /* Byte-vector with size: 4 is_init: 0 index: 125 binding: var-value! */ static const void *G001727[] = {I(ab,1c,83,1d),I(24,00,00,00),B(sx_obj2 ,11),I(09,45,02,00)}; /* Byte-vector with size: 3 is_init: 0 index: 126 binding: setq-obj? */ static const void *G001729[] = {I(aa,82,24,00),B(sx_obj2 ,25),I(08,45,00,00)}; /* Byte-vector with size: 4 is_init: 0 index: 127 binding: local-static-var-lambda! */ static const void *G001731[] = {I(ab,1c,83,1d),I(24,00,00,00),B(sx_obj2 ,9),I(09,45,02,00)}; /* Byte-vector with size: 3 is_init: 0 index: 128 binding: var-name? */ static const void *G001733[] = {I(aa,8a,03,24),B(sx_obj2 ,11),I(08,45,00,00)}; /* Byte-vector with size: 3 is_init: 0 index: 129 binding: named-const-name? */ static const void *G001735[] = {I(aa,83,24,00),B(sx_obj2 ,22),I(08,45,00,00)}; /* Byte-vector with size: 3 is_init: 0 index: 130 binding: var-used? */ static const void *G001737[] = {I(aa,82,24,00),B(sx_obj2 ,11),I(08,45,00,00)}; /* Byte-vector with size: 4 is_init: 0 index: 131 binding: named-const-name! */ static const void *G001739[] = {I(ab,1c,83,1d),I(24,00,00,00),B(sx_obj2 ,22),I(09,45,02,00)}; /* Byte-vector with size: 3 is_init: 0 index: 132 binding: const-value? */ static const void *G001741[] = {I(aa,82,24,00),B(sx_obj2 ,29),I(08,45,00,00)}; /* Byte-vector with size: 4 is_init: 0 index: 133 binding: setq-obj! */ static const void *G001743[] = {I(ab,1c,82,1d),I(24,00,00,00),B(sx_obj2 ,25),I(09,45,02,00)}; /* Byte-vector with size: 4 is_init: 0 index: 134 binding: var-binding! */
开发者ID:Henry,项目名称:EuLisp,代码行数:67,
示例15: PROFILE2LR::LRSplineSurface* ASMu2D::scRecovery (const IntegrandBase& integrand) const{ PROFILE2("ASMu2D::scRecovery"); const int m = integrand.derivativeOrder(); const int p1 = lrspline->order(0); const int p2 = lrspline->order(1); // Get Gaussian quadrature point coordinates const int ng1 = p1 - m; const int ng2 = p2 - m; const double* xg = GaussQuadrature::getCoord(ng1); const double* yg = GaussQuadrature::getCoord(ng2); if (!xg || !yg) return nullptr; // Compute parameter values of the Greville points std::array<RealArray,2> gpar; if (!this->getGrevilleParameters(gpar[0],0)) return nullptr; if (!this->getGrevilleParameters(gpar[1],1)) return nullptr; const int n1 = p1 - m + 1; // Patch size in first parameter direction const int n2 = p2 - m + 1; // Patch size in second parameter direction const size_t nCmp = integrand.getNoFields(); // Number of result components const size_t nPol = n1*n2; // Number of terms in polynomial expansion Matrix sValues(nCmp,gpar[0].size()); Vector P(nPol); Go::Point X, G; // Loop over all Greville points (one for each basis function) size_t k, l, ip = 0; std::vector<LR::Element*>::const_iterator elStart, elEnd, el; std::vector<LR::Element*> supportElements; for (LR::Basisfunction *b : lrspline->getAllBasisfunctions()) {#if SP_DEBUG > 2 std::cout <<"Basis: "<< *b <<"/n ng1 ="<< ng1 <<"/n ng2 ="<< ng2 <<"/n nPol="<< nPol << std::endl;#endif // Special case for basis functions with too many zero knot spans by using // the extended support // if(nel*ng1*ng2 < nPol) if(true) { // KMO: Here I'm not sure how this will change when m > 1. // In that case I think we would need smaller patches (as in the tensor // splines case). But how to do that??? supportElements = b->getExtendedSupport(); elStart = supportElements.begin(); elEnd = supportElements.end();#if SP_DEBUG > 2 std::cout <<"Extended basis:"; for (el = elStart; el != elEnd; el++) std::cout <<"/n " << **el; std::cout << std::endl;#endif } else { elStart = b->supportedElementBegin(); elEnd = b->supportedElementEnd(); } // Physical coordinates of current Greville point lrspline->point(G,gpar[0][ip],gpar[1][ip]); // Set up the local projection matrices DenseMatrix A(nPol,nPol); Matrix B(nPol,nCmp); // Loop over all non-zero knot-spans in the support of // the basis function associated with current Greville point for (el = elStart; el != elEnd; el++) { int iel = (**el).getId()+1; // evaluate all gauss points for this element std::array<RealArray,2> gaussPt, unstrGauss; this->getGaussPointParameters(gaussPt[0],0,ng1,iel,xg); this->getGaussPointParameters(gaussPt[1],1,ng2,iel,yg);#if SP_DEBUG > 2 std::cout << "Element " << **el << std::endl;#endif // convert to unstructred mesh representation expandTensorGrid(gaussPt.data(),unstrGauss.data()); // Evaluate the secondary solution at all Gauss points Matrix sField; if (!this->evalSolution(sField,integrand,unstrGauss.data())) return nullptr; // Loop over the Gauss points in current knot-span int i, j, ig = 1; for (j = 0; j < ng2; j++) for (i = 0; i < ng1; i++, ig++) {//.........这里部分代码省略.........
开发者ID:akva2,项目名称:IFEM,代码行数:101,
示例16: AddDot4x4void AddDot4x4( int k, double *a, int lda, double *b, int ldb, double *c, int ldc ){ /* So, this routine computes a 4x4 block of matrix A C( 0, 0 ), C( 0, 1 ), C( 0, 2 ), C( 0, 3 ). C( 1, 0 ), C( 1, 1 ), C( 1, 2 ), C( 1, 3 ). C( 2, 0 ), C( 2, 1 ), C( 2, 2 ), C( 2, 3 ). C( 3, 0 ), C( 3, 1 ), C( 3, 2 ), C( 3, 3 ). Notice that this routine is called with c = C( i, j ) in the previous routine, so these are actually the elements C( i , j ), C( i , j+1 ), C( i , j+2 ), C( i , j+3 ) C( i+1, j ), C( i+1, j+1 ), C( i+1, j+2 ), C( i+1, j+3 ) C( i+2, j ), C( i+2, j+1 ), C( i+2, j+2 ), C( i+2, j+3 ) C( i+3, j ), C( i+3, j+1 ), C( i+3, j+2 ), C( i+3, j+3 ) in the original matrix C In this version, we merge each set of four loops, computing four inner products simultaneously. */ int p; for ( p=0; p<k; p++ ){ /* First row */ C( 0, 0 ) += A( 0, p ) * B( p, 0 ); C( 0, 1 ) += A( 0, p ) * B( p, 1 ); C( 0, 2 ) += A( 0, p ) * B( p, 2 ); C( 0, 3 ) += A( 0, p ) * B( p, 3 ); /* Second row */ C( 1, 0 ) += A( 1, p ) * B( p, 0 ); C( 1, 1 ) += A( 1, p ) * B( p, 1 ); C( 1, 2 ) += A( 1, p ) * B( p, 2 ); C( 1, 3 ) += A( 1, p ) * B( p, 3 ); /* Third row */ C( 2, 0 ) += A( 2, p ) * B( p, 0 ); C( 2, 1 ) += A( 2, p ) * B( p, 1 ); C( 2, 2 ) += A( 2, p ) * B( p, 2 ); C( 2, 3 ) += A( 2, p ) * B( p, 3 ); /* Fourth row */ C( 3, 0 ) += A( 3, p ) * B( p, 0 ); C( 3, 1 ) += A( 3, p ) * B( p, 1 ); C( 3, 2 ) += A( 3, p ) * B( p, 2 ); C( 3, 3 ) += A( 3, p ) * B( p, 3 ); }}
开发者ID:SudoNohup,项目名称:HowToOptimizeGemm,代码行数:50,
示例17: sizeLR::LRSplineSurface* ASMu2D::regularInterpolation (const RealArray& upar, const RealArray& vpar, const Matrix& points) const{ if (lrspline->rational()) { std::cerr <<" *** ASMu2D::regularInterpolation:" <<" Rational LR B-splines not supported yet."<< std::endl; return nullptr; } // sanity check on input parameters const size_t nBasis = lrspline->nBasisFunctions(); if (upar.size() != nBasis || vpar.size() != nBasis || points.cols() != nBasis) { std::cerr <<" *** ASMu2D::regularInterpolation:" <<" Mismatching input array sizes./n" <<" size(upar)="<< upar.size() <<" size(vpar)="<< vpar.size() <<" size(points)="<< points.cols() <<" nBasis="<< nBasis << std::endl; return nullptr; } SparseMatrix A(SparseMatrix::SUPERLU); A.resize(nBasis, nBasis); Matrix B2(points,true); // transpose to get one vector per field StdVector B(B2.ptr(), B2.size()); Go::BasisPtsSf splineValues; // Evaluate all basis functions at all points, stored in the A-matrix // (same row = same evaluation point) for (size_t i = 0; i < nBasis; i++) { int id = lrspline->getElementContaining(upar[i],vpar[i]); LR::Element* el = lrspline->getElement(id); std::cout << "id is " << id << std::endl; lrspline->computeBasis(upar[i],vpar[i],splineValues, id); auto it = splineValues.basisValues.begin(); std::cout << "ncoef is " << splineValues.basisValues.size() << std::endl; for (auto& it2 : splineValues.basisValues) std::cout << it2 << " "; std::cout << std::endl; for (LR::Basisfunction* b : el->support()) A(i+1, b->getId()+1) = *it++; } std::ofstream of("A.asc"); A.printFull(of); of.close(); // Solve for all solution components - one right-hand-side for each if (!A.solve(B)) return nullptr; std::cout << B << std::endl; // Copy all basis functions and mesh LR::LRSplineSurface* ans = lrspline->copy(); ans->rebuildDimension(points.rows()); // Back to interleaved data std::vector<double> interleave; interleave.reserve(B.dim()); for (size_t i = 0; i < nBasis; ++i) for (size_t j = 0; j < points.rows(); j++) { interleave.push_back(B(1+j*points.cols()+i)); } ans->setControlPoints(interleave); return ans;}
开发者ID:akva2,项目名称:IFEM,代码行数:72,
示例18: TestStores2void TestStores2(){ B(s10, Stream storage, 0) W(s10a); W(s10b); W(s10c); { // s10a is original // s10b is a copy, random access // s10c is a serialized copy c4_StringProp p1 ("p1"); c4_ViewProp p2 ("p2"); c4_IntProp p3 ("p3"); { c4_Storage s1 ("s10a", 1); s1.SetStructure("a[p1:S,p2[p3:I]]"); c4_View v1 = s1.View("a"); v1.Add(p1 ["one"]); v1.Add(p1 ["two"]); c4_View v2 = p2 (v1[0]); v2.Add(p3 [1]); v2 = p2 (v1[1]); v2.Add(p3 [11]); v2.Add(p3 [22]); v1.InsertAt(1, p1 ["three"]); v2 = p2 (v1[1]); v2.Add(p3 [111]); v2.Add(p3 [222]); v2.Add(p3 [333]); s1.Commit(); } { c4_Storage s1 ("s10a", 0); c4_Storage s2 ("s10b", 1); s2.SetStructure("a[p1:S,p2[p3:I]]"); s2.View("a") = s1.View("a"); s2.Commit(); } { c4_Storage s3 ("s10b", 0); c4_FileStream fs1 (fopen("s10c", "wb"), true); s3.SaveTo(fs1); } { c4_Storage s1 ("s10c", 0); // new after 2.01: serialized is no longer special c4_View v1 = s1.View("a"); A(v1.GetSize() == 3); c4_View v2 = p2 (v1[0]); A(v2.GetSize() == 1); c4_View v3 = p2 (v1[1]); A(v3.GetSize() == 3); c4_View v4 = p2 (v1[2]); A(v4.GetSize() == 2); } { c4_Storage s1; c4_FileStream fs1 (fopen("s10c", "rb"), true); s1.LoadFrom(fs1); c4_View v1 = s1.View("a"); A(v1.GetSize() == 3); c4_View v2 = p2 (v1[0]); A(v2.GetSize() == 1); c4_View v3 = p2 (v1[1]); A(v3.GetSize() == 3); c4_View v4 = p2 (v1[2]); A(v4.GetSize() == 2); } { c4_Storage s1 ("s10c", 1); c4_View v1 = s1.View("a"); A(v1.GetSize() == 3); c4_View v2 = p2 (v1[0]); A(v2.GetSize() == 1); c4_View v3 = p2 (v1[1]); A(v3.GetSize() == 3); c4_View v4 = p2 (v1[2]); A(v4.GetSize() == 2); v1.Add(p1 ["four"]); s1.Commit(); } { c4_Storage s1 ("s10c", 0); c4_View v1 = s1.View("a"); A(v1.GetSize() == 4); c4_View v2 = p2 (v1[0]); A(v2.GetSize() == 1); c4_View v3 = p2 (v1[1]); A(v3.GetSize() == 3); c4_View v4 = p2 (v1[2]); A(v4.GetSize() == 2); c4_View v5 = p2 (v1[3]); A(v5.GetSize() == 0); } } D(s10a); D(s10b);//.........这里部分代码省略.........
开发者ID:SASfit,项目名称:SASfit,代码行数:101,
示例19: knh_System_initPathvoid knh_System_initPath(CTX ctx){ CWB_t cwbbuf, *cwb = CWB_open(ctx, &cwbbuf); kDictMap *sysprops = ctx->share->props; kbytes_t home = {{NULL}, 0}, user = {{NULL}, 0}; // current working directory knh_buff_addospath(ctx, cwb->ba, cwb->pos, 0, STEXT(".")); KNH_SETv(ctx, ctx->share->rootns->path, new_Path(ctx, knh_buff_newRealPathString(ctx, cwb->ba, cwb->pos))); home.text = (const char*)knh_getenv("KONOHAHOME");#if defined(K_KONOHAHOME) if(home.text == NULL) { home.text = K_KONOHAHOME; }#endif if(home.text != NULL) { home.len = knh_strlen(home.text); SETPROP("konoha.home.path", new_T(home.text)); }#if defined(K_USING_WINDOWS_) { char buf[K_PATHMAX]; int bufsiz = K_PATHMAX; HMODULE h = LoadLibrary(NULL); GetModuleFileNameA(h, buf, bufsiz); CWB_clear(cwb, 0); knh_buff_addospath(ctx, cwb->ba, cwb->pos, 0, B(buf)); SETPROP("konoha.bin.path", knh_buff_newRealPathString(ctx, cwb->ba, cwb->pos)); if(home.text == NULL) { kString *s; CWB_clear(cwb, 0); knh_buff_addpath(ctx, cwb->ba, cwb->pos, 0, B(buf)); knh_buff_trim(ctx, cwb->ba, cwb->pos, '//'); knh_buff_trim(ctx, cwb->ba, cwb->pos, '//'); knh_buff_addospath(ctx, cwb->ba, cwb->pos, 1/*isSep*/, STEXT("konoha")); s = CWB_newString(ctx, cwb, 0); SETPROP("konoha.home.path", s); home = S_tobytes(s); } }#elif defined(K_USING_LINUX_) // @url(http://shinh.skr.jp/binary/b2con.html) // http://doc.trolltech.com/3.3/qapplication.html#applicationDirPath { char buf[K_PATHMAX]; int bufsiz = K_PATHMAX; ssize_t size = readlink("/proc/self/exe", buf, bufsiz); CWB_clear(cwb, 0); knh_buff_addospath(ctx, cwb->ba, cwb->pos, 0, new_bytes2(buf, size)); SETPROP("konoha.bin.path", knh_buff_newRealPathString(ctx, cwb->ba, cwb->pos)); if(home.text == NULL) { kString *s; CWB_clear(cwb, 0); knh_buff_addpath(ctx, cwb->ba, cwb->pos, 0, new_bytes2(buf, size)); knh_buff_trim(ctx, cwb->ba, cwb->pos, '/'); knh_buff_trim(ctx, cwb->ba, cwb->pos, '/'); knh_buff_addpath(ctx, cwb->ba, cwb->pos, 1/*isSep*/, STEXT("konoha")); s = CWB_newString(ctx, cwb, 0); SETPROP("konoha.home.path", s); home = S_tobytes(s); } }#elif defined(K_USING_MACOSX_) { kString *binpath; CWB_clear(cwb, 0); knh_buff_addospath(ctx, cwb->ba, cwb->pos, 0, B(_dyld_get_image_name(0))); binpath = knh_buff_newRealPathString(ctx, cwb->ba, cwb->pos); SETPROP("konoha.bin.path", binpath); if(home.text == NULL) { CWB_clear(cwb, 0); knh_buff_addpath(ctx, cwb->ba, cwb->pos, 0, S_tobytes(binpath)); knh_buff_trim(ctx, cwb->ba, cwb->pos, '/'); knh_buff_trim(ctx, cwb->ba, cwb->pos, '/'); knh_buff_addpath(ctx, cwb->ba, cwb->pos, 1/*isSep*/, STEXT("konoha")); kString *s = CWB_newString(ctx, cwb, 0); SETPROP("konoha.home.path", s); home = S_tobytes(s); } }#else home = STEXT("/opt/konoha"); SETPROP("konoha.home.path", new_T("/opt/konoha"));#endif DBG_ASSERT(home.utext != NULL); /* $konoha.package.path {$konoha.home.path}/package */ CWB_clear(cwb, 0); knh_buff_addpath(ctx, cwb->ba, cwb->pos, 0, home); knh_buff_addpath(ctx, cwb->ba, cwb->pos, 1/*sep*/, STEXT("package")); knh_buff_addpath(ctx, cwb->ba, cwb->pos, 1/*sep*/, STEXT(LIBK_VERSION)); SETPROP("konoha.package.path", CWB_newString(ctx, cwb, 0)); /* $konoha.script.path {$konoha.home.path}/script */ knh_buff_addpath(ctx, cwb->ba, cwb->pos, 0, home); knh_buff_addpath(ctx, cwb->ba, cwb->pos, 1/*sep*/, STEXT("script")); knh_buff_addpath(ctx, cwb->ba, cwb->pos, 1/*sep*/, STEXT(LIBK_VERSION)); SETPROP("konoha.script.path", CWB_newString(ctx, cwb, 0));//.........这里部分代码省略.........
开发者ID:wakamori,项目名称:konohascript,代码行数:101,
示例20: U/* Subroutine */ int zsysvx_(char *fact, char *uplo, integer *n, integer * nrhs, doublecomplex *a, integer *lda, doublecomplex *af, integer * ldaf, integer *ipiv, doublecomplex *b, integer *ldb, doublecomplex *x, integer *ldx, doublereal *rcond, doublereal *ferr, doublereal *berr, doublecomplex *work, integer *lwork, doublereal *rwork, integer *info){/* -- LAPACK driver routine (version 2.0) -- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., Courant Institute, Argonne National Lab, and Rice University September 30, 1994 Purpose ======= ZSYSVX uses the diagonal pivoting factorization to compute the solution to a complex system of linear equations A * X = B, where A is an N-by-N symmetric matrix and X and B are N-by-NRHS matrices. Error bounds on the solution and a condition estimate are also provided. Description =========== The following steps are performed: 1. If FACT = 'N', the diagonal pivoting method is used to factor A. The form of the factorization is A = U * D * U**T, if UPLO = 'U', or A = L * D * L**T, if UPLO = 'L', where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks. 2. The factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision, steps 3 and 4 are skipped. 3. The system of equations is solved for X using the factored form of A. 4. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it. Arguments ========= FACT (input) CHARACTER*1 Specifies whether or not the factored form of A has been supplied on entry. = 'F': On entry, AF and IPIV contain the factored form of A. A, AF and IPIV will not be modified. = 'N': The matrix A will be copied to AF and factored. UPLO (input) CHARACTER*1 = 'U': Upper triangle of A is stored; = 'L': Lower triangle of A is stored. N (input) INTEGER The number of linear equations, i.e., the order of the matrix A. N >= 0. NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0. A (input) COMPLEX*16 array, dimension (LDA,N) The symmetric matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N). AF (input or output) COMPLEX*16 array, dimension (LDAF,N) If FACT = 'F', then AF is an input argument and on entry contains the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**T or A = L*D*L**T as computed by ZSYTRF. If FACT = 'N', then AF is an output argument and on exit returns the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**T or A = L*D*L**T. LDAF (input) INTEGER The leading dimension of the array AF. LDAF >= max(1,N). //.........这里部分代码省略.........
开发者ID:deepakantony,项目名称:vispack,代码行数:101,
示例21: U/* Subroutine */ int cspsv_(char *uplo, integer *n, integer *nrhs, complex * ap, integer *ipiv, complex *b, integer *ldb, integer *info){/* -- LAPACK driver routine (version 2.0) -- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., Courant Institute, Argonne National Lab, and Rice University March 31, 1993 Purpose ======= CSPSV computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N symmetric matrix stored in packed format and X and B are N-by-NRHS matrices. The diagonal pivoting method is used to factor A as A = U * D * U**T, if UPLO = 'U', or A = L * D * L**T, if UPLO = 'L', where U (or L) is a product of permutation and unit upper (lower) triangular matrices, D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks. The factored form of A is then used to solve the system of equations A * X = B. Arguments ========= UPLO (input) CHARACTER*1 = 'U': Upper triangle of A is stored; = 'L': Lower triangle of A is stored. N (input) INTEGER The number of linear equations, i.e., the order of the matrix A. N >= 0. NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0. AP (input/output) COMPLEX array, dimension (N*(N+1)/2) On entry, the upper or lower triangle of the symmetric matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows: if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j; if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n. See below for further details. On exit, the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**T or A = L*D*L**T as computed by CSPTRF, stored as a packed triangular matrix in the same storage format as A. IPIV (output) INTEGER array, dimension (N) Details of the interchanges and the block structure of D, as determined by CSPTRF. If IPIV(k) > 0, then rows and columns k and IPIV(k) were interchanged, and D(k,k) is a 1-by-1 diagonal block. If UPLO = 'U' and IPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and -IPIV(k) were interchanged and D(k-1:k,k-1:k) is a 2-by-2 diagonal block. If UPLO = 'L' and IPIV(k) = IPIV(k+1) < 0, then rows and columns k+1 and -IPIV(k) were interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block. B (input/output) COMPLEX array, dimension (LDB,NRHS) On entry, the N-by-NRHS right hand side matrix B. On exit, if INFO = 0, the N-by-NRHS solution matrix X. LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N). INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: if INFO = i, D(i,i) is exactly zero. The factorization has been completed, but the block diagonal matrix D is exactly singular, so the solution could not be computed. Further Details =============== The packed storage scheme is illustrated by the following example when N = 4, UPLO = 'U': Two-dimensional storage of the symmetric matrix A: a11 a12 a13 a14 a22 a23 a24 a33 a34 (aij = aji) //.........这里部分代码省略.........
开发者ID:deepakantony,项目名称:vispack,代码行数:101,
示例22: solarma::vec DIIS::get_w_diis_wrk(const arma::mat & errs) const { // Size of LA problem int N=(int) errs.n_cols; // DIIS weights arma::vec sol(N); sol.zeros(); if(c1diis) { // Original, Pulay's DIIS (C1-DIIS) // Array holding the errors arma::mat B(N+1,N+1); B.zeros(); // Compute errors for(int i=0;i<N;i++) for(int j=0;j<N;j++) { B(i,j)=arma::dot(errs.col(i),errs.col(j)); } // Fill in the rest of B for(int i=0;i<N;i++) { B(i,N)=-1.0; B(N,i)=-1.0; } // RHS vector arma::vec A(N+1); A.zeros(); A(N)=-1.0; // Solve B*X = A arma::vec X; bool succ; succ=arma::solve(X,B,A); if(succ) { // Solution is (last element of X is DIIS error) sol=X.subvec(0,N-1); // Check that weights are within tolerance if(arma::max(arma::abs(sol))>=MAXWEIGHT) { printf("Large coefficient produced by DIIS. Reducing to %i matrices./n",N-1); arma::vec w0=get_w_diis_wrk(errs.submat(1,1,errs.n_rows-1,errs.n_cols-1)); // Helper vector arma::vec w(N); w.zeros(); w.subvec(w.n_elem-w0.n_elem,w.n_elem-1)=w0; return w; } } if(!succ) { // Failed to invert matrix. Use the two last iterations instead. printf("C1-DIIS was not succesful, mixing matrices instead./n"); sol.zeros(); sol(0)=0.5; sol(1)=0.5; } } else { // C2-DIIS // Array holding the errors arma::mat B(N,N); B.zeros(); // Compute errors for(int i=0;i<N;i++) for(int j=0;j<N;j++) { B(i,j)=arma::dot(errs.col(i),errs.col(j)); } // Solve eigenvectors of B arma::mat Q; arma::vec lambda; eig_sym_ordered(lambda,Q,B); // Normalize weights for(int i=0;i<N;i++) { Q.col(i)/=arma::sum(Q.col(i)); } // Choose solution by picking out solution with smallest error arma::vec errors(N); arma::mat eQ=errs*Q; // The weighted error is for(int i=0;i<N;i++) { errors(i)=arma::norm(eQ.col(i),2); } // Find minimal error double mine=DBL_MAX; int minloc=-1; for(int i=0;i<N;i++) { if(errors[i]<mine) { // Check weights bool ok=arma::max(arma::abs(Q.col(i)))<MAXWEIGHT; if(ok) { mine=errors(i); minloc=i;//.........这里部分代码省略.........
开发者ID:Monkey---Brainz,项目名称:erkale,代码行数:101,
示例23: fprint_sym_mt_stat fprint_sym_m (FILE *of, t_addr addr, t_value *val, UNIT *uptr, int32 sw){ uint16 op, arg1, arg2, arg3; int16 sarg; t_stat size = 0; int optype, sz; t_bool hexdec = (sw & SWMASK('H')) ? TRUE : FALSE; addr = ADDR_OFF(addr); op = val[0]; if (op > 0xe7) return SCPE_ARG; optype = optable[op].flags; if (optype > OP_ERROR) { fprintf(of,"%-8s", optable[op].name); switch (optype) { case OP_NULL: break; case OP_UB: size = 1; arg1 = UB(val[1]); print_hd(of, arg1, hexdec, FALSE); break; case OP_W: size = 2; sarg = W(val[1],val[2]); print_hd(of, sarg, hexdec, FALSE); break; case OP_AB: arg1 = B(val[1],val[2], &sz); size = sz; fprintf(of,"#%x", arg1*2); break; case OP_B: arg1 = B(val[1],val[2], &sz); size = sz; print_hd(of, arg1, hexdec, FALSE); break; case OP_DBB: arg1 = DB(val[1]); arg2 = B(val[2],val[3], &sz); size = sz+1; print_hd(of, arg1, hexdec, TRUE); fputc(',',of); print_hd(of, arg2, hexdec, FALSE); break; case OP_UBB: arg1 = UB(val[1]); arg2 = B(val[2],val[3], &sz); size = sz+1; print_hd(of, arg1, hexdec, TRUE); fputc(',',of); print_hd(of, arg2, hexdec, FALSE); break; case OP_BUB: arg1 = B(val[1],val[2], &sz); size = sz+1; arg2 = UB(val[sz+1]); print_hd(of, arg1, hexdec, FALSE); fputc(',',of); print_hd(of, arg2, hexdec, TRUE); break; case OP_SB: size = 1; sarg = SB(val[1]); fprintf(of,"#%x", addr+sarg+2); break; case OP_SW: size = 2; sarg = SW(val[1],val[2]); fprintf(of,"#%x", addr+sarg+3); break; case OP_DBUB: size = 2; arg1 = DB(val[1]); arg2 = UB(val[2]); print_hd(of, arg1, hexdec, TRUE); fputc(',',of); print_hd(of, arg2, hexdec, TRUE); break; case OP_UBUB: size = 2; arg1 = UB(val[1]); arg2 = UB(val[2]); print_hd(of, arg1, hexdec, TRUE); fputc(',',of); print_hd(of, arg2, hexdec, TRUE); break; case OP_UBDBUB: size = 3; arg1 = UB(val[1]); arg2 = DB(val[2]); arg3 = UB(val[3]); print_hd(of, arg1, hexdec, TRUE); fputc(',',of); print_hd(of, arg2, hexdec, TRUE); fputc(',',of); print_hd(of, arg3, hexdec, TRUE); break; case OP_DB: size = 1; arg1 = DB(val[1]); print_hd(of, arg1, hexdec, TRUE); break; } return -size; } else { fprintf(of,"%-8s","DB"); print_hd(of, op, hexdec, TRUE); return SCPE_OK; }}
开发者ID:ChristineTham,项目名称:simh,代码行数:92,
示例24: instvoid armv7a::decode_msrhints(armv7a_ir& inst){ uint32_t op = inst(22); uint32_t op1 = inst(19, 16); uint32_t op2 = inst(7, 0); bool op_0 = op == 0; bool op_1 = op == 1; bool op1_0000 = (op1 & B(1111)) == B(0000); bool op1_0100 = (op1 & B(1111)) == B(0100); bool op1_1x00 = (op1 & B(1011)) == B(1000); bool op1_xx01 = (op1 & B(0011)) == B(0001); bool op1_xx1x = (op1 & B(0010)) == B(0010); bool op2_0000_0000 = (op2 & B(1111 1111)) == B(0000 0000); bool op2_0000_0001 = (op2 & B(1111 1111)) == B(0000 0001); bool op2_0000_0010 = (op2 & B(1111 1111)) == B(0000 0010); bool op2_0000_0011 = (op2 & B(1111 1111)) == B(0000 0011); bool op2_0000_0100 = (op2 & B(1111 1111)) == B(0000 0100); bool op2_1111_xxxx = (op2 & B(1111 0000)) == B(1111 0000); if(op_0 && op1_0000 && op2_0000_0000) { arm_nop(inst); } else if(op_0 && op1_0000 && op2_0000_0001) { arm_yield(inst); } else if(op_0 && op1_0000 && op2_0000_0010) { arm_wfe(inst); } else if(op_0 && op1_0000 && op2_0000_0011) { arm_wfi(inst); } else if(op_0 && op1_0000 && op2_0000_0100) { arm_sev(inst); } else if(op_0 && op1_0000 && op2_1111_xxxx) { arm_dbg(inst); } else if(op_0 && op1_0100) { arm_msr_imm_ap(inst); } else if(op_0 && op1_1x00) { arm_msr_imm_ap(inst); } else if(op_0 && op1_xx01) { arm_msr_imm_sys(inst); } else if(op_0 && op1_xx1x) { arm_msr_imm_sys(inst); } else if(op_1) { arm_msr_imm_sys(inst); } else { printb(core_id, d_armv7a_decode_msrhints, "decode error: 0x%X, pc=%X", inst.val, rf.current_pc()); }}
开发者ID:ufoderek,项目名称:mvp,代码行数:79,
示例25: m3dMatrixMultiply// Ditto above, but for doublesvoid m3dMatrixMultiply(M3DMatrix44d product, const M3DMatrix44d a, const M3DMatrix44d b ){ for (int i = 0; i < 4; i++) { double ai0=A(i,0), ai1=A(i,1), ai2=A(i,2), ai3=A(i,3); P(i,0) = ai0 * B(0,0) + ai1 * B(1,0) + ai2 * B(2,0) + ai3 * B(3,0); P(i,1) = ai0 * B(0,1) + ai1 * B(1,1) + ai2 * B(2,1) + ai3 * B(3,1); P(i,2) = ai0 * B(0,2) + ai1 * B(1,2) + ai2 * B(2,2) + ai3 * B(3,2); P(i,3) = ai0 * B(0,3) + ai1 * B(1,3) + ai2 * B(2,3) + ai3 * B(3,3); }}
开发者ID:amatveyakin,项目名称:cubricate,代码行数:11,
示例26: Bvoid armv7a::arm_nop(armv7a_ir& inst){ inst.print_inst("arm_nop"); inst.check(27, 16, B(0011 0010 0000)); inst.check(15, 0, B(1111 0000 0000 0000));}
开发者ID:ufoderek,项目名称:mvp,代码行数:6,
示例27: XmlReader_constXmlLang/* @method String XmlReader.constXmlLang() */METHOD XmlReader_constXmlLang(Ctx *ctx, knh_sfp_t *sfp){ xmlTextReaderPtr reader = (xmlTextReaderPtr) p_cptr(sfp[0]); char* ret = (char*) xmlTextReaderConstXmlLang(reader); KNH_RETURN(ctx,sfp,new_String(ctx,B(ret),NULL));}
开发者ID:matsuu,项目名称:konoha,代码行数:7,
示例28: instvoid armv7a::decode_media(armv7a_ir& inst){ uint32_t op1 = inst(24, 20); uint32_t rd = inst(15, 12); uint32_t op2 = inst(7, 5); uint32_t rn = inst(3, 0); bool op1_000xx = (op1 & B(11100)) == B(00000); bool op1_001xx = (op1 & B(11100)) == B(00100); bool op1_01xxx = (op1 & B(11000)) == B(01000); bool op1_10xxx = (op1 & B(11000)) == B(01000); bool op1_11000 = (op1 & B(11111)) == B(11000); bool op1_1101x = (op1 & B(11110)) == B(11010); bool op1_1110x = (op1 & B(11110)) == B(11100); bool op1_1111x = (op1 & B(11110)) == B(11110); bool op1_11111 = (op1 & B(11111)) == B(11111); bool op2_000 = (op2 & B(111)) == B(000); bool op2_x10 = (op2 & B(011)) == B(010); bool op2_x00 = (op2 & B(011)) == B(000); bool op2_111 = (op2 & B(111)) == B(111); bool rd_1111 = rd == B(1111); bool rn_1111 = rn == B(1111); if(op1_000xx) { decode_paddsub_s(inst); } else if(op1_001xx) { decode_paddsub_us(inst); } else if(op1_01xxx) { decode_pack_satrev(inst); } else if(op1_10xxx) { decode_smul(inst); } else if(op1_11000 && op2_000 && rd_1111) { arm_usad8(inst); } else if(op1_11000 && op2_000 && !rd_1111) { arm_usada8(inst); } else if(op1_1101x && op2_x10) { arm_sbfx(inst); } else if(op1_1110x && op2_x00 && rn_1111) { arm_bfc(inst); } else if(op1_1110x && op2_x00 && !rn_1111) { arm_bfi(inst); } else if(op1_1111x && op2_x10) { arm_ubfx(inst); } else if(op1_11111 && op2_111) { decode_undef(inst); } else { printb(core_id, d_armv7a_decode_media, "decode error"); }}
开发者ID:ufoderek,项目名称:mvp,代码行数:82,
注:本文中的B函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ B0函数代码示例 C++ Axpy函数代码示例 |