// Don't crash here. void f() { X x = X(); (void)noexcept(B(declval<B>())); }
bool 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);*/ } } } if (!buffer->init(device, D3D11_USAGE_DEFAULT, sizeof(VertexType) * vertexCount, vertices, sizeof(unsigned long) * indexCount, indices)) { delete []vertices; delete []indices; delete buffer; return false; } if (dico->getBuffer("__field", 0, buffer) == nullptr) { delete []vertices; delete []indices; delete buffer; return false; } delete []vertices; delete []indices; return true; }
int 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; /* Debugging: check residuals || A*x - lambda*x || */ y = (real*) opsec_calloc(nloc, sizeof(real)); for(i = iparam[4]-1; i >= 0; i--) { static char trans = 'T'; static int incx = 1; static int incy = 1; static real alpha = 1.0; static real beta = 0.0; real a = -evals[i]; ierr = MPI_Allgatherv(&evecs[i*nloc], nloc, REAL_MPI_TYPE, xfull, locsizes, locdisps, REAL_MPI_TYPE, MPI_COMM_WORLD); blas_gemv(&trans, &n, &nloc, &alpha, A, &n, xfull, &incx, &beta, y, &incy); blas_axpy(&nloc, &a, &evecs[i*nloc], &incx, y, &incy); real d = parpack_pnorm2(&fcomm, &nloc, y, &incy); if(myid == 0) printf("Eigenvalue %d: lambda = %16.16f, |A*x - lambda*x| = %16.16f\n", iparam[4]-i, evals[i], d); ierr = MPI_Allgatherv(y, nloc, REAL_MPI_TYPE, xfull, locsizes, locdisps, REAL_MPI_TYPE, MPI_COMM_WORLD); } free(y); } #endif #if 0 /* Sort from largest to smallest eigenvalue */ for(int j = 0; j < nconv/2; j++) { std::swap(evals[j], evals[nconv-j-1]); memcpy(workd, &B(0,j), nloc*sizeof(real)); memcpy(&B(0,j), &B(0,nconv-j-1), nloc*sizeof(real)); memcpy(&B(0,nconv-j-1), workd, nloc*sizeof(real)); } #endif /* Clean up */ free(workl); free(workd); free(resid); free(select); return nconv; }
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 ), true, CalculateStiffnessMatrixFlag, true ); //calculating operator B CalculateB( B, F, DN_DX, StrainVector.size() ); //calculating weights for integration on the reference configuration double IntToReferenceWeight = integration_points[PointNumber].Weight() * mDetJ0[PointNumber]; if ( dim == 2 ) IntToReferenceWeight *= GetProperties()[THICKNESS]; if ( CalculateStiffnessMatrixFlag == true ) //calculation of the matrix is required { //contributions to stiffness matrix calculated on the reference config noalias( rLeftHandSideMatrix ) += prod( trans( B ), ( IntToReferenceWeight ) * Matrix( prod( D, B ) ) ); //to be optimized to remove the temporary CalculateAndAddKg( rLeftHandSideMatrix, DN_DX, StressVector, IntToReferenceWeight ); } if ( CalculateResidualVectorFlag == true ) //calculation of the matrix is required { //contribution to external forces BodyForce = GetProperties()[BODY_FORCE]; // operation performed: rRightHandSideVector += ExtForce*IntToReferenceWeight CalculateAndAdd_ExtForceContribution( row( Ncontainer, PointNumber ), rCurrentProcessInfo, BodyForce, rRightHandSideVector, IntToReferenceWeight ); // operation performed: rRightHandSideVector -= IntForce*IntToReferenceWeight noalias( rRightHandSideVector ) -= IntToReferenceWeight * prod( trans( B ), StressVector ); } } KRATOS_CATCH( "" ) }
static void panel_eid_fixup(uint16_t *mfr_name, uint16_t *product_code) { B("%s: enter.\n", __func__); *mfr_name = 0x0101; *product_code = 0x0; }
struct A; struct B { operator A(); }; struct A { A(A const&){} }; A a{B()};
/** 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_t magma_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)) { *info = -7; } if (*info != 0) { magma_xerbla( __func__, -(*info) ); return *info; } /* Quick return */ if ( n == 0 ) return *info; if (MAGMA_SUCCESS != magma_cmalloc( &dw, 2*n*n )) { *info = MAGMA_ERR_DEVICE_ALLOC; return *info; } nb = magma_get_chegst_nb(n); magma_queue_t stream[2]; magma_queue_create( &stream[0] ); magma_queue_create( &stream[1] ); magma_csetmatrix( n, n, A(0, 0), lda, dA(0, 0), ldda ); magma_csetmatrix( n, n, B(0, 0), ldb, dB(0, 0), lddb ); /* Use hybrid blocked code */ if (itype == 1) { if (upper) { /* Compute inv(U')*A*inv(U) */ for (k = 0; k < n; k += nb) { kb = min(n-k,nb); kb2= min(n-k-nb,nb); /* Update the upper triangle of A(k:n,k:n) */ lapackf77_chegst( &itype, uplo_, &kb, A(k,k), &lda, B(k,k), &ldb, info); magma_csetmatrix_async( kb, kb, A(k, k), lda, dA(k, k), ldda, stream[0] ); if (k+kb < n) { magma_ctrsm(MagmaLeft, MagmaUpper, MagmaConjTrans, MagmaNonUnit, kb, n-k-kb, c_one, dB(k,k), lddb, dA(k,k+kb), ldda); magma_queue_sync( stream[0] ); magma_chemm(MagmaLeft, MagmaUpper, kb, n-k-kb, c_neg_half, dA(k,k), ldda, dB(k,k+kb), lddb, c_one, dA(k, k+kb), ldda); magma_cher2k(MagmaUpper, MagmaConjTrans, n-k-kb, kb, c_neg_one, dA(k,k+kb), ldda, dB(k,k+kb), lddb, d_one, dA(k+kb,k+kb), ldda); magma_cgetmatrix_async( kb2, kb2, dA(k+kb, k+kb), ldda, A(k+kb, k+kb), lda, stream[1] ); magma_chemm(MagmaLeft, MagmaUpper, kb, n-k-kb, c_neg_half, dA(k,k), ldda, dB(k,k+kb), lddb, c_one, dA(k, k+kb), ldda); magma_ctrsm(MagmaRight, MagmaUpper, MagmaNoTrans, MagmaNonUnit, kb, n-k-kb, c_one, dB(k+kb,k+kb), lddb, dA(k,k+kb), ldda); magma_queue_sync( stream[1] ); } } magma_queue_sync( stream[0] ); } else { /* Compute inv(L)*A*inv(L') */ for (k = 0; k < n; k += nb) { kb= min(n-k,nb); kb2= min(n-k-nb,nb); /* Update the lower triangle of A(k:n,k:n) */ lapackf77_chegst( &itype, uplo_, &kb, A(k,k), &lda, B(k,k), &ldb, info); magma_csetmatrix_async( kb, kb, A(k, k), lda, dA(k, k), ldda, stream[0] ); if (k+kb < n) { magma_ctrsm(MagmaRight, MagmaLower, MagmaConjTrans, MagmaNonUnit, n-k-kb, kb, c_one, dB(k,k), lddb, dA(k+kb,k), ldda); magma_queue_sync( stream[0] ); magma_chemm(MagmaRight, MagmaLower, n-k-kb, kb, c_neg_half, dA(k,k), ldda, dB(k+kb,k), lddb, c_one, dA(k+kb, k), ldda); magma_cher2k(MagmaLower, MagmaNoTrans, n-k-kb, kb, c_neg_one, dA(k+kb,k), ldda, dB(k+kb,k), lddb, d_one, dA(k+kb,k+kb), ldda); magma_cgetmatrix_async( kb2, kb2, dA(k+kb, k+kb), ldda, A(k+kb, k+kb), lda, stream[1] ); magma_chemm(MagmaRight, MagmaLower, n-k-kb, kb, c_neg_half, dA(k,k), ldda, dB(k+kb,k), lddb, c_one, dA(k+kb, k), ldda); magma_ctrsm(MagmaLeft, MagmaLower, MagmaNoTrans, MagmaNonUnit, n-k-kb, kb, c_one, dB(k+kb,k+kb), lddb, dA(k+kb,k), ldda); } magma_queue_sync( stream[1] ); } } magma_queue_sync( stream[0] ); } else { if (upper) { /* Compute U*A*U' */ for (k = 0; k < n; k += nb) { kb= min(n-k,nb); magma_cgetmatrix_async( kb, kb, dA(k, k), ldda, A(k, k), lda, stream[0] ); /* Update the upper triangle of A(1:k+kb-1,1:k+kb-1) */ if (k > 0) { magma_ctrmm(MagmaLeft, MagmaUpper, MagmaNoTrans, MagmaNonUnit, k, kb, c_one, dB(0,0), lddb, dA(0,k), ldda); magma_chemm(MagmaRight, MagmaUpper, k, kb, c_half, dA(k,k), ldda, dB(0,k), lddb, c_one, dA(0, k), ldda); magma_queue_sync( stream[1] ); magma_cher2k(MagmaUpper, MagmaNoTrans, k, kb, c_one, dA(0,k), ldda, dB(0,k), lddb, d_one, dA(0,0), ldda); magma_chemm(MagmaRight, MagmaUpper, k, kb, c_half, dA(k,k), ldda, dB(0,k), lddb, c_one, dA(0, k), ldda); magma_ctrmm(MagmaRight, MagmaUpper, MagmaConjTrans, MagmaNonUnit, k, kb, c_one, dB(k,k), lddb, dA(0,k), ldda); } magma_queue_sync( stream[0] ); lapackf77_chegst( &itype, uplo_, &kb, A(k, k), &lda, B(k, k), &ldb, info); magma_csetmatrix_async( kb, kb, A(k, k), lda, dA(k, k), ldda, stream[1] ); } magma_queue_sync( stream[1] ); } else { /* Compute L'*A*L */ for (k = 0; k < n; k += nb) { kb= min(n-k,nb); magma_cgetmatrix_async( kb, kb, dA(k, k), ldda, A(k, k), lda, stream[0] ); /* Update the lower triangle of A(1:k+kb-1,1:k+kb-1) */ if (k > 0) { magma_ctrmm(MagmaRight, MagmaLower, MagmaNoTrans, MagmaNonUnit, kb, k, c_one, dB(0,0), lddb, dA(k,0), ldda); magma_chemm(MagmaLeft, MagmaLower, kb, k, c_half, dA(k,k), ldda, dB(k,0), lddb, c_one, dA(k, 0), ldda); magma_queue_sync( stream[1] ); magma_cher2k(MagmaLower, MagmaConjTrans, k, kb, c_one, dA(k,0), ldda, dB(k,0), lddb, d_one, dA(0,0), ldda); magma_chemm(MagmaLeft, MagmaLower, kb, k, c_half, dA(k,k), ldda, dB(k,0), lddb, c_one, dA(k, 0), ldda); magma_ctrmm(MagmaLeft, MagmaLower, MagmaConjTrans, MagmaNonUnit, kb, k, c_one, dB(k,k), lddb, dA(k,0), ldda); } magma_queue_sync( stream[0] ); lapackf77_chegst( &itype, uplo_, &kb, A(k,k), &lda, B(k,k), &ldb, info); magma_csetmatrix_async( kb, kb, A(k, k), lda, dA(k, k), ldda, stream[1] ); } magma_queue_sync( stream[1] ); } } magma_cgetmatrix( n, n, dA(0, 0), ldda, A(0, 0), lda ); magma_queue_destroy( stream[0] ); magma_queue_destroy( stream[1] ); magma_free( dw ); return *info; } /* magma_chegst_gpu */
#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);
int A(int x) { int arr[5]; return B(arr[4]); }
int 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) { printf("Number of ranks = %d\n", Num_procs); printf("Rank grid = %d rows x %d columns\n", nprow, npcol); printf("Matrix order = %d\n", order); printf("Outer block size = %ld\n", nb); printf("Number of iterations = %d\n", iterations); if (inner_block_flag) printf("Using local dgemm blocking\n"); else printf("No local dgemm blocking\n"); if (shortcut) printf("Only doing initialization\n"); } /* set up row and column communicators */ ranks = (int *) prk_malloc (3*Num_procs*sizeof(int)); if (!ranks) { printf("ERROR: Proc %d could not allocate rank work arrays\n", my_ID); error = 1; } bail_out(error); mm = ranks + Num_procs; nn = mm + Num_procs; /* 1. extract group of ranks that make up WORLD */ MPI_Comm_group( MPI_COMM_WORLD, &world_group ); /* 2. create list of all ranks in same row of rank grid */ ranks[0] = my_ID/npcol * npcol; for (int i=1; i<npcol; i++) ranks[i] = ranks[i-1] + 1; /* create row group and communicator */ MPI_Group_incl( world_group, npcol, ranks, &temp_group ); MPI_Comm_create( MPI_COMM_WORLD, temp_group, &comm_row ); /* 3. create list of all ranks in same column of rank grid */ ranks[0] = my_ID%npcol; for (int i=1; i<nprow; i++) ranks[i] = ranks[i-1] + npcol; /* create column group and communicator */ MPI_Group_incl( world_group, nprow, ranks, &temp_group ); MPI_Comm_create( MPI_COMM_WORLD, temp_group, &comm_col ); /* extract this node's row and column index */ MPI_Comm_rank( comm_row, &mycol ); MPI_Comm_rank( comm_col, &myrow ); /* mynrows = number of rows assigned to me; distribute excess rows evenly if nprow does not divide matrix order evenly */ if (myrow < order%nprow) mynrows = (order/nprow)+1; else mynrows = (order/nprow); /* make sure lda is a multiple of the block size nb */ if (mynrows%nb==0 || mynrows<nb) lda = mynrows; else lda = (mynrows/nb+1)*nb; /* myncols = number of colums assigned to me; distribute excess columns evenly if npcol does not divide order evenly */ if (mycol < order%npcol) myncols = (order/npcol)+1; else myncols = (order/npcol); /* get space for local blocks of A, B, C */ a = (double *) prk_malloc( lda*myncols*sizeof(double) ); b = (double *) prk_malloc( lda*myncols*sizeof(double) ); c = (double *) prk_malloc( lda*myncols*sizeof(double) ); if ( a == NULL || b == NULL || c == NULL ) { error = 1; printf("ERROR: Proc %d could not allocate a, b, and/or c\n",my_ID); } bail_out(error); /* get space for two work arrays for dgemm */ work1 = (double *) prk_malloc( nb*lda*sizeof(double) ); work2 = (double *) prk_malloc( nb*myncols*sizeof(double) ); if ( !work1 || !work2 ) { printf("ERROR: Proc %d could not allocate work buffers\n", my_ID); error = 1; } bail_out(error); /* collect array that holds mynrows from all nodes in my row of the rank grid (array of all m_i) */ MPI_Allgather( &mynrows, 1, MPI_INT, mm, 1, MPI_INT, comm_col ); /* myfrow = first row on my node */ myfrow=1; for (int i=0; i<myrow; i++) myfrow += mm[i]; mylrow = myfrow+mynrows-1; /* collect array that holds myncols from all nodes in my column of the rank grid (array of all n_j) */ MPI_Allgather( &myncols, 1, MPI_INT, nn, 1, MPI_INT, comm_row ); /* myfcol = first col on my node */ myfcol=1; for (int i=0; i<mycol; i++) myfcol += nn[i]; mylcol = myfcol+myncols-1; /* initialize matrices A, B, and C */ ldc = ldb = lda; for (int jj=0, j=myfcol; j<=mylcol; j++,jj++ ) for (int ii=0, i=myfrow; i<=mylrow; i++, ii++ ) { A(ii,jj) = (double) (j-1); B(ii,jj) = (double) (j-1); C(ii,jj) = 0.0; } if (shortcut) { MPI_Finalize(); exit(EXIT_SUCCESS); } for (iter=0; iter<=iterations; iter++) { /* start timer after a warmup iteration */ if (iter == 1) { MPI_Barrier(MPI_COMM_WORLD); local_dgemm_time = wtime(); } /* actual matrix-vector multiply */ dgemm(order, nb, inner_block_flag, a, lda, b, lda, c, lda, mm, nn, comm_row, comm_col, work1, work2 ); } /* end of iterations */ local_dgemm_time = wtime() - local_dgemm_time; MPI_Reduce(&local_dgemm_time, &dgemm_time, 1, MPI_DOUBLE, MPI_MAX, root, MPI_COMM_WORLD); /* verification test */ for (int jj=0, j=myfcol; j<=mylcol; j++, jj++) for (int ii=0, i=myfrow; i<=mylrow; i++, ii++) checksum_local += C(ii,jj); MPI_Reduce(&checksum_local, &checksum, 1, MPI_DOUBLE, MPI_SUM, root, MPI_COMM_WORLD); forder = (double) order; ref_checksum = (0.25*forder*forder*forder*(forder-1.0)*(forder-1.0)); ref_checksum *= (iterations+1); if (my_ID == root) { if (ABS((checksum - ref_checksum)/ref_checksum) > epsilon) { printf("ERROR: Checksum = %lf, Reference checksum = %lf\n", checksum, ref_checksum); error = 1; } else { printf("Solution validates\n"); #if VERBOSE printf("Reference checksum = %lf, checksum = %lf\n", ref_checksum, checksum); #endif } } bail_out(error); /* report elapsed time */ nflops = 2.0*forder*forder*forder; if ( my_ID == root ) { avgtime = dgemm_time/iterations; printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", 1.0E-06 * nflops/avgtime, avgtime); } MPI_Finalize(); }
unsigned 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 else return 13; // surface 023 } else { return 5; // edge 20 } } else { if (w == 1) return 8; // vertex 3 else return 9; // edge 30 } } return 0; }
static void matmul4( GLdouble *product, const GLdouble *a, const GLdouble *b ) { GLint i; for (i = 0; i < 4; i++) { GLfloat 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); } }
extern "C" magma_int_t magma_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 ) return *info; nb = magma_get_zhegst_nb(n); lda = nb; ldb = nb; if (MAGMA_SUCCESS != magma_zmalloc_pinned( &w, 2*nb*nb )) { *info = MAGMA_ERR_DEVICE_ALLOC; return *info; } cudaStream_t stream[3]; magma_queue_create( &stream[0] ); magma_queue_create( &stream[1] ); magma_queue_create( &stream[2] ); /* Use hybrid blocked code */ if (itype==1) { if (upper) { kb = min(n,nb); /* Compute inv(U')*A*inv(U) */ magma_zgetmatrix_async( kb, kb, dB(0, 0), lddb, B(0, 0), nb, stream[2] ); magma_zgetmatrix_async( kb, kb, dA(0, 0), ldda, A(0, 0), nb, stream[1] ); for(k = 0; k<n; k+=nb){ kb = min(n-k,nb); kb2= min(n-k-nb,nb); /* Update the upper triangle of A(k:n,k:n) */ magma_queue_sync( stream[2] ); magma_queue_sync( stream[1] ); lapackf77_zhegs2( &itype, uplo_, &kb, A(0,0), &lda, B(0,0), &ldb, info); magma_zsetmatrix_async( kb, kb, A(0, 0), lda, dA(k, k), ldda, stream[0] ); if(k+kb<n){ // Start copying the new B block magma_zgetmatrix_async( kb2, kb2, dB(k+kb, k+kb), lddb, B(0, 0), nb, stream[2] ); magma_ztrsm(MagmaLeft, MagmaUpper, MagmaConjTrans, MagmaNonUnit, kb, n-k-kb, c_one, dB(k,k), lddb, dA(k,k+kb), ldda); magma_queue_sync( stream[0] ); magma_zhemm(MagmaLeft, MagmaUpper, kb, n-k-kb, c_neg_half, dA(k,k), ldda, dB(k,k+kb), lddb, c_one, dA(k, k+kb), ldda); magma_zher2k(MagmaUpper, MagmaConjTrans, n-k-kb, kb, c_neg_one, dA(k,k+kb), ldda, dB(k,k+kb), lddb, d_one, dA(k+kb,k+kb), ldda); magma_zgetmatrix_async( kb2, kb2, dA(k+kb, k+kb), ldda, A(0, 0), lda, stream[1] ); magma_zhemm(MagmaLeft, MagmaUpper, kb, n-k-kb, c_neg_half, dA(k,k), ldda, dB(k,k+kb), lddb, c_one, dA(k, k+kb), ldda); magma_ztrsm(MagmaRight, MagmaUpper, MagmaNoTrans, MagmaNonUnit, kb, n-k-kb, c_one ,dB(k+kb,k+kb), lddb, dA(k,k+kb), ldda); } } magma_queue_sync( stream[0] ); } else { kb = min(n,nb); /* Compute inv(L)*A*inv(L') */ magma_zgetmatrix_async( kb, kb, dB(0, 0), lddb, B(0, 0), nb, stream[2] ); magma_zgetmatrix_async( kb, kb, dA(0, 0), ldda, A(0, 0), nb, stream[1] ); for(k = 0; k<n; k+=nb){ kb= min(n-k,nb); kb2= min(n-k-nb,nb); /* Update the lower triangle of A(k:n,k:n) */ magma_queue_sync( stream[2] ); magma_queue_sync( stream[1] ); lapackf77_zhegs2( &itype, uplo_, &kb, A(0, 0), &lda, B(0, 0), &ldb, info); magma_zsetmatrix_async( kb, kb, A(0, 0), lda, dA(k, k), ldda, stream[0] ); if(k+kb<n){ // Start copying the new B block magma_zgetmatrix_async( kb2, kb2, dB(k+kb, k+kb), lddb, B(0, 0), nb, stream[2] ); magma_ztrsm(MagmaRight, MagmaLower, MagmaConjTrans, MagmaNonUnit, n-k-kb, kb, c_one, dB(k,k), lddb, dA(k+kb,k), ldda); magma_queue_sync( stream[0] ); magma_zhemm(MagmaRight, MagmaLower, n-k-kb, kb, c_neg_half, dA(k,k), ldda, dB(k+kb,k), lddb, c_one, dA(k+kb, k), ldda); magma_zher2k(MagmaLower, MagmaNoTrans, n-k-kb, kb, c_neg_one, dA(k+kb,k), ldda, dB(k+kb,k), lddb, d_one, dA(k+kb,k+kb), ldda); magma_zgetmatrix_async( kb2, kb2, dA(k+kb, k+kb), ldda, A(0, 0), lda, stream[1] ); magma_zhemm(MagmaRight, MagmaLower, n-k-kb, kb, c_neg_half, dA(k,k), ldda, dB(k+kb,k), lddb, c_one, dA(k+kb, k), ldda); magma_ztrsm(MagmaLeft, MagmaLower, MagmaNoTrans, MagmaNonUnit, n-k-kb, kb, c_one, dB(k+kb,k+kb), lddb, dA(k+kb,k), ldda); } } } magma_queue_sync( stream[0] ); } else { if (upper) { /* Compute U*A*U' */ for(k = 0; k<n; k+=nb){ kb= min(n-k,nb); magma_zgetmatrix_async( kb, kb, dB(k, k), lddb, B(0, 0), nb, stream[2] ); /* Update the upper triangle of A(1:k+kb-1,1:k+kb-1) */ if(k>0){ magma_ztrmm(MagmaLeft, MagmaUpper, MagmaNoTrans, MagmaNonUnit, k, kb, c_one ,dB(0,0), lddb, dA(0,k), ldda); magma_zhemm(MagmaRight, MagmaUpper, k, kb, c_half, dA(k,k), ldda, dB(0,k), lddb, c_one, dA(0, k), ldda); magma_queue_sync( stream[1] ); } magma_zgetmatrix_async( kb, kb, dA(k, k), ldda, A(0, 0), lda, stream[0] ); if(k>0){ magma_zher2k(MagmaUpper, MagmaNoTrans, k, kb, c_one, dA(0,k), ldda, dB(0,k), lddb, d_one, dA(0,0), ldda); magma_zhemm(MagmaRight, MagmaUpper, k, kb, c_half, dA(k,k), ldda, dB(0,k), lddb, c_one, dA(0, k), ldda); magma_ztrmm(MagmaRight, MagmaUpper, MagmaConjTrans, MagmaNonUnit, k, kb, c_one, dB(k,k), lddb, dA(0,k), ldda); } magma_queue_sync( stream[2] ); magma_queue_sync( stream[0] ); lapackf77_zhegs2( &itype, uplo_, &kb, A(0, 0), &lda, B(0, 0), &ldb, info); magma_zsetmatrix_async( kb, kb, A(0, 0), lda, dA(k, k), ldda, stream[1] ); } magma_queue_sync( stream[1] ); } else { /* Compute L'*A*L */ for(k = 0; k<n; k+=nb){ kb= min(n-k,nb); magma_zgetmatrix_async( kb, kb, dB(k, k), lddb, B(0, 0), nb, stream[2] ); /* Update the lower triangle of A(1:k+kb-1,1:k+kb-1) */ if(k>0){ magma_ztrmm(MagmaRight, MagmaLower, MagmaNoTrans, MagmaNonUnit, kb, k, c_one ,dB(0,0), lddb, dA(k,0), ldda); magma_zhemm(MagmaLeft, MagmaLower, kb, k, c_half, dA(k,k), ldda, dB(k,0), lddb, c_one, dA(k, 0), ldda); magma_queue_sync( stream[1] ); } magma_zgetmatrix_async( kb, kb, dA(k, k), ldda, A(0, 0), lda, stream[0] ); if(k>0){ magma_zher2k(MagmaLower, MagmaConjTrans, k, kb, c_one, dA(k,0), ldda, dB(k,0), lddb, d_one, dA(0,0), ldda); magma_zhemm(MagmaLeft, MagmaLower, kb, k, c_half, dA(k,k), ldda, dB(k,0), lddb, c_one, dA(k, 0), ldda); magma_ztrmm(MagmaLeft, MagmaLower, MagmaConjTrans, MagmaNonUnit, kb, k, c_one, dB(k,k), lddb, dA(k,0), ldda); } magma_queue_sync( stream[2] ); magma_queue_sync( stream[0] ); lapackf77_zhegs2( &itype, uplo_, &kb, A(0, 0), &lda, B(0, 0), &ldb, info); magma_zsetmatrix_async( kb, kb, A(0, 0), lda, dA(k, k), ldda, stream[1] ); } magma_queue_sync( stream[1] ); } } magma_queue_destroy( stream[0] ); magma_queue_destroy( stream[1] ); magma_queue_destroy( stream[2] ); magma_free_pinned( w ); return *info; } /* magma_zhegst_gpu */
void foo (int) { struct B { virtual ~B() {} }; B(); }
/* Initialize module sx-obj2 */ void initialize_module_sx_obj2() { if (is_initialized) return; initialize_module_i_level_1(); initialize_module_sx_obj1(); eul_fast_table_set(eul_modules,"sx_obj2",(LispRef) sx_obj2_bindings); is_initialized = 1; { /* Declarations */ LispRef sym_1793, sym_1792, sym_1791, sym_1790, sym_1789, sym_1788, sym_1787, sym_1786, sym_1785, sym_1784, sym_1783, sym_1782, sym_1781, sym_1780, sym_1779, sym_1778, sym_1777, sym_1776, sym_1775, sym_1774, sym_1773, sym_1772, sym_1771, G001770, G001768, G001766, G001764, G001762, G001760, G001758, G001756, G001754, G001752, G001750, G001748, G001746, G001744, G001742, G001740, G001738, G001736, G001734, G001732, G001730, G001728, G001726, sym_1724, sym_1723, sym_1722, sym_1721, sym_1720, sym_1719, sym_1718, sym_1717, sym_1716, sym_1715, sym_1714, sym_1713, sym_1712, sym_1711, sym_1710, sym_1709, sym_1708, sym_1707, sym_1706, sym_1703, sym_1701, sym_1698, key_1697, sym_1696, sym_1695, sym_1694, sym_1691, key_1690, sym_1689, key_1688, sym_1687, sym_1686, key_1681, key_1680, key_1679, sym_1678, key_1677, sym_1676, key_1675, sym_1674, key_1673, sym_1672, key_1671, sym_1670, key_1669, sym_1668, key_1667, G001666, G001664, G001662, G001660, G001658, G001656, G001654, G001652, G001650, G001648, G001646, G001644, G001642, G001640, G001638, G001636, G001634, G001632, G001630, G001628, G001626, G001624, G001622, G001620, G001618, G001616, G001614, G001612, G001610, G001608; /* Code vector and literal definitions */ /* Byte-vector with size: 1 is_init: 0 index: 42 binding: (method-literal-const?) */ static const void *G001607[] = {I(aa,1b,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 43 binding: (method-literal-const?) */ static const void *G001609[] = {I(aa,86,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 44 binding: (method-named-const?) */ static const void *G001611[] = {I(aa,1b,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 45 binding: (method-named-const?) */ static const void *G001613[] = {I(aa,86,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 46 binding: (method-const?) */ static const void *G001615[] = {I(aa,1b,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 47 binding: (method-const?) */ static const void *G001617[] = {I(aa,86,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 48 binding: (method-setq?) */ static const void *G001619[] = {I(aa,1b,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 49 binding: (method-setq?) */ static const void *G001621[] = {I(aa,86,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 50 binding: (method-global-static-var?) */ static const void *G001623[] = {I(aa,1b,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 51 binding: (method-global-static-var?) */ static const void *G001625[] = {I(aa,86,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 52 binding: (method-global-var?) */ static const void *G001627[] = {I(aa,1b,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 53 binding: (method-global-var?) */ static const void *G001629[] = {I(aa,86,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 54 binding: (method-local-static-var?) */ static const void *G001631[] = {I(aa,1b,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 55 binding: (method-local-static-var?) */ static const void *G001633[] = {I(aa,86,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 56 binding: (method-local-var?) */ static const void *G001635[] = {I(aa,1b,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 57 binding: (method-local-var?) */ static const void *G001637[] = {I(aa,86,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 58 binding: (method-var?) */ static const void *G001639[] = {I(aa,1b,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 59 binding: (method-var?) */ static const void *G001641[] = {I(aa,86,45,01)}; /* Byte-vector with size: 1 is_init: 0 index: 60 binding: anonymous */ static const void *G001643[] = {I(a9,86,45,00)}; /* Byte-vector with size: 1 is_init: 0 index: 61 binding: anonymous */ static const void *G001645[] = {I(a9,86,45,00)}; /* Byte-vector with size: 1 is_init: 0 index: 62 binding: anonymous */ static const void *G001647[] = {I(a9,86,45,00)}; /* Byte-vector with size: 1 is_init: 0 index: 63 binding: anonymous */ static const void *G001649[] = {I(a9,86,45,00)}; /* 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! */ static const void *G001745[] = {I(ab,1c,84,1d),I(24,00,00,00),B(sx_obj2 ,11),I(09,45,02,00)}; /* Byte-vector with size: 3 is_init: 0 index: 135 binding: local-static-var-captured? */ static const void *G001747[] = {I(aa,82,24,00),B(sx_obj2 ,9),I(08,45,00,00)}; /* Byte-vector with size: 4 is_init: 0 index: 136 binding: var-used! */ static const void *G001749[] = {I(ab,1c,82,1d),I(24,00,00,00),B(sx_obj2 ,11),I(09,45,02,00)}; /* Byte-vector with size: 4 is_init: 0 index: 137 binding: const-value! */ static const void *G001751[] = {I(ab,1c,82,1d),I(24,00,00,00),B(sx_obj2 ,29),I(09,45,02,00)}; /* Byte-vector with size: 4 is_init: 0 index: 138 binding: var-name! */ static const void *G001753[] = {I(ab,1c,8a,03),I(1d,24,00,00),B(sx_obj2 ,11),I(09,45,02,00)}; /* Byte-vector with size: 3 is_init: 0 index: 139 binding: var-value? */ static const void *G001755[] = {I(aa,83,24,00),B(sx_obj2 ,11),I(08,45,00,00)}; /* Byte-vector with size: 3 is_init: 0 index: 140 binding: setq-binding? */ static const void *G001757[] = {I(aa,83,24,00),B(sx_obj2 ,25),I(08,45,00,00)}; /* Byte-vector with size: 4 is_init: 0 index: 141 binding: local-static-var-captured! */ static const void *G001759[] = {I(ab,1c,82,1d),I(24,00,00,00),B(sx_obj2 ,9),I(09,45,02,00)}; /* Byte-vector with size: 3 is_init: 0 index: 142 binding: var-binding? */ static const void *G001761[] = {I(aa,84,24,00),B(sx_obj2 ,11),I(08,45,00,00)}; /* Byte-vector with size: 3 is_init: 0 index: 143 binding: named-const-binding? */ static const void *G001763[] = {I(aa,82,24,00),B(sx_obj2 ,22),I(08,45,00,00)}; /* Byte-vector with size: 3 is_init: 0 index: 144 binding: local-static-var-lambda? */ static const void *G001765[] = {I(aa,83,24,00),B(sx_obj2 ,9),I(08,45,00,00)}; /* Byte-vector with size: 4 is_init: 0 index: 145 binding: named-const-binding! */ static const void *G001767[] = {I(ab,1c,82,1d),I(24,00,00,00),B(sx_obj2 ,22),I(09,45,02,00)}; /* Byte-vector with size: 186 is_init: 1 index: 0 binding: initialize-sx-obj2 */ static const void *G001769[] = {I(87,25,00,00),B(sx_obj2 ,1),I(24,00,00,00),B(sx_obj1 ,1),I(3e,0b,24,00),B(sx_obj1 ,0),I(3c,00,21,01),I(24,00,00,00),B(i_level_1 ,1),I(3e,0b,24,00),B(i_level_1 ,0),I(3c,00,21,01),I(23,00,00,00),B(sx_obj2 ,146),I(23,00,00,00),B(sx_obj2 ,145),I(3b,02,25,00),B(sx_obj2 ,41),I(86,25,00,00),B(sx_obj2 ,40),I(23,00,00,00),B(sx_obj2 ,147),I(23,00,00,00),B(sx_obj2 ,144),I(3b,01,25,00),B(sx_obj2 ,39),I(23,00,00,00),B(sx_obj2 ,148),I(23,00,00,00),B(sx_obj2 ,143),I(3b,01,25,00),B(sx_obj2 ,38),I(23,00,00,00),B(sx_obj2 ,149),I(23,00,00,00),B(sx_obj2 ,142),I(3b,01,25,00),B(sx_obj2 ,37),I(23,00,00,00),B(sx_obj2 ,150),I(23,00,00,00),B(sx_obj2 ,141),I(3b,02,25,00),B(sx_obj2 ,36),I(23,00,00,00),B(sx_obj2 ,151),I(23,00,00,00),B(sx_obj2 ,140),I(3b,01,25,00),B(sx_obj2 ,35),I(23,00,00,00),B(sx_obj2 ,152),I(23,00,00,00),B(sx_obj2 ,139),I(3b,01,25,00),B(sx_obj2 ,34),I(86,25,00,00),B(sx_obj2 ,33),I(86,25,00,00),B(sx_obj2 ,32),I(86,25,00,00),B(sx_obj2 ,31),I(23,00,00,00),B(sx_obj2 ,153),I(23,00,00,00),B(sx_obj2 ,138),I(3b,02,25,00),B(sx_obj2 ,30),I(86,25,00,00),B(sx_obj2 ,29),I(86,25,00,00),B(sx_obj2 ,28),I(23,00,00,00),B(sx_obj2 ,154),I(23,00,00,00),B(sx_obj2 ,137),I(3b,02,25,00),B(sx_obj2 ,27),I(23,00,00,00),B(sx_obj2 ,155),I(23,00,00,00),B(sx_obj2 ,136),I(3b,02,25,00),B(sx_obj2 ,26),I(86,25,00,00),B(sx_obj2 ,25),I(86,25,00,00),B(sx_obj2 ,24),I(23,00,00,00),B(sx_obj2 ,156),I(23,00,00,00),B(sx_obj2 ,135),I(3b,01,25,00),B(sx_obj2 ,23),I(86,25,00,00),B(sx_obj2 ,22),I(23,00,00,00),B(sx_obj2 ,157),I(23,00,00,00),B(sx_obj2 ,134),I(3b,02,25,00),B(sx_obj2 ,21),I(23,00,00,00),B(sx_obj2 ,158),I(23,00,00,00),B(sx_obj2 ,133),I(3b,02,25,00),B(sx_obj2 ,20),I(23,00,00,00),B(sx_obj2 ,159),I(23,00,00,00),B(sx_obj2 ,132),I(3b,01,25,00),B(sx_obj2 ,19),I(86,25,00,00),B(sx_obj2 ,18),I(86,25,00,00),B(sx_obj2 ,17),I(23,00,00,00),B(sx_obj2 ,160),I(23,00,00,00),B(sx_obj2 ,131),I(3b,02,25,00),B(sx_obj2 ,16),I(23,00,00,00),B(sx_obj2 ,161),I(23,00,00,00),B(sx_obj2 ,130),I(3b,01,25,00),B(sx_obj2 ,15),I(86,25,00,00),B(sx_obj2 ,14),I(23,00,00,00),B(sx_obj2 ,162),I(23,00,00,00),B(sx_obj2 ,129),I(3b,01,25,00),B(sx_obj2 ,13),I(86,25,00,00),B(sx_obj2 ,12),I(86,25,00,00),B(sx_obj2 ,11),I(23,00,00,00),B(sx_obj2 ,163),I(23,00,00,00),B(sx_obj2 ,128),I(3b,01,25,00),B(sx_obj2 ,10),I(86,25,00,00),B(sx_obj2 ,9),I(23,00,00,00),B(sx_obj2 ,164),I(23,00,00,00),B(sx_obj2 ,127),I(3b,02,25,00),B(sx_obj2 ,8),I(86,25,00,00),B(sx_obj2 ,7),I(23,00,00,00),B(sx_obj2 ,165),I(23,00,00,00),B(sx_obj2 ,126),I(3b,01,25,00),B(sx_obj2 ,6),I(23,00,00,00),B(sx_obj2 ,166),I(23,00,00,00),B(sx_obj2 ,125),I(3b,02,25,00),B(sx_obj2 ,5),I(86,25,00,00),B(sx_obj2 ,4),I(86,25,00,00),B(sx_obj2 ,3),I(23,00,00,00),B(sx_obj2 ,167),I(23,00,00,00),B(sx_obj2 ,124),I(3b,02,25,00),B(sx_obj2 ,2),I(23,00,00,00),B(sx_obj2 ,168),I(23,00,00,00),B(sx_obj2 ,123),I(3b,00,3d,00),I(00,ac,00,00)}; /* Initializations */ eul_allocate_bytevector( G001608,G001607); eul_allocate_bytevector( G001610,G001609); eul_allocate_bytevector( G001612,G001611); eul_allocate_bytevector( G001614,G001613); eul_allocate_bytevector( G001616,G001615); eul_allocate_bytevector( G001618,G001617); eul_allocate_bytevector( G001620,G001619); eul_allocate_bytevector( G001622,G001621); eul_allocate_bytevector( G001624,G001623); eul_allocate_bytevector( G001626,G001625); eul_allocate_bytevector( G001628,G001627); eul_allocate_bytevector( G001630,G001629); eul_allocate_bytevector( G001632,G001631); eul_allocate_bytevector( G001634,G001633); eul_allocate_bytevector( G001636,G001635); eul_allocate_bytevector( G001638,G001637); eul_allocate_bytevector( G001640,G001639); eul_allocate_bytevector( G001642,G001641); eul_allocate_bytevector( G001644,G001643); eul_allocate_bytevector( G001646,G001645); eul_allocate_bytevector( G001648,G001647); eul_allocate_bytevector( G001650,G001649); eul_allocate_bytevector( G001652,G001651); eul_allocate_bytevector( G001654,G001653); eul_allocate_bytevector( G001656,G001655); eul_allocate_bytevector( G001658,G001657); eul_allocate_bytevector( G001660,G001659); eul_allocate_bytevector( G001662,G001661); eul_allocate_bytevector( G001664,G001663); eul_intern_keyword(key_1667,"name"); eul_intern_symbol(sym_1668,"name"); eul_intern_keyword(key_1669,"default"); eul_intern_symbol(sym_1670,"anonymous"); eul_intern_keyword(key_1671,"keyword"); eul_intern_symbol(sym_1672,"binding"); eul_intern_keyword(key_1673,"binding"); eul_intern_symbol(sym_1674,"value"); eul_intern_keyword(key_1675,"value"); eul_intern_symbol(sym_1676,"used"); eul_intern_keyword(key_1677,"used"); eul_intern_symbol(sym_1678,"var"); eul_intern_keyword(key_1679,"direct-superclasses"); eul_intern_keyword(key_1680,"direct-slots"); eul_intern_keyword(key_1681,"direct-keywords"); object_class(cons_1685) = eul_static_cons_class; eul_car(cons_1685) = key_1667; eul_cdr(cons_1685) = eul_nil; object_class(cons_1684) = eul_static_cons_class; eul_car(cons_1684) = key_1673; object_class(cons_1683) = eul_static_cons_class; eul_car(cons_1683) = key_1675; object_class(cons_1682) = eul_static_cons_class; eul_car(cons_1682) = key_1677; eul_intern_symbol(sym_1686,"local-var"); eul_intern_symbol(sym_1687,"lambda"); eul_intern_keyword(key_1688,"lambda"); eul_intern_symbol(sym_1689,"captured"); eul_intern_keyword(key_1690,"captured"); eul_intern_symbol(sym_1691,"local-static-var"); object_class(cons_1693) = eul_static_cons_class; eul_car(cons_1693) = key_1688; eul_cdr(cons_1693) = eul_nil; object_class(cons_1692) = eul_static_cons_class; eul_car(cons_1692) = key_1690; eul_intern_symbol(sym_1694,"global-var"); eul_intern_symbol(sym_1695,"global-static-var"); eul_intern_symbol(sym_1696,"obj"); eul_intern_keyword(key_1697,"obj"); eul_intern_symbol(sym_1698,"setq"); object_class(cons_1700) = eul_static_cons_class; eul_car(cons_1700) = key_1673; eul_cdr(cons_1700) = eul_nil; object_class(cons_1699) = eul_static_cons_class; eul_car(cons_1699) = key_1697; eul_intern_symbol(sym_1701,"const"); object_class(cons_1702) = eul_static_cons_class; eul_car(cons_1702) = key_1675; eul_cdr(cons_1702) = eul_nil; eul_intern_symbol(sym_1703,"named-const"); object_class(cons_1705) = eul_static_cons_class; eul_car(cons_1705) = key_1667; eul_cdr(cons_1705) = eul_nil; object_class(cons_1704) = eul_static_cons_class; eul_car(cons_1704) = key_1673; eul_intern_symbol(sym_1706,"literal-const"); eul_intern_symbol(sym_1707,"var?"); eul_intern_symbol(sym_1708,"local-var?"); eul_intern_symbol(sym_1709,"local-static-var?"); eul_intern_symbol(sym_1710,"global-var?"); eul_intern_symbol(sym_1711,"global-static-var?"); eul_intern_symbol(sym_1712,"setq?"); eul_intern_symbol(sym_1713,"const?"); eul_intern_symbol(sym_1714,"named-const?"); eul_intern_symbol(sym_1715,"literal-const?"); eul_intern_symbol(sym_1716,"(method var?)"); eul_intern_symbol(sym_1717,"(method local-var?)"); eul_intern_symbol(sym_1718,"(method local-static-var?)"); eul_intern_symbol(sym_1719,"(method global-var?)"); eul_intern_symbol(sym_1720,"(method global-static-var?)"); eul_intern_symbol(sym_1721,"(method setq?)"); eul_intern_symbol(sym_1722,"(method const?)"); eul_intern_symbol(sym_1723,"(method named-const?)"); eul_intern_symbol(sym_1724,"(method literal-const?)"); eul_allocate_bytevector( G001666,G001665); eul_allocate_bytevector( G001726,G001725); eul_allocate_bytevector( G001728,G001727); eul_allocate_bytevector( G001730,G001729); eul_allocate_bytevector( G001732,G001731); eul_allocate_bytevector( G001734,G001733); eul_allocate_bytevector( G001736,G001735); eul_allocate_bytevector( G001738,G001737); eul_allocate_bytevector( G001740,G001739); eul_allocate_bytevector( G001742,G001741); eul_allocate_bytevector( G001744,G001743); eul_allocate_bytevector( G001746,G001745); eul_allocate_bytevector( G001748,G001747); eul_allocate_bytevector( G001750,G001749); eul_allocate_bytevector( G001752,G001751); eul_allocate_bytevector( G001754,G001753); eul_allocate_bytevector( G001756,G001755); eul_allocate_bytevector( G001758,G001757); eul_allocate_bytevector( G001760,G001759); eul_allocate_bytevector( G001762,G001761); eul_allocate_bytevector( G001764,G001763); eul_allocate_bytevector( G001766,G001765); eul_allocate_bytevector( G001768,G001767); eul_intern_symbol(sym_1771,"named-const-binding!"); eul_intern_symbol(sym_1772,"local-static-var-lambda?"); eul_intern_symbol(sym_1773,"named-const-binding?"); eul_intern_symbol(sym_1774,"var-binding?"); eul_intern_symbol(sym_1775,"local-static-var-captured!"); eul_intern_symbol(sym_1776,"setq-binding?"); eul_intern_symbol(sym_1777,"var-value?"); eul_intern_symbol(sym_1778,"var-name!"); eul_intern_symbol(sym_1779,"const-value!"); eul_intern_symbol(sym_1780,"var-used!"); eul_intern_symbol(sym_1781,"local-static-var-captured?"); eul_intern_symbol(sym_1782,"var-binding!"); eul_intern_symbol(sym_1783,"setq-obj!"); eul_intern_symbol(sym_1784,"const-value?"); eul_intern_symbol(sym_1785,"named-const-name!"); eul_intern_symbol(sym_1786,"var-used?"); eul_intern_symbol(sym_1787,"named-const-name?"); eul_intern_symbol(sym_1788,"var-name?"); eul_intern_symbol(sym_1789,"local-static-var-lambda!"); eul_intern_symbol(sym_1790,"setq-obj?"); eul_intern_symbol(sym_1791,"var-value!"); eul_intern_symbol(sym_1792,"setq-binding!"); eul_intern_symbol(sym_1793,"top-level"); eul_allocate_bytevector( G001770,G001769); /* Set local bindings */ { int i; for (i = 2; i < 42; i++) sx_obj2_bindings[i] = eul_nil; } sx_obj2_bindings[ 42] = G001608; sx_obj2_bindings[ 43] = G001610; sx_obj2_bindings[ 44] = G001612; sx_obj2_bindings[ 45] = G001614; sx_obj2_bindings[ 46] = G001616; sx_obj2_bindings[ 47] = G001618; sx_obj2_bindings[ 48] = G001620; sx_obj2_bindings[ 49] = G001622; sx_obj2_bindings[ 50] = G001624; sx_obj2_bindings[ 51] = G001626; sx_obj2_bindings[ 52] = G001628; sx_obj2_bindings[ 53] = G001630; sx_obj2_bindings[ 54] = G001632; sx_obj2_bindings[ 55] = G001634; sx_obj2_bindings[ 56] = G001636; sx_obj2_bindings[ 57] = G001638; sx_obj2_bindings[ 58] = G001640; sx_obj2_bindings[ 59] = G001642; sx_obj2_bindings[ 60] = G001644; sx_obj2_bindings[ 61] = G001646; sx_obj2_bindings[ 62] = G001648; sx_obj2_bindings[ 63] = G001650; sx_obj2_bindings[ 64] = G001652; sx_obj2_bindings[ 65] = G001654; sx_obj2_bindings[ 66] = G001656; sx_obj2_bindings[ 67] = G001658; sx_obj2_bindings[ 68] = G001660; sx_obj2_bindings[ 69] = G001662; sx_obj2_bindings[ 70] = G001664; sx_obj2_bindings[ 71] = key_1667; sx_obj2_bindings[ 72] = sym_1668; sx_obj2_bindings[ 73] = key_1669; sx_obj2_bindings[ 74] = sym_1670; sx_obj2_bindings[ 75] = key_1671; sx_obj2_bindings[ 76] = sym_1672; sx_obj2_bindings[ 77] = key_1673; sx_obj2_bindings[ 78] = sym_1674; sx_obj2_bindings[ 79] = key_1675; sx_obj2_bindings[ 80] = sym_1676; sx_obj2_bindings[ 81] = key_1677; sx_obj2_bindings[ 82] = sym_1678; sx_obj2_bindings[ 83] = key_1679; sx_obj2_bindings[ 84] = key_1680; sx_obj2_bindings[ 85] = key_1681; sx_obj2_bindings[ 86] = cons_1682; sx_obj2_bindings[ 87] = sym_1686; sx_obj2_bindings[ 88] = sym_1687; sx_obj2_bindings[ 89] = key_1688; sx_obj2_bindings[ 90] = sym_1689; sx_obj2_bindings[ 91] = key_1690; sx_obj2_bindings[ 92] = sym_1691; sx_obj2_bindings[ 93] = cons_1692; sx_obj2_bindings[ 94] = sym_1694; sx_obj2_bindings[ 95] = sym_1695; sx_obj2_bindings[ 96] = sym_1696; sx_obj2_bindings[ 97] = key_1697; sx_obj2_bindings[ 98] = sym_1698; sx_obj2_bindings[ 99] = cons_1699; sx_obj2_bindings[ 100] = sym_1701; sx_obj2_bindings[ 101] = cons_1702; sx_obj2_bindings[ 102] = sym_1703; sx_obj2_bindings[ 103] = cons_1704; sx_obj2_bindings[ 104] = sym_1706; sx_obj2_bindings[ 105] = sym_1707; sx_obj2_bindings[ 106] = sym_1708; sx_obj2_bindings[ 107] = sym_1709; sx_obj2_bindings[ 108] = sym_1710; sx_obj2_bindings[ 109] = sym_1711; sx_obj2_bindings[ 110] = sym_1712; sx_obj2_bindings[ 111] = sym_1713; sx_obj2_bindings[ 112] = sym_1714; sx_obj2_bindings[ 113] = sym_1715; sx_obj2_bindings[ 114] = sym_1716; sx_obj2_bindings[ 115] = sym_1717; sx_obj2_bindings[ 116] = sym_1718; sx_obj2_bindings[ 117] = sym_1719; sx_obj2_bindings[ 118] = sym_1720; sx_obj2_bindings[ 119] = sym_1721; sx_obj2_bindings[ 120] = sym_1722; sx_obj2_bindings[ 121] = sym_1723; sx_obj2_bindings[ 122] = sym_1724; sx_obj2_bindings[ 123] = G001666; sx_obj2_bindings[ 124] = G001726; sx_obj2_bindings[ 125] = G001728; sx_obj2_bindings[ 126] = G001730; sx_obj2_bindings[ 127] = G001732; sx_obj2_bindings[ 128] = G001734; sx_obj2_bindings[ 129] = G001736; sx_obj2_bindings[ 130] = G001738; sx_obj2_bindings[ 131] = G001740; sx_obj2_bindings[ 132] = G001742; sx_obj2_bindings[ 133] = G001744; sx_obj2_bindings[ 134] = G001746; sx_obj2_bindings[ 135] = G001748; sx_obj2_bindings[ 136] = G001750; sx_obj2_bindings[ 137] = G001752; sx_obj2_bindings[ 138] = G001754; sx_obj2_bindings[ 139] = G001756; sx_obj2_bindings[ 140] = G001758; sx_obj2_bindings[ 141] = G001760; sx_obj2_bindings[ 142] = G001762; sx_obj2_bindings[ 143] = G001764; sx_obj2_bindings[ 144] = G001766; sx_obj2_bindings[ 145] = G001768; sx_obj2_bindings[ 1] = eul_nil; sx_obj2_bindings[ 146] = sym_1771; sx_obj2_bindings[ 147] = sym_1772; sx_obj2_bindings[ 148] = sym_1773; sx_obj2_bindings[ 149] = sym_1774; sx_obj2_bindings[ 150] = sym_1775; sx_obj2_bindings[ 151] = sym_1776; sx_obj2_bindings[ 152] = sym_1777; sx_obj2_bindings[ 153] = sym_1778; sx_obj2_bindings[ 154] = sym_1779; sx_obj2_bindings[ 155] = sym_1780; sx_obj2_bindings[ 156] = sym_1781; sx_obj2_bindings[ 157] = sym_1782; sx_obj2_bindings[ 158] = sym_1783; sx_obj2_bindings[ 159] = sym_1784; sx_obj2_bindings[ 160] = sym_1785; sx_obj2_bindings[ 161] = sym_1786; sx_obj2_bindings[ 162] = sym_1787; sx_obj2_bindings[ 163] = sym_1788; sx_obj2_bindings[ 164] = sym_1789; sx_obj2_bindings[ 165] = sym_1790; sx_obj2_bindings[ 166] = sym_1791; sx_obj2_bindings[ 167] = sym_1792; sx_obj2_bindings[ 168] = sym_1793; eul_allocate_lambda( sx_obj2_bindings[0], "initialize-sx-obj2", 0, G001770); } }
LR::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++) { // Evaluate the polynomial expansion at current Gauss point lrspline->point(X,gaussPt[0][i],gaussPt[1][j]); evalMonomials(n1,n2,X[0]-G[0],X[1]-G[1],P); #if SP_DEBUG > 2 std::cout <<"Greville point: "<< G <<"\nGauss point: "<< gaussPt[0][i] <<", "<< gaussPt[0][j] <<"\nMapped gauss point: "<< X <<"\nP-matrix:"<< P <<"--------------------\n"<< std::endl; #endif for (k = 1; k <= nPol; k++) { // Accumulate the projection matrix, A += P^t * P for (l = 1; l <= nPol; l++) A(k,l) += P(k)*P(l); // Accumulate the right-hand-side matrix, B += P^t * sigma for (l = 1; l <= nCmp; l++) B(k,l) += P(k)*sField(l,ig); } } } #if SP_DEBUG > 2 std::cout <<"---- Matrix A -----"<< A <<"-------------------"<< std::endl; std::cout <<"---- Vector B -----"<< B <<"-------------------"<< std::endl; #endif // Solve the local equation system if (!A.solve(B)) return nullptr; // Evaluate the projected field at current Greville point (first row of B) ip++; for (l = 1; l <= nCmp; l++) sValues(l,ip) = B(1,l); #if SP_DEBUG > 1 std::cout <<"Greville point "<< ip <<" (u,v) = " << gpar[0][ip-1] <<" "<< gpar[1][ip-1] <<" :"; for (k = 1; k <= nCmp; k++) std::cout <<" "<< sValues(k,ip); std::cout << std::endl; #endif } // Project the Greville point results onto the spline basis // to find the control point values return this->regularInterpolation(gpar[0],gpar[1],sValues); }
void 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 ); } }
LR::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; }
void 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); D(s10c); R(s10a); R(s10b); R(s10c); E; B(s11, Commit and rollback, 0) W(s11a); { c4_IntProp p1 ("p1"); { c4_Storage s1 ("s11a", 1); s1.SetStructure("a[p1:I]"); c4_View v1 = s1.View("a"); v1.Add(p1 [123]); s1.Commit(); } { c4_Storage s1 ("s11a", 0); c4_View v1 = s1.View("a"); A(v1.GetSize() == 1); A(p1 (v1[0]) == 123); v1.InsertAt(0, p1 [234]); A(v1.GetSize() == 2); A(p1 (v1[0]) == 234); A(p1 (v1[1]) == 123); s1.Rollback(); // 19990916 - semantics changed, still 2 rows, but 0 props A(v1.GetSize() == 2); A(v1.NumProperties() == 0); v1 = s1.View("a"); A(v1.GetSize() == 1); A(p1 (v1[0]) == 123); } } D(s11a); R(s11a); E; B(s12, Remove subview, 0) W(s12a); { c4_IntProp p1 ("p1"), p3 ("p3"); c4_ViewProp p2 ("p2"); { c4_Storage s1 ("s12a", 1); s1.SetStructure("a[p1:I,p2[p3:I]]"); c4_View v1 = s1.View("a"); c4_View v2; v2.Add(p3 [234]); v1.Add(p1 [123] + p2 [v2]); s1.Commit(); } { c4_Storage s1 ("s12a", 1); c4_View v1 = s1.View("a"); A(v1.GetSize() == 1); A(p1 (v1[0]) == 123); c4_View v2 = p2 (v1[0]); A(v2.GetSize() == 1); A(p3 (v2[0]) == 234); v1.RemoveAt(0); A(v1.GetSize() == 0); s1.Commit(); A(v1.GetSize() == 0); } } D(s12a); R(s12a); E; B(s13, Remove middle subview, 0) W(s13a); { c4_IntProp p1 ("p1"), p3 ("p3"); c4_ViewProp p2 ("p2"); { c4_Storage s1 ("s13a", 1); s1.SetStructure("a[p1:I,p2[p3:I]]"); c4_View v1 = s1.View("a"); c4_View v2a; v2a.Add(p3 [234]); v1.Add(p1 [123] + p2 [v2a]); c4_View v2b; v2b.Add(p3 [345]); v2b.Add(p3 [346]); v1.Add(p1 [124] + p2 [v2b]); c4_View v2c; v2c.Add(p3 [456]); v2c.Add(p3 [457]); v2c.Add(p3 [458]); v1.Add(p1 [125] + p2 [v2c]); s1.Commit(); } { c4_Storage s1 ("s13a", 1); c4_View v1 = s1.View("a"); A(v1.GetSize() == 3); A(p1 (v1[0]) == 123); A(p1 (v1[1]) == 124); A(p1 (v1[2]) == 125); c4_View v2a = p2 (v1[0]); A(v2a.GetSize() == 1); A(p3 (v2a[0]) == 234); c4_View v2b = p2 (v1[1]); A(v2b.GetSize() == 2); A(p3 (v2b[0]) == 345); c4_View v2c = p2 (v1[2]); A(v2c.GetSize() == 3); A(p3 (v2c[0]) == 456); v1.RemoveAt(1); A(v1.GetSize() == 2); v2a = p2 (v1[0]); A(v2a.GetSize() == 1); A(p3 (v2a[0]) == 234); v2b = p2 (v1[1]); A(v2b.GetSize() == 3); A(p3 (v2b[0]) == 456); s1.Commit(); A(v1.GetSize() == 2); A(p1 (v1[0]) == 123); A(p1 (v1[1]) == 125); } } D(s13a); R(s13a); E; B(s14, Replace attached subview, 0) W(s14a); { c4_IntProp p1 ("p1"); c4_ViewProp p2 ("p2"); { c4_Storage s1 ("s14a", 1); s1.SetStructure("a[p1:I,p2[p3:I]]"); c4_View v1 = s1.View("a"); v1.Add(p1 [123] + p2 [c4_View ()]); A(v1.GetSize() == 1); v1[0] = p2 [c4_View ()]; A(v1.GetSize() == 1); A(p1 (v1[0]) == 0); s1.Commit(); } } D(s14a); R(s14a); E; B(s15, Add after removed subviews, 0) W(s15a); { c4_IntProp p1 ("p1"), p3 ("p3"); c4_ViewProp p2 ("p2"); { c4_Storage s1 ("s15a", 1); s1.SetStructure("a[p1:I,p2[p3:I]]"); c4_View v1 = s1.View("a"); c4_View v2; v2.Add(p3 [234]); v1.Add(p1 [123] + p2 [v2]); v1.Add(p1 [456] + p2 [v2]); v1.Add(p1 [789] + p2 [v2]); A(v1.GetSize() == 3); v1[0] = v1[2]; v1.RemoveAt(2); v1[0] = v1[1]; v1.RemoveAt(1); v1.RemoveAt(0); v1.Add(p1 [111] + p2 [v2]); s1.Commit(); } } D(s15a); R(s15a); E; B(s16, Add after removed ints, 0) W(s16a); { c4_IntProp p1 ("p1"); c4_Storage s1 ("s16a", 1); s1.SetStructure("a[p1:I,p2[p3:I]]"); c4_View v1 = s1.View("a"); v1.Add(p1 [1]); v1.Add(p1 [2]); v1.Add(p1 [3]); v1.RemoveAt(2); v1.RemoveAt(1); v1.RemoveAt(0); v1.Add(p1 [4]); s1.Commit(); } D(s16a); R(s16a); E; B(s17, Add after removed strings, 0) W(s17a); { c4_StringProp p1 ("p1"); c4_Storage s1 ("s17a", 1); s1.SetStructure("a[p1:S,p2[p3:I]]"); c4_View v1 = s1.View("a"); v1.Add(p1 ["one"]); v1.Add(p1 ["two"]); v1.Add(p1 ["three"]); v1.RemoveAt(2); v1.RemoveAt(1); v1.RemoveAt(0); v1.Add(p1 ["four"]); s1.Commit(); } D(s17a); R(s17a); E; B(s18, Empty storage, 0) W(s18a); { c4_Storage s1 ("s18a", 1); } D(s18a); R(s18a); E; B(s19, Empty view outlives storage, 0) W(s19a); { c4_View v1; c4_Storage s1 ("s19a", 1); v1 = s1.GetAs("a[p1:I,p2:S]"); } D(s19a); R(s19a); E; }
bool ASMu2D::globalL2projection (Matrix& sField, const IntegrandBase& integrand, bool continuous) const { if (!lrspline) return true; // silently ignore empty patches PROFILE2("ASMu2D::globalL2"); const int p1 = lrspline->order(0); const int p2 = lrspline->order(1); // Get Gaussian quadrature points const int ng1 = continuous ? nGauss : p1 - 1; const int ng2 = continuous ? nGauss : p2 - 1; const double* xg = GaussQuadrature::getCoord(ng1); const double* yg = GaussQuadrature::getCoord(ng2); const double* wg = continuous ? GaussQuadrature::getWeight(nGauss) : nullptr; if (!xg || !yg) return false; if (continuous && !wg) return false; // Set up the projection matrices const size_t nnod = this->getNoNodes(); const size_t ncomp = integrand.getNoFields(); SparseMatrix A(SparseMatrix::SUPERLU); StdVector B(nnod*ncomp); A.redim(nnod,nnod); double dA = 0.0; Vector phi; Matrix dNdu, Xnod, Jac; Go::BasisDerivsSf spl1; Go::BasisPtsSf spl0; // === Assembly loop over all elements in the patch ========================== std::vector<LR::Element*>::iterator el = lrspline->elementBegin(); for (int iel = 1; el != lrspline->elementEnd(); el++, iel++) { if (continuous) { // Set up control point (nodal) coordinates for current element if (!this->getElementCoordinates(Xnod,iel)) return false; else if ((dA = 0.25*this->getParametricArea(iel)) < 0.0) return false; // topology error (probably logic error) } // Compute parameter values of the Gauss points over this element std::array<RealArray,2> gpar, unstrGpar; this->getGaussPointParameters(gpar[0],0,ng1,iel,xg); this->getGaussPointParameters(gpar[1],1,ng2,iel,yg); // convert to unstructred mesh representation expandTensorGrid(gpar.data(),unstrGpar.data()); // Evaluate the secondary solution at all integration points if (!this->evalSolution(sField,integrand,unstrGpar.data())) return false; // set up basis function size (for extractBasis subroutine) phi.resize((**el).nBasisFunctions()); // --- Integration loop over all Gauss points in each direction ---------- int ip = 0; for (int j = 0; j < ng2; j++) for (int i = 0; i < ng1; i++, ip++) { if (continuous) { lrspline->computeBasis(gpar[0][i],gpar[1][j],spl1,iel-1); SplineUtils::extractBasis(spl1,phi,dNdu); } else { lrspline->computeBasis(gpar[0][i],gpar[1][j],spl0,iel-1); phi = spl0.basisValues; } // Compute the Jacobian inverse and derivatives double dJw = 1.0; if (continuous) { dJw = dA*wg[i]*wg[j]*utl::Jacobian(Jac,dNdu,Xnod,dNdu,false); if (dJw == 0.0) continue; // skip singular points } // Integrate the linear system A*x=B for (size_t ii = 0; ii < phi.size(); ii++) { int inod = MNPC[iel-1][ii]+1; for (size_t jj = 0; jj < phi.size(); jj++) { int jnod = MNPC[iel-1][jj]+1; A(inod,jnod) += phi[ii]*phi[jj]*dJw; } for (size_t r = 1; r <= ncomp; r++) B(inod+(r-1)*nnod) += phi[ii]*sField(r,ip+1)*dJw; } } } #if SP_DEBUG > 2 std::cout <<"---- Matrix A -----"<< A <<"-------------------"<< std::endl; std::cout <<"---- Vector B -----"<< B <<"-------------------"<< std::endl; #endif // Solve the patch-global equation system if (!A.solve(B)) return false; // Store the control-point values of the projected field sField.resize(ncomp,nnod); for (size_t i = 1; i <= nnod; i++) for (size_t j = 1; j <= ncomp; j++) sField(j,i) = B(i+(j-1)*nnod); return true; }
void 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)); #if defined(K_USING_WINDOWS_) user.text = knh_getenv("USERPROFILE"); #else user.text = knh_getenv("HOME"); #endif if(user.text != NULL) { /* $user.path */ user.len = knh_strlen(user.text); knh_buff_addpath(ctx, cwb->ba, cwb->pos, 0, user); knh_buff_addpath(ctx, cwb->ba, cwb->pos, 1, STEXT(K_KONOHAFOLDER)); SETPROP("user.path", CWB_newString(ctx, cwb, 0)); knh_buff_addospath(ctx, cwb->ba, cwb->pos, 0, user); knh_buff_addospath(ctx, cwb->ba, cwb->pos, 1, STEXT(K_KONOHAFOLDER)); knh_buff_mkdir(ctx, cwb->ba, cwb->pos); CWB_clear(cwb, 0); knh_buff_addospath(ctx, cwb->ba, cwb->pos, 0, user); knh_buff_addospath(ctx, cwb->ba, cwb->pos, 1/*sep*/, STEXT(K_KONOHAFOLDER)); knh_buff_addospath(ctx, cwb->ba, cwb->pos, 1/*sep*/, STEXT("package")); knh_buff_addospath(ctx, cwb->ba, cwb->pos, 1/*sep*/, STEXT(LIBK_VERSION)); SETPROP("user.package.path", CWB_newString(ctx, cwb, 0)); } CWB_close(ctx, cwb); }
/* 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). IPIV (input or output) INTEGER array, dimension (N) If FACT = 'F', then IPIV is an input argument and on entry contains details of the interchanges and the block structure of D, as determined by ZSYTRF. 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. If FACT = 'N', then IPIV is an output argument and on exit contains details of the interchanges and the block structure of D, as determined by ZSYTRF. B (input) COMPLEX*16 array, dimension (LDB,NRHS) The N-by-NRHS right hand side matrix B. LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N). X (output) COMPLEX*16 array, dimension (LDX,NRHS) If INFO = 0, the N-by-NRHS solution matrix X. LDX (input) INTEGER The leading dimension of the array X. LDX >= max(1,N). RCOND (output) DOUBLE PRECISION The estimate of the reciprocal condition number of the matrix A. If RCOND is less than the machine precision (in particular, if RCOND = 0), the matrix is singular to working precision. This condition is indicated by a return code of INFO > 0, and the solution and error bounds are not computed. FERR (output) DOUBLE PRECISION array, dimension (NRHS) The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution corresponding to X(j), FERR(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by the magnitude of the largest element in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error. BERR (output) DOUBLE PRECISION array, dimension (NRHS) The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution). WORK (workspace/output) COMPLEX*16 array, dimension (LWORK) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. LWORK (input) INTEGER The length of WORK. LWORK >= 2*N, and for best performance LWORK >= N*NB, where NB is the optimal blocksize for ZSYTRF. RWORK (workspace) DOUBLE PRECISION array, dimension (N) INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: if INFO = i, and i is <= N: D(i,i) is exactly zero. The factorization has been completed, but the block diagonal matrix D is exactly singular, so the solution and error bounds could not be computed. = N+1: the block diagonal matrix D is nonsingular, but RCOND is less than machine precision. The factorization has been completed, but the matrix is singular to working precision, so the solution and error bounds have not been computed. ===================================================================== Test the input parameters. Parameter adjustments Function Body */ /* System generated locals */ integer a_dim1, a_offset, af_dim1, af_offset, b_dim1, b_offset, x_dim1, x_offset, i__1; /* Local variables */ extern logical lsame_(char *, char *); static doublereal anorm; extern doublereal dlamch_(char *); static logical nofact; extern /* Subroutine */ int xerbla_(char *, integer *), zlacpy_( char *, integer *, integer *, doublecomplex *, integer *, doublecomplex *, integer *); extern doublereal zlansy_(char *, char *, integer *, doublecomplex *, integer *, doublereal *); extern /* Subroutine */ int zsycon_(char *, integer *, doublecomplex *, integer *, integer *, doublereal *, doublereal *, doublecomplex *, integer *), zsyrfs_(char *, integer *, integer *, doublecomplex *, integer *, doublecomplex *, integer *, integer *, doublecomplex *, integer *, doublecomplex *, integer *, doublereal *, doublereal *, doublecomplex *, doublereal *, integer *), zsytrf_(char *, integer *, doublecomplex *, integer *, integer *, doublecomplex *, integer *, integer *), zsytrs_(char *, integer *, integer *, doublecomplex *, integer *, integer *, doublecomplex *, integer *, integer *); #define IPIV(I) ipiv[(I)-1] #define FERR(I) ferr[(I)-1] #define BERR(I) berr[(I)-1] #define WORK(I) work[(I)-1] #define RWORK(I) rwork[(I)-1] #define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] #define AF(I,J) af[(I)-1 + ((J)-1)* ( *ldaf)] #define B(I,J) b[(I)-1 + ((J)-1)* ( *ldb)] #define X(I,J) x[(I)-1 + ((J)-1)* ( *ldx)] *info = 0; nofact = lsame_(fact, "N"); if (! nofact && ! lsame_(fact, "F")) { *info = -1; } else if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { *info = -2; } else if (*n < 0) { *info = -3; } else if (*nrhs < 0) { *info = -4; } else if (*lda < max(1,*n)) { *info = -6; } else if (*ldaf < max(1,*n)) { *info = -8; } else if (*ldb < max(1,*n)) { *info = -11; } else if (*ldx < max(1,*n)) { *info = -13; } else if (*lwork < *n << 1) { *info = -18; } if (*info != 0) { i__1 = -(*info); xerbla_("ZSYSVX", &i__1); return 0; } if (nofact) { /* Compute the factorization A = U*D*U' or A = L*D*L'. */ zlacpy_(uplo, n, n, &A(1,1), lda, &AF(1,1), ldaf); zsytrf_(uplo, n, &AF(1,1), ldaf, &IPIV(1), &WORK(1), lwork, info); /* Return if INFO is non-zero. */ if (*info != 0) { if (*info > 0) { *rcond = 0.; } return 0; } } /* Compute the norm of the matrix A. */ anorm = zlansy_("I", uplo, n, &A(1,1), lda, &RWORK(1)); /* Compute the reciprocal of the condition number of A. */ zsycon_(uplo, n, &AF(1,1), ldaf, &IPIV(1), &anorm, rcond, &WORK(1), info); /* Return if the matrix is singular to working precision. */ if (*rcond < dlamch_("Epsilon")) { *info = *n + 1; return 0; } /* Compute the solution vectors X. */ zlacpy_("Full", n, nrhs, &B(1,1), ldb, &X(1,1), ldx); zsytrs_(uplo, n, nrhs, &AF(1,1), ldaf, &IPIV(1), &X(1,1), ldx, info); /* Use iterative refinement to improve the computed solutions and compute error bounds and backward error estimates for them. */ zsyrfs_(uplo, n, nrhs, &A(1,1), lda, &AF(1,1), ldaf, &IPIV(1), &B(1,1), ldb, &X(1,1), ldx, &FERR(1), &BERR(1), &WORK(1) , &RWORK(1), info); return 0; /* End of ZSYSVX */ } /* zsysvx_ */
/* 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) a44 Packed storage of the upper triangle of A: AP = [ a11, a12, a22, a13, a23, a33, a14, a24, a34, a44 ] ===================================================================== Test the input parameters. Parameter adjustments Function Body */ /* System generated locals */ integer b_dim1, b_offset, i__1; /* Local variables */ extern logical lsame_(char *, char *); extern /* Subroutine */ int xerbla_(char *, integer *), csptrf_( char *, integer *, complex *, integer *, integer *), csptrs_(char *, integer *, integer *, complex *, integer *, complex *, integer *, integer *); #define AP(I) ap[(I)-1] #define IPIV(I) ipiv[(I)-1] #define B(I,J) b[(I)-1 + ((J)-1)* ( *ldb)] *info = 0; if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { *info = -1; } else if (*n < 0) { *info = -2; } else if (*nrhs < 0) { *info = -3; } else if (*ldb < max(1,*n)) { *info = -7; } if (*info != 0) { i__1 = -(*info); xerbla_("CSPSV ", &i__1); return 0; } /* Compute the factorization A = U*D*U' or A = L*D*L'. */ csptrf_(uplo, n, &AP(1), &IPIV(1), info); if (*info == 0) { /* Solve the system A*X = B, overwriting B with X. */ csptrs_(uplo, n, nrhs, &AP(1), &IPIV(1), &B(1,1), ldb, info); } return 0; /* End of CSPSV */ } /* cspsv_ */
arma::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; } } } if(minloc!=-1) { // Solution is sol=Q.col(minloc); } else { printf("C2-DIIS did not find a suitable solution. Mixing matrices instead.\n"); sol.zeros(); sol(0)=0.5; sol(1)=0.5; } } return sol; }
t_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; } }
void 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()); } }
// Ditto above, but for doubles void 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); } }
void 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)); }
/* @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)); }
void 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"); } }