您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch |

自学教程:C++ A2函数代码示例

51自学网 2021-06-01 19:31:38
  C++
这篇教程C++ A2函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中A2函数的典型用法代码示例。如果您正苦于以下问题:C++ A2函数的具体用法?C++ A2怎么用?C++ A2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了A2函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ls_solve_od

mat ls_solve_od(const mat &A, const mat &B){    int m=A.rows(), n=A.cols(), N=B.cols(), j;    double beta;    mat A2(A), B2(B), B3(n,N), submat, submat2;    vec tmp(n), v;//    it_assert1(m >= n, "The system is under-determined!");    //it_assert1(m == B.rows(), "The number of rows in A must equal the number of rows in B!");    // Perform a Householder QR factorization    for (j=0; j<n; j++) {	house(rvectorize(A2(j, m-1, j, j)), v, beta);	v *= sqrt(beta);	// 	submat.ref(A2, j,m-1, j,n-1); 	submat = A2(j,m-1,j,n-1);	sub_v_vT_m(submat, v);	// 	submat.ref(B2, j,m-1, 0,N-1); 	submat = B2(j,m-1,0,N-1);	sub_v_vT_m(submat, v);    }    //    submat.ref(A2, 0,n-1,0,n-1);    //    submat2.ref(B2, 0,n-1,0,N-1);    submat = A2(0,n-1,0,n-1);    submat2 = B2(0,n-1,0,N-1);    for (j=0; j<N; j++) {	backward_substitution(submat, submat2.get_col(j), tmp);	B3.set_col(j, tmp);    }        return B3;}
开发者ID:mbillingr,项目名称:tools4bci-unibuild,代码行数:33,


示例2: B

void prefi::initialize(){	B(0) = 1.0;	A1(0) = 1.0;	A1(1) = 1.0/(2.0*M_PI*fc1);	A2(0) = 1.0;	A2(1) = 1.0/(2.0*M_PI*fc2);}
开发者ID:GuimaraesRoberta,项目名称:rfid-digital,代码行数:8,


示例3: FillPBufferAttribs_ByBits

static voidFillPBufferAttribs_ByBits(nsTArray<EGLint>& aAttrs,                          int redBits, int greenBits,                          int blueBits, int alphaBits,                          int depthBits, int stencilBits){    aAttrs.Clear();#if defined(A1) || defined(A2)#error The temp-macro names we want are already defined.#endif#define A1(_x)      do { aAttrs.AppendElement(_x); } while (0)#define A2(_x,_y)   do { A1(_x); A1(_y); } while (0)    A2(LOCAL_EGL_RENDERABLE_TYPE, LOCAL_EGL_OPENGL_ES2_BIT);    A2(LOCAL_EGL_SURFACE_TYPE, LOCAL_EGL_PBUFFER_BIT);    A2(LOCAL_EGL_RED_SIZE, redBits);    A2(LOCAL_EGL_GREEN_SIZE, greenBits);    A2(LOCAL_EGL_BLUE_SIZE, blueBits);    A2(LOCAL_EGL_ALPHA_SIZE, alphaBits);    A2(LOCAL_EGL_DEPTH_SIZE, depthBits);    A2(LOCAL_EGL_STENCIL_SIZE, stencilBits);    A1(LOCAL_EGL_NONE);#undef A1#undef A2}
开发者ID:bebef1987,项目名称:gecko-dev,代码行数:30,


示例4: main

int main () {  Eigen::MatrixXd A(3,2);  A << -1, 0,       0, -1,       1, 1;  Eigen::VectorXd b(3);  b << 0, 0, 1;  iris::Polyhedron p(A, b);  Eigen::MatrixXd A2(2,2);  A2 << 2, 3,        4, 5;  Eigen::VectorXd b2(2);  b2 << 6, 7;  iris::Polyhedron other(A2, b2);  p.appendConstraints(other);  valuecheck(p.getNumberOfConstraints(), 5);  Eigen::MatrixXd A_expected(5,2);  A_expected << -1, 0,                 0, -1,                 1, 1,                 2, 3,                 4, 5;  valuecheckMatrix(p.getA(), A_expected, 1e-12);  return 0;}
开发者ID:rdeits,项目名称:iris,代码行数:30,


示例5: testQLDSolver

  void testQLDSolver()  {    BaseVariable xy("xy",2);    BaseVariable z("z",1);    CompositeVariable T("T", xy, z);    MatrixXd A1(1,1); A1 << 1;    VectorXd b1(1); b1 << -3;    LinearFunction lf1(z, A1, b1);    LinearConstraint c1(&lf1, true);    MatrixXd A2(1,2); A2 << 3,1 ;    VectorXd b2(1); b2 << 0;    LinearFunction lf2(xy, A2, b2);    LinearConstraint c2(&lf2, true);    MatrixXd A3(2,2); A3 << 2,1,-0.5,1 ;    VectorXd b3(2); b3 << 0, 1;    LinearFunction lf3(xy, A3, b3);    LinearConstraint c3(&lf3, false);    QuadraticFunction objFunc(T, Matrix3d::Identity(), Vector3d::Zero(), 0);    QuadraticObjective obj(&objFunc);        QLDSolver solver;    solver.addConstraint(c1);    solver.addConstraint(c2);    solver.addConstraint(c3);    solver.addObjective(obj);    std::cout << "sol = " << std::endl << solver.solve().solution << std::endl << std::endl;    ocra_assert(solver.getLastResult().info == 0);    solver.removeConstraint(c1);    IdentityFunction id(z);    VectorXd lz(1); lz << 1;    VectorXd uz(1); uz << 2;    IdentityConstraint bnd1(&id, lz, uz);    solver.addBounds(bnd1);    std::cout << "sol = " << std::endl << solver.solve().solution << std::endl << std::endl;    ocra_assert(solver.getLastResult().info == 0);    BaseVariable t("t", 2);    VectorXd ut(2); ut << -4,-1;    BoundFunction bf(t, ut, BOUND_TYPE_SUPERIOR);    BoundConstraint bnd2(&bf, false);    solver.addBounds(bnd2);    QuadraticFunction objFunc2(t, Matrix2d::Identity(), Vector2d::Constant(2.71828),0);    QuadraticObjective obj2(&objFunc2);    solver.addObjective(obj2);    std::cout << "sol = " << std::endl << solver.solve().solution << std::endl << std::endl;    ocra_assert(solver.getLastResult().info == 0);    Vector2d c3l(-1,-1);    c3.setL(c3l);    std::cout << "sol = " << std::endl << solver.solve().solution << std::endl << std::endl;    ocra_assert(solver.getLastResult().info == 0);  }
开发者ID:ocra-recipes,项目名称:ocra-recipes,代码行数:60,


示例6: makeFormattedString

		std::string makeFormattedString(		const char* aFormat,		const A1& a1 = A1(),		const A2& a2 = A2(),		const A3& a3 = A3(),		const A4& a4 = A4(),		const A5& a5 = A5(),		const A6& a6 = A6(),		const A7& a7 = A7(),		const A8& a8 = A8(),		const A9& a9 = A9(),		const A10& a10 = A10(),		const A11& a11 = A11(),		const A12& a12 = A12(),		const A13& a13 = A13(),		const A14& a14 = A14(),		const A15& a15 = A15(),		const A16& a16 = A16(),		const A17& a17 = A17(),		const A18& a18 = A18(),		const A19& a19 = A19(),		const A20& a20 = A20()		)		{			return makeStringByPrintf(aFormat,				a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,				a11, a12, a13, a14, a15, a16, a17, a18, a19, a20				);		}
开发者ID:jjasinski,项目名称:Logger_old,代码行数:29,


示例7: GetOverlapType

eOverlapType GetOverlapType(const CArea& a1, const CArea& a2){	CArea A1(a1);	A1.Subtract(a2);	if(A1.m_curves.size() == 0)	{		return eInside;	}	CArea A2(a2);	A2.Subtract(a1);	if(A2.m_curves.size() == 0)	{		return eOutside;	}	A1 = a1;	A1.Intersect(a2);	if(A1.m_curves.size() == 0)	{		return eSiblings;	}	return eCrossing;}
开发者ID:gorilux,项目名称:libarea,代码行数:26,


示例8: inter_cone

void	inter_cone(t_caster *caster, t_object *cone){  double	a;  double	b;  double	c;  double	delt;  init_temp_pos(caster, cone);  a = A2(caster->temp_vec.x, caster->temp_vec.y, caster->temp_vec.z,	 cone->data.angle);  b = B2(caster->temp_vec.x, caster->temp_pos.x, caster->temp_vec.y,	 caster->temp_pos.y, caster->temp_vec.z, caster->temp_pos.z,	 cone->data.angle);  c = C2(caster->temp_pos.x, caster->temp_pos.y, caster->temp_pos.z,	 cone->data.angle);  delt = (pow(b, 2.0) - 4.0 * (a * c));  if (delt >= 0.0)    {      cone->dist = get_nearest((-b - sqrt(delt)) / (2.0 * a),			       (-b + sqrt(delt)) / (2.0 * a));      if (cone->dist > 0.0 && cone->dist < caster->intersection.dist)	{	  caster->intersection.brightness = cone->brightness;	  init_intersection(caster, cone);	  rotate_caster(caster, cone);	}    }}
开发者ID:Sorikairo,项目名称:Raytracer,代码行数:28,


示例9: CPLSafeIntOverflow

inline CPLSafeInt<unsigned> operator*( const CPLSafeInt<unsigned>& A,                                       const CPLSafeInt<unsigned>& B ){#ifdef BUILTIN_OVERFLOW_CHECK_AVAILABLE    unsigned res;    if( __builtin_umul_overflow(A.v(), B.v(), &res) )        throw CPLSafeIntOverflow();    return CPLSM(res);#elif defined(_MSC_VER)    msl::utilities::SafeInt<unsigned, CPLMSVCSafeIntException> A2(A.v());    msl::utilities::SafeInt<unsigned, CPLMSVCSafeIntException> B2(B.v());    return CPLSM(static_cast<unsigned>(A2 * B2));#elif defined(CPL_HAS_GINT64)    const unsigned a = A.v();    const unsigned b = B.v();    const GUInt64 res = static_cast<GUInt64>(a) * b;    if( res > std::numeric_limits<unsigned>::max() )    {        throw CPLSafeIntOverflow();    }    return CPLSM(static_cast<unsigned>(res));#else    const unsigned a = A.v();    const unsigned b = B.v();    if( b > 0 && a > std::numeric_limits<unsigned>::max() / b )        throw CPLSafeIntOverflow();    return CPLSM(a*b);#endif}
开发者ID:OSGeo,项目名称:gdal,代码行数:29,


示例10: main

int main(){  TTableContext Context;  // create scheme  Schema AnimalS;  AnimalS.Add(TPair<TStr,TAttrType>("Animal", atStr));  AnimalS.Add(TPair<TStr,TAttrType>("Size", atStr));  AnimalS.Add(TPair<TStr,TAttrType>("Location", atStr));  AnimalS.Add(TPair<TStr,TAttrType>("Number", atInt));  TIntV RelevantCols;  RelevantCols.Add(0);  RelevantCols.Add(1);  RelevantCols.Add(2);  // create table  PTable T = TTable::LoadSS("Animals", AnimalS, "tests/animals.txt", Context, RelevantCols);  //PTable T = TTable::LoadSS("Animals", AnimalS, "animals.txt");  T->Unique("Animal");  TTable Ts = *T;  // did we fix problem with copy-c'tor ?  //PTable Ts = TTable::LoadSS("Animals_s", AnimalS, "../../testfiles/animals.txt", RelevantCols);  //Ts->Unique(AnimalUnique);  // test Select  // create predicate tree: find all animals that are big and african or medium and Australian  TPredicate::TAtomicPredicate A1(atStr, true, EQ, "Location", "", 0, 0, "Africa");    TPredicate::TPredicateNode N1(A1);  // Location == "Africa"  TPredicate::TAtomicPredicate A2(atStr, true, EQ, "Size", "", 0, 0, "big");    TPredicate::TPredicateNode N2(A2);  // Size == "big"  TPredicate::TPredicateNode N3(AND);  N3.AddLeftChild(&N1);  N3.AddRightChild(&N2);  TPredicate::TAtomicPredicate A4(atStr, true, EQ, "Location", "", 0, 0, "Australia");    TPredicate::TPredicateNode N4(A4);    TPredicate::TAtomicPredicate A5(atStr, true, EQ, "Size", "", 0, 0, "medium");    TPredicate::TPredicateNode N5(A5);   TPredicate::TPredicateNode N6(AND);  N6.AddLeftChild(&N4);  N6.AddRightChild(&N5);  TPredicate::TPredicateNode N7(OR);  N7.AddLeftChild(&N3);  N7.AddRightChild(&N6);  TPredicate Pred(&N7);  TIntV SelectedRows;  Ts.Select(Pred, SelectedRows);  TStrV GroupBy;  GroupBy.Add("Location");  T->Group(GroupBy, "LocationGroup");  GroupBy.Add("Size");  T->Group(GroupBy, "LocationSizeGroup");  T->Count("LocationCount", "Location");  PTable Tj = T->Join("Location", Ts, "Location");  TStrV UniqueAnimals;  UniqueAnimals.Add("Animals_1.Animal");  UniqueAnimals.Add("Animals_2.Animal");  Tj->Unique(UniqueAnimals, false);  //print table   T->SaveSS("tests/animals_out_T.txt");   Ts.SaveSS("tests/animals_out_Ts.txt");   Tj->SaveSS("tests/animals_out_Tj.txt");  return 0;}
开发者ID:mayankgupta,项目名称:snapr,代码行数:60,


示例11: A2

bool PGCicrcleTaskPt::CrossPoint(const ProjPt& prev, const ProjPt& next, ProjPt& optimized) {    ProjPt A = prev - m_Center;    ProjPt B = next - m_Center;    ProjPt A2(A.m_X * A.m_X, A.m_Y * A.m_Y);    ProjPt B2(B.m_X * B.m_X, B.m_Y * B.m_Y);    double R2 = (m_Radius * m_Radius);    bool PrevOutside = (A2.m_X + A2.m_Y) > R2;    bool NextOutside = (B2.m_X + B2.m_Y) > R2;    if (!PrevOutside && !NextOutside) {        return false; // no cross point    }    ProjPt AB = B - A;    double a = (AB.m_X * AB.m_X) + (AB.m_Y * AB.m_Y);    double b = 2 * ((AB.m_X * A.m_X) + (AB.m_Y * A.m_Y));    double c = A2.m_X + A2.m_Y - R2;    double bb4ac = (b * b) -(4 * a * c);    if (bb4ac < 0.0) {        return false;    }    bool bCrossPoint = false;    double k = 0.0;    if (bb4ac == 0.0) {        LKASSERT(a);        // one point        k = -b / (2 * a);        bCrossPoint = true;    }    if (bb4ac > 0.0) {        // Two point,        if ((PrevOutside && m_bExit) || (!PrevOutside && NextOutside)) {            LKASSERT(a);            k = (-b + sqrt(bb4ac)) / (2 * a); // ouput : prev ouside && Exit TP || prev inside && next outside            bCrossPoint = true;        } else {            LKASSERT(a);            k = (-b - sqrt(bb4ac)) / (2 * a); // input : prev outside && Enter TP            bCrossPoint = true;        }    }    if (bCrossPoint) {        ProjPt O = prev + ((next - prev) * k);        if (dot_product((next - prev), O - prev) > 0.0 &&                dot_product((prev - next), O - next) > 0.0) {            optimized = O;            return true;        }    }    // no point    return false;}
开发者ID:rkalman,项目名称:LK8000,代码行数:59,


示例12: vecpot2b1i

/*! /fn Real vecpot2b1i(Real (*A2)(Real,Real,Real), Real (*A3)(Real,Real,Real), *                const GridS *pG, const int i, const int j, const int k) *  /brief Compute B-field components from a vector potential. * * THESE FUNCTIONS COMPUTE MAGNETIC FIELD COMPONENTS FROM COMPONENTS OF A * SPECIFIED VECTOR POTENTIAL USING STOKES' THEOREM AND SIMPSON'S QUADRATURE. * NOTE:  THIS IS ONLY GUARANTEED TO WORK IF THE POTENTIAL IS OF CLASS C^1. * WRITTEN BY AARON SKINNER. */Real vecpot2b1i(Real (*A2)(Real,Real,Real), Real (*A3)(Real,Real,Real),                const GridS *pG, const int i, const int j, const int k){  Real x1,x2,x3,b1i=0.0,lsf=1.0,rsf=1.0,dx2=pG->dx2;  Real f2(Real y);  Real f3(Real z);  a2func = A2;  a3func = A3;  cc_pos(pG,i,j,k,&x1,&x2,&x3);  xmin = x1 - 0.5*pG->dx1;  xmax = x1 + 0.5*pG->dx1;  ymin = x2 - 0.5*pG->dx2;  ymax = x2 + 0.5*pG->dx2;  zmin = x3 - 0.5*pG->dx3;  zmax = x3 + 0.5*pG->dx3;  xsav = xmin;#ifdef CYLINDRICAL  lsf = xmin;  rsf = xmin;  dx2 = xmin*pG->dx2;#endif  if (A2 != NULL) {    if (ymin == ymax)      b1i += rsf*A2(xmin,ymin,zmin) - lsf*A2(xmin,ymin,zmax);    else {      zsav = zmin;      b1i += rsf*qsimp(f2,ymin,ymax);      zsav = zmax;      b1i -= lsf*qsimp(f2,ymin,ymax);    }  }  if (A3 != NULL) {    if (zmin == zmax)      b1i += A3(xmin,ymax,zmin) - A3(xmin,ymin,zmin);    else {      ysav = ymax;      b1i += qsimp(f3,zmin,zmax);      ysav = ymin;      b1i -= qsimp(f3,zmin,zmax);    }  }  if (pG->dx2 > 0.0) b1i /= dx2;  if (pG->dx3 > 0.0) b1i /= pG->dx3;  return b1i;}
开发者ID:mikeg64,项目名称:hermes,代码行数:55,


示例13: vecpot2b3i

/*! /fn Real vecpot2b3i(Real (*A1)(Real,Real,Real), Real (*A2)(Real,Real,Real), *                const GridS *pG, const int i, const int j, const int k) *  /brief Compute B-field components from a vector potential. * * THESE FUNCTIONS COMPUTE MAGNETIC FIELD COMPONENTS FROM COMPONENTS OF A * SPECIFIED VECTOR POTENTIAL USING STOKES' THEOREM AND SIMPSON'S QUADRATURE. * NOTE:  THIS IS ONLY GUARANTEED TO WORK IF THE POTENTIAL IS OF CLASS C^1. * WRITTEN BY AARON SKINNER. */Real vecpot2b3i(Real (*A1)(Real,Real,Real), Real (*A2)(Real,Real,Real),                const GridS *pG, const int i, const int j, const int k){  Real x1,x2,x3,b3i=0.0,lsf=1.0,rsf=1.0,dx2=pG->dx2;  Real f1(Real x);  Real f2(Real y);  a1func = A1;  a2func = A2;  cc_pos(pG,i,j,k,&x1,&x2,&x3);  xmin = x1 - 0.5*pG->dx1;  xmax = x1 + 0.5*pG->dx1;  ymin = x2 - 0.5*pG->dx2;  ymax = x2 + 0.5*pG->dx2;  zmin = x3 - 0.5*pG->dx3;  zmax = x3 + 0.5*pG->dx3;  zsav = zmin;#ifdef CYLINDRICAL  rsf = xmax;  lsf = xmin;  dx2 = x1*pG->dx2;#endif  if (A1 != NULL) {    if (xmin == xmax)      b3i += A1(xmin,ymin,zmin) - A1(xmin,ymax,zmin);    else {      ysav = ymin;      b3i += qsimp(f1,xmin,xmax);      ysav = ymax;      b3i -= qsimp(f1,xmin,xmax);    }  }  if (A2 != NULL) {    if (ymin == ymax)      b3i += rsf*A2(xmax,ymin,zmin) - lsf*A2(xmin,ymin,zmin);    else {      xsav = xmax;      b3i += rsf*qsimp(f2,ymin,ymax);      xsav = xmin;      b3i -= lsf*qsimp(f2,ymin,ymax);    }  }  if (pG->dx1 > 0.0) b3i /= pG->dx1;  if (pG->dx2 > 0.0) b3i /= dx2;  return b3i;}
开发者ID:mikeg64,项目名称:hermes,代码行数:55,


示例14: uv

std::vector < Derived > lidarBoostEngine::lk_optical_flow( const MatrixBase<Derived>& I1, const MatrixBase<Derived> &I2, int win_sz){    //Instantiate optical flow matrices    std::vector < Derived > uv(2);    //Create masks    Matrix2d robX, robY, robT;    robX << -1, 1,            -1, 1;    robY << -1, -1,            1, 1;    robT << -1, -1,            -1, -1;    Derived Ix, Iy, It, A, solutions, x_block, y_block, t_block;    //Apply masks to images and average the result    Ix = 0.5 * ( conv2d( I1, robX ) + conv2d( I2, robX ) );    Iy = 0.5 * ( conv2d( I1, robY ) + conv2d( I2, robY ) );    It = 0.5 * ( conv2d( I1, robT ) + conv2d( I2, robT ) );    uv[0] = Derived::Zero( I1.rows(), I1.cols() );    uv[1] = Derived::Zero( I1.rows(), I1.cols() );    int hw = win_sz/2;    for( int i = hw+1; i < I1.rows()-hw; i++ )    {        for ( int j = hw+1; j < I1.cols()-hw; j++ )        {            //Take a small block of window size in the filtered images            x_block = Ix.block( i-hw, j-hw, win_sz, win_sz);            y_block = Iy.block( i-hw, j-hw, win_sz, win_sz);            t_block = It.block( i-hw, j-hw, win_sz, win_sz);            //Convert these blocks in vectors            Map<Derived> A1( x_block.data(), win_sz*win_sz, 1);            Map<Derived> A2( y_block.data(), win_sz*win_sz, 1);            Map<Derived> B( t_block.data(), win_sz*win_sz, 1);            //Organize the vectors in a matrix            A = Derived( win_sz*win_sz, 2 );            A.block(0, 0, win_sz*win_sz, 1) = A1;            A.block(0, 1, win_sz*win_sz, 1) = A2;            //Solve the linear least square system            solutions = (A.transpose() * A).ldlt().solve(A.transpose() * B);            //Insert the solutions in the optical flow matrices            uv[0](i, j) = solutions(0);            uv[1](i, j) = solutions(1);        }    }    return uv;}
开发者ID:yanik-porto,项目名称:3DfromTOF,代码行数:58,


示例15: PushCallStack

inline voidSyrkLN( T alpha, const DistMatrix<T>& A, T beta, DistMatrix<T>& C,   bool conjugate=false ){#ifndef RELEASE    PushCallStack("internal::SyrkLN");    if( A.Grid() != C.Grid() )        throw std::logic_error        ("A and C must be distributed over the same grid");    if( A.Height() != C.Height() || A.Height() != C.Width() )    {        std::ostringstream msg;        msg << "Nonconformal SyrkLN:/n"            << "  A ~ " << A.Height() << " x " << A.Width() << "/n"            << "  C ~ " << C.Height() << " x " << C.Width() << "/n";        throw std::logic_error( msg.str().c_str() );    }#endif    const Grid& g = A.Grid();    // Matrix views    DistMatrix<T> AL(g), AR(g),                  A0(g), A1(g), A2(g);    // Temporary distributions    DistMatrix<T,MC,  STAR> A1_MC_STAR(g);    DistMatrix<T,VR,  STAR> A1_VR_STAR(g);    DistMatrix<T,STAR,MR  > A1Trans_STAR_MR(g);    A1_MC_STAR.AlignWith( C );    A1_VR_STAR.AlignWith( C );    A1Trans_STAR_MR.AlignWith( C );    // Start the algorithm    ScaleTrapezoid( beta, LEFT, LOWER, 0, C );    LockedPartitionRight( A, AL, AR, 0 );    while( AR.Width() > 0 )    {        LockedRepartitionRight        ( AL, /**/ AR,          A0, /**/ A1, A2 );        //--------------------------------------------------------------------//        A1_VR_STAR = A1_MC_STAR = A1;        A1Trans_STAR_MR.TransposeFrom( A1_VR_STAR, conjugate );        LocalTrrk( LOWER, alpha, A1_MC_STAR, A1Trans_STAR_MR, T(1), C );        //--------------------------------------------------------------------//        SlideLockedPartitionRight        ( AL,     /**/ AR,          A0, A1, /**/ A2 );    }#ifndef RELEASE    PopCallStack();#endif}
开发者ID:mcg1969,项目名称:Elemental,代码行数:57,


示例16: main

int main() {// Primary Operators  AnnihilationOperator A1(0);  // 1st freedom  NumberOperator N1(0);  IdentityOperator Id1(0);  AnnihilationOperator A2(1);  // 2nd freedom  NumberOperator N2(1);  IdentityOperator Id2(1);  SigmaPlus Sp(2);             // 3rd freedom  IdentityOperator Id3(2);  Operator Sm = Sp.hc();       // Hermitian conjugate  Operator Ac1 = A1.hc();  Operator Ac2 = A2.hc();// Hamiltonian  double E = 20.0;             double chi = 0.4;        double omega = -0.7;         double eta = 0.001;  Complex I(0.0,1.0);  Operator H = (E*I)*(Ac1-A1)             + (0.5*chi*I)*(Ac1*Ac1*A2 - A1*A1*Ac2)             + omega*Sp*Sm + (eta*I)*(A2*Sp-Ac2*Sm);// Lindblad operators  double gamma1 = 1.0;         double gamma2 = 1.0;         double kappa = 0.1;          const int nL = 3;  Operator L[nL]={sqrt(2*gamma1)*A1,sqrt(2*gamma2)*A2,sqrt(2*kappa)*Sm};// Initial state  State phi1(50,FIELD);       // see paper Section 4.2  State phi2(50,FIELD);  State phi3(2,SPIN);  State stateList[3] = {phi1,phi2,phi3};  State psiIni(3,stateList);// Trajectory  double dt = 0.01;    // basic time step                              int numdts = 100;    // time interval between outputs = numdts*dt    int numsteps = 5;    // total integration time = numsteps*numdts*dt  int nOfMovingFreedoms = 2;  double epsilon = 0.01;     // cutoff probability  int nPad = 2;              // pad size  //ACG gen(38388389);            // random number generator with seed  //ComplexNormal rndm(&gen);     // Complex Gaussian random numbers  ComplexNormalTest rndm(899101); // Simple portable random number generator  AdaptiveStep stepper(psiIni, H, nL, L);       // see paper Section 5// Output  const int nOfOut = 3;  Operator outlist[nOfOut]={ Sp*A2*Sm*Sp, Sm*Sp*A2*Sm, A2 };  char *flist[nOfOut]={"X1.out","X2.out","A2.out"};  int pipe[] = {1,5,9,11}; // controls standard output (see `onespin.cc')// Simulate one trajectory (for several trajectories see `onespin.cc')  Trajectory traj(psiIni, dt, stepper, &rndm);  // see paper Section 5  traj.plotExp( nOfOut, outlist, flist, pipe, numdts, numsteps,                nOfMovingFreedoms, epsilon, nPad );}
开发者ID:cdesrosiers,项目名称:libqsd,代码行数:56,


示例17: A1

Tensor::Tensor()  : A1(3,3), A2(3,3), A3(3,3) {  int i, j;  for (i=1; i<=3; i++)    for (j=1; j<=3; j++) {      A1(i, j) = 0.0;      A2(i, j) = 0.0;      A3(i, j) = 0.0;    }}
开发者ID:BAllanach,项目名称:softsusy,代码行数:10,


示例18: main

int main(){	vector<float> A2(N*N);	vector<float> B2(N*N);		cout << "t4:" << endl;	prob2_2_v2(A2, B2);	cout << "-------" << endl;	return 0;}
开发者ID:pmendozav,项目名称:ucsp,代码行数:11,


示例19: switch

void Tensor::set(int i, int j, int k, double f) {  switch(i) {  case 1: A1(j, k) = f; break;  case 2: A2(j, k) = f; break;  case 3: A3(j, k) = f; break;  default:      ostringstream ii;    ii << "Tensor index out of range: " << i << "/n";    throw ii.str();    break;  }}
开发者ID:BAllanach,项目名称:softsusy,代码行数:12,


示例20: hpx_main

int hpx_main(boost::program_options::variables_map& vm){    {        orthotope<double>            A0({3, 3})          , A1({3, 3})          , A2({3, 3})            , A3({3, 3})          , A4({3, 3})          , A5({4, 4})            ;            // QR {{1, 3, 6}, {3, 5, 7}, {6, 7, 4}}        A0.row(0,  1,    3,    6   );        A0.row(1,  3,    5,    7   );        A0.row(2,  6,    7,    4   );            // QR {{12, -51, 4}, {6, 167, -68}, {-4, 24, -41}}        A1.row(0,  12,  -51,   4   );        A1.row(1,  6,    167, -68  );        A1.row(2, -4,    24,  -41  );         // QR {{2, -2, 18}, {2, 1, 0}, {1, 2, 0}}        A2.row(0,  2,   -2,    18  );        A2.row(1,  2,    1,    0   );        A2.row(2,  1,    2,    0   );           // QR {{0, 1, 1}, {1, 1, 2}, {0, 0, 3}}        A3.row(0,  0,    1,    1   );        A3.row(1,  1,    1,    2   );        A3.row(2,  0,    0,    3   );        // QR {{1, 1, -1}, {1, 2, 1}, {1, 2, -1}}        A4.row(0,  1,    1,   -1   );        A4.row(1,  1,    2,    1   );        A4.row(2,  1,    2,   -1   );            // QR {{4, -2, 2, 8}, {-2, 6, 2, 4}, {2, 2, 10, -6}, {8, 4, -6, 12}}        A5.row(0,  4,   -2,    2,    8   );        A5.row(1, -2,    6,    2,    4   );        A5.row(2,  2,    2,    10,  -6   );        A5.row(3,  8,    4,   -6,    12  );            householders(A0);        householders(A1);        householders(A2);        householders(A3);        householders(A4);        householders(A5);    }    return hpx::finalize(); }
开发者ID:fpelliccioni,项目名称:hpx,代码行数:53,


示例21: main

int main(int argc, char **argv){	int a;	int *p = NULL;	A2(&a);  // A2 > C	printf("a = 0x%x/n", a);	A(p);    // A > B > C	return 0;}
开发者ID:jiayu-daemon,项目名称:s3c2440_drivers,代码行数:12,


示例22: view

void CreateDoubleWayInteraction::paintEvent(QPaintEvent* /* anEvent */, QPainter& thePainter){    if (R1 && (!R1->layer() || R1->isDeleted())) { // The roads were begon and then undoed. Restarting....        HaveFirst = false;        view()->setInteracting(false);        R1 = R2 = NULL;    }    qreal rB = view()->pixelPerM()*DockData.RoadDistance->text().toDouble()/2;    if (!HaveFirst)    {        thePainter.setPen(QColor(0,0,0));        thePainter.drawEllipse(int(LastCursor.x()-rB),int(LastCursor.y()-rB),int(rB*2),int(rB*2));    }    else    {        Coord PreviousPoint;        if (R1 && R1->size())            PreviousPoint = PreviousPoints[R1->size()-1];        else            PreviousPoint = FirstPoint;        if (distance(COORD_TO_XY(PreviousPoint), LastCursor) > 1)        {            qreal rA = FirstDistance * view()->pixelPerM()/2;            LineF FA1(COORD_TO_XY(PreviousPoint),LastCursor);            LineF FA2(FA1);            LineF FB1(FA1);            LineF FB2(FA1);            FA1.slide(-rA);            FA2.slide(rA);            FB1.slide(-rB);            FB2.slide(rB);            QPointF A1(FA1.project(COORD_TO_XY(PreviousPoint)));            QPointF A2(FA2.project(COORD_TO_XY(PreviousPoint)));            QPointF B1(FB1.project(LastCursor));            QPointF B2(FB2.project(LastCursor));            QBrush SomeBrush(QColor(0xff,0x77,0x11,128));            QPen TP(SomeBrush,view()->pixelPerM()*4);            if (DockData.DriveRight->isChecked())            {                ::draw(thePainter,TP,Feature::OneWay, B1,A1,rB/4,view()->projection());                ::draw(thePainter,TP,Feature::OneWay, A2,B2,rB/4,view()->projection());            }            else            {                ::draw(thePainter,TP,Feature::OneWay, A1,B1,rB/4,view()->projection());                ::draw(thePainter,TP,Feature::OneWay, B2,A2,rB/4,view()->projection());            }        }    }}
开发者ID:chxyfish,项目名称:merkaartor,代码行数:53,


示例23: main

int main(int argc, char* argv[]) {	/* Checks for valid number of arguments passed in. */	if(argc < 2) {		perror("Invalid command line arguments! <Frame Size> ");	}	string frame_size = argv[1];	A2 A2(frame_size);	A2.lru();	A2.clock();	A2.opt();}
开发者ID:Wooklien,项目名称:paging-algorithms,代码行数:13,


示例24: A2

real_2d_array PPCA::toR(complex_2d_array A){	real_2d_array A2;	A2.setlength(A.rows(), A.cols());	for(int i=0; i<A.rows(); i++){		for(int j=0; j<A.cols(); j++){			A2(i,j) = A(i,j).x;}			}	return A2;}
开发者ID:Tarekz1,项目名称:Algs,代码行数:14,


示例25: defined

inline CPLSafeInt<GInt64> operator*( const CPLSafeInt<GInt64>& A,                                     const CPLSafeInt<GInt64>& B ){#if defined(BUILTIN_OVERFLOW_CHECK_AVAILABLE) && defined(__x86_64__)    GInt64 res;    if( __builtin_smulll_overflow(A.v(), B.v(), &res) )        throw CPLSafeIntOverflow();    return CPLSM(res);#elif defined(_MSC_VER)    msl::utilities::SafeInt<GInt64, CPLMSVCSafeIntException> A2(A.v());    msl::utilities::SafeInt<GInt64, CPLMSVCSafeIntException> B2(B.v());    return CPLSM(static_cast<GInt64>(A2 * B2));#else    return SafeMulSigned(A,B);#endif}
开发者ID:OSGeo,项目名称:gdal,代码行数:16,


示例26: main

int main(){	int n = 0, a1 = 0, a2 = 0, a3 = 0, a4 = 0, a5 = 0, num = 0;	int count_a1 = 0, count_a2 = 0, count_a3 = 0, count_a4 = 0, count_a5 = 0;	int flag_A2 = 1;	scanf("%d", &n);	for (; n > 0; n--) {		scanf("%d", &num);		A1(num, &a1, &count_a1);		A2(num, &a2, &count_a2, &flag_A2);		A3(num, &a3, &count_a3);		A4(num, &a4, &count_a4);		A5(num, &a5, &count_a5);	}	if (count_a1 > 0)		printf("%d ", a1);	else		printf("N ");	if (count_a2 > 0)		printf("%d ", a2);	else		printf("N ");	if (count_a3 > 0)		printf("%d ", a3);	else		printf("N ");	if (count_a4 > 0)		printf("%.1lf ", (double)a4 / count_a4);	else		printf("N ");	if (count_a5 > 0)		printf("%d", a5);	else		printf("N");	return 0;}
开发者ID:Fireplusplus,项目名称:PAT,代码行数:42,



注:本文中的A2函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ A20函数代码示例
C++ A11函数代码示例
51自学网,即我要自学网,自学EXCEL、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。
京ICP备13026421号-1