• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ InnerProduct函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Multiply

bool CAR_DKW_o::SetParameters_InitializeABOmega()
{
	if (!CAR_DKW::SetParameters_InitializeABOmega())
		return false; 

	TDenseMatrix lambda1 = SIGMA_inverse * SIGMAlambda1;
        TDenseVector KAPPAtheta = KAPPA * theta;
        TDenseVector theta_Q;

	aI_Q.Zeros(dataP->MATgrid_options.Dimension());
        bI_Q.Zeros(dataP->MATgrid_options.Dimension(), Nfac);
        
        for (int i=0; i<dataP->MATgrid_options.Dimension(); i++)
        {
                double MAT = dataP->MATgrid_options(i);
                TDenseVector temp_ay;
                TDenseMatrix temp_by;
                if (!YieldFacLoad(temp_ay, temp_by, KAPPA_rn, Inv_KAPPA_rn, Inv_Kron_KAPPA_rn, SIGMA, KAPPAtheta, rho0, rho1, lambda0,TDenseVector(1,MAT)))
                        return false;
                TDenseVector temp_by_vector = temp_by.RowVector(0); // -MAT * temp_by.RowVector(0);

                theta_Q = Multiply(Inv_KAPPA_rn, KAPPAtheta-SIGMA*lambda0+MultiplyTranspose(SIGMA,SIGMA)*temp_by_vector);

                double rho0_Q = rho0_pi - InnerProduct(lambda0, sigq)+InnerProduct(sigq, TransposeMultiply(SIGMA,temp_by_vector));
                TDenseVector rho1_Q = rho1_pi - TransposeMultiply(lambda1, sigq);

                double temp_aI_Q;
                TDenseVector temp_bI_Q;
                InfExpFacLoad(temp_aI_Q, temp_bI_Q, KAPPA_rn, Inv_KAPPA_rn, Inv_Kron_KAPPA_rn, SIGMA, theta_Q, sigq, sigqx, rho0_Q, rho1_Q, MAT);

                aI_Q(i) = temp_aI_Q;
                bI_Q.InsertRowMatrix(i, 0, temp_bI_Q);
        }
	return true; 
}
开发者ID:parb220,项目名称:DKW,代码行数:35,代码来源:CAR_DKW_o.cpp


示例2: CompMod

void CompMod(zz_pX& x, const zz_pX& g, const zz_pXArgument& A, 
             const zz_pXModulus& F)
{
   if (deg(g) <= 0) {
      x = g;
      return;
   }


   zz_pX s, t;
   vec_zz_p scratch(INIT_SIZE, F.n);

   long m = A.H.length() - 1;
   long l = ((g.rep.length()+m-1)/m) - 1;

   zz_pXMultiplier M;
   build(M, A.H[m], F);

   InnerProduct(t, g.rep, l*m, l*m + m - 1, A.H, F.n, scratch);
   for (long i = l-1; i >= 0; i--) {
      InnerProduct(s, g.rep, i*m, i*m + m - 1, A.H, F.n, scratch);
      MulMod(t, t, M, F);
      add(t, t, s);
   }

   x = t;
}
开发者ID:av-elier,项目名称:fast-exponentiation-algs,代码行数:27,代码来源:lzz_pX1.c


示例3: PlainUpdateMap

void PlainUpdateMap(vec_zz_p& xx, const vec_zz_p& a, 
                    const zz_pX& b, const zz_pX& f)
{
   long n = deg(f);
   long i, m;

   if (IsZero(b)) {
      xx.SetLength(0);
      return;
   }

   m = n-1 - deg(b);

   vec_zz_p x(INIT_SIZE, n);

   for (i = 0; i <= m; i++)
      InnerProduct(x[i], a, b.rep, i);

   if (deg(b) != 0) {
      zz_pX c(INIT_SIZE, n);
      LeftShift(c, b, m);

      for (i = m+1; i < n; i++) {
         MulByXMod(c, c, f);
         InnerProduct(x[i], a, c.rep);
      }
   }

   xx = x;
}
开发者ID:av-elier,项目名称:fast-exponentiation-algs,代码行数:30,代码来源:lzz_pX1.c


示例4: CompMod

void CompMod(ZZ_pX& x, const ZZ_pX& g, const ZZ_pXArgument& A, 
             const ZZ_pXModulus& F)
{
   if (deg(g) <= 0) {
      x = g;
      return;
   }


   ZZ_pX s, t;
   ZZVec scratch(F.n, ZZ_p::ExtendedModulusSize());

   long m = A.H.length() - 1;
   long l = ((g.rep.length()+m-1)/m) - 1;

   ZZ_pXMultiplier M;
   build(M, A.H[m], F);

   InnerProduct(t, g.rep, l*m, l*m + m - 1, A.H, F.n, scratch);
   for (long i = l-1; i >= 0; i--) {
      InnerProduct(s, g.rep, i*m, i*m + m - 1, A.H, F.n, scratch);
      MulMod(t, t, M, F);
      add(t, t, s);
   }

   x = t;
}
开发者ID:Brainloop-Security,项目名称:secret-sharing,代码行数:27,代码来源:ZZ_pX1.cpp


示例5: DoubleDeriv1

double DoubleDeriv1 (edge *TheEdge, position *ThePosition, line *TheLine,
		     int index_x, int index_y)
{
  int index;
  double dv[3], v[3], newv[3], hat[3], temp1;

  if (!TheEdge || !ThePosition || !TheLine) return (0.0);

  if (index_y < index_x) {
    index = index_x; index_x = index_y; index_y = index;
  }

  ComputeV (v, *TheLine);
  RotateQuaternion (newv, ThePosition->q, v);
  temp1 = InnerProduct (newv, TheEdge->m);

  if ((index_x == THETA) && (index_y == THETA) ||
      (index_x == OMEGA) && (index_y == OMEGA))
    return (-2.0 * sqr(temp1));

  if ((index_x == THETA) && (index_y == OMEGA))
    return (0.0);

  if (((index_x == THETA) || (index_x == OMEGA)) &&
      ((index_y == ALPHA) || (index_y == BETA) || (index_y == GAMMA))) {

    if (index_x == THETA) {
      hat[0] = 0.0; hat[1] = -1.0; hat[2] = 0.0;
    } else {
      hat[0] = 1.0; hat[1] =  0.0; hat[2] = 0.0;
    }

    RotateQuaternion (v, TheLine->q, hat);
    RotateQuaternion (newv, ThePosition->q, v);

    DerivR (dv, newv, IndexToAxis (index_y));

    return (2.0 * temp1 * InnerProduct (dv, TheEdge->m));
  }

  if ( ((index_x == ALPHA) || (index_x == BETA) || (index_x == GAMMA)) &&
       ((index_y == ALPHA) || (index_y == BETA) || (index_y == GAMMA)) ) {
    
    ComputeV (v, *TheLine);
    RotateQuaternion (newv, ThePosition->q, v);

    DoubleDerivR (dv, newv, IndexToAxis (index_x), IndexToAxis (index_y));

    return (2.0 * temp1 * InnerProduct (dv, TheEdge->m));
  }

  pexit ("Bad Parameters to DoubleDeriv1");

  return 0.0;
}
开发者ID:oakfr,项目名称:omni3d,代码行数:55,代码来源:stageAB.c


示例6: ComputeGS

static
void ComputeGS(mat_ZZ& B, xdouble **B1, xdouble **mu, xdouble *b, 
               xdouble *c, long k, xdouble bound, long st, xdouble *buf)
{
   long n = B.NumCols();
   long i, j;
   xdouble s, t1, y, t;
   ZZ T1;

   xdouble *mu_k = mu[k];

   if (st < k) {
      for (i = 1; i < st; i++)
         buf[i] = mu_k[i]*c[i];
   }

   for (j = st; j <= k-1; j++) {
      if (b[k]*b[j] < NTL_FDOUBLE_PRECISION*NTL_FDOUBLE_PRECISION) {
         double z = 0;
         xdouble *B1_k = B1[k];
         xdouble *B1_j = B1[j];

         for (i = 1; i <= n; i++)
            z += B1_k[i].x * B1_j[i].x;

         s = z;
      }
      else {
         s = InnerProduct(B1[k], B1[j], n);
   
         if (s*s <= b[k]*b[j]/bound) {
            InnerProduct(T1, B(k), B(j));
            conv(s, T1);
         }
      }

      xdouble *mu_j = mu[j];

      t1 = 0;
      for (i = 1; i <= j-1; i++)
         MulAdd(t1, t1, mu_j[i], buf[i]);

      mu_k[j] = (buf[j] = (s - t1))/c[j];
   }

   s = 0;
   for (j = 1; j <= k-1; j++)
      MulAdd(s, s, mu_k[j], buf[j]);

   c[k] = b[k] - s;
}
开发者ID:axelexic,项目名称:NTL,代码行数:51,代码来源:LLL_XD.c


示例7: Deriv1

double Deriv1 (edge *TheEdge, position *ThePosition, line *TheLine,
	       int index)
{
  double v[3], newv[3], dv[3], hat[3];

  if (!TheEdge || !ThePosition || !TheLine) return (0.0);

  switch (index) {
    case THETA :
      hat[0] = 0.0;  hat[1] = -1.0;  hat[2] = 0.0;
      RotateQuaternion (dv, TheLine->q, hat);
      RotateQuaternion (newv, ThePosition->q, dv);
      return (InnerProduct (newv, TheEdge->m));
      break;

    case OMEGA :
      hat[0] = 1.0;  hat[1] = 0.0;  hat[2] = 0.0;
      RotateQuaternion (dv, TheLine->q, hat);
      RotateQuaternion (newv, ThePosition->q, dv);
      return (InnerProduct (newv, TheEdge->m));
      break;

    case ALPHA :
      ComputeV (v, *TheLine);
      RotateQuaternion (newv, ThePosition->q, v);
      DerivR (dv, newv, 'x');
      return (InnerProduct (dv, TheEdge->m));
      break;

    case BETA :
      ComputeV (v, *TheLine);
      RotateQuaternion (newv, ThePosition->q, v);
      DerivR (dv, newv, 'y');
      return (InnerProduct (dv, TheEdge->m));
      break;

    case GAMMA :
      ComputeV (v, *TheLine);
      RotateQuaternion (newv, ThePosition->q, v);
      DerivR (dv, newv, 'z');
      return (InnerProduct (dv, TheEdge->m));
      break;

    default :
      pexit ("Bad parameters to Deriv1");
      break;
  }

  return 0.0;
}
开发者ID:oakfr,项目名称:omni3d,代码行数:50,代码来源:stageAB.c


示例8: a0

double SBVAR::LogLikelihood(void)
{
  double log_likelihood=log_likelihood_constant + lambda_T*LogAbsDeterminant(A0);
  TDenseVector a0(n_vars), aplus(n_predetermined);

  for (int i=n_vars-1; i >= 0; i--)
    {
      a0.RowVector(A0,i);
      aplus.RowVector(Aplus,i);
      log_likelihood+=-0.5*(InnerProduct(a0,a0,YY) - 2.0*InnerProduct(aplus,a0,XY) + InnerProduct(aplus,aplus,XX));
    }

  return log_likelihood;
}
开发者ID:parb220,项目名称:dsmh_package,代码行数:14,代码来源:sbvar.cpp


示例9: Integrate

/*
   Computes the log of the integral of the tempered posterior.

         Integrate( (p(Y|Theta)*p(Theta))^(1/K) dTheta )
*/
double SBVAR_symmetric_linear::LogPosteriorIntegral(TDenseVector p, int ndraws, int thin, int burn_in)
{
  if (ndraws <= 0) throw dw_exception("PosteriorIntegral(): number of draws must be postive");
  if (thin <= 0) throw dw_exception("PosteriorIntegral(): thinning factor must be positive");
  if (p.dim != NumberParameters()) throw dw_exception("PosteriorIntegral(): Incorrect number of parameters");

  if (!simulation_info_set) SetSimulationInfo();

  SetParameters(p.vector);

  double integral=log_likelihood_constant + log_prior_constant;
  for (int i=0; i < n_vars; i++)
    integral+=0.5*dim_g[i]*1.837877066409345 + LogAbsDeterminant(Simulate_SqrtH[i]);  // 1.837877066409345 = log(2*pi)

  integral+=lambda_T*LogAbsDeterminant(A0);
  for (int i=0; i < n_vars; i++)
    {
      TDenseVector x=InverseMultiply(Simulate_SqrtS[i],p.SubVector(begin_b[i],begin_b[i]+dim_b[i]-1));
      integral+=-0.5*lambda_T*InnerProduct(x,x);
    }

  for (int i=0; i < n_vars; i++)
    integral-=LogConditionalA0_gibbs(p,i,ndraws,thin,burn_in);

  return integral;
}
开发者ID:parb220,项目名称:dsmh_package,代码行数:31,代码来源:sbvar.cpp


示例10: wrapper

    wrapper(size_t n, params prm = params(),
            const backend_params &bprm = backend_params(),
            const InnerProduct &inner_product = InnerProduct()
            )
        : s(prm.get("type", runtime::solver::bicgstab)), handle(0)
    {
        if (!prm.erase("type")) AMGCL_PARAM_MISSING("type");

        switch(s) {

#define AMGCL_RUNTIME_SOLVER(type) \
            case type: \
                handle = static_cast<void*>(new amgcl::solver::type<Backend, InnerProduct>(n, prm, bprm, inner_product)); \
                break

            AMGCL_RUNTIME_SOLVER(cg);
            AMGCL_RUNTIME_SOLVER(bicgstab);
            AMGCL_RUNTIME_SOLVER(bicgstabl);
            AMGCL_RUNTIME_SOLVER(gmres);
            AMGCL_RUNTIME_SOLVER(lgmres);
            AMGCL_RUNTIME_SOLVER(fgmres);
            AMGCL_RUNTIME_SOLVER(idrs);

#undef AMGCL_RUNTIME_SOLVER

            default:
                throw std::invalid_argument("Unsupported solver type");
        }
    }
开发者ID:ddemidov,项目名称:amgcl,代码行数:29,代码来源:runtime.hpp


示例11: GillespiePetzold_Stepsize

    double GillespiePetzold_Stepsize(Vector& x ,
                          Vector& a ,
                          double & a0 ,
                          const Matrix& nu ,
                          double tau,
                          double eps, 
                          PropensityJacobianFunc jacobian)
    {
	static Matrix f(x.Size(), x.Size()); 
	static Vector mu = a; 
	static Vector sigma = a; 
	static double r1, r2; 
	static double tau1, tau2; 

	f = jacobian(x)*nu; 
	mu = f*a; 
	sigma = InnerProduct(f, f)*a; 
	r1 = mu.Norm(); //Max norm
	r2 = sigma.Norm(); // Max norm
	tau1 = eps * a0; 
	tau2 = tau1 * tau1; 
	if (r1 > 0) 
	  tau1 = tau1/r1; 
	else 
	  tau1 = 100.; 
	if (r2 > 0) 
	  tau2 = tau2/r2; 
	else 
	  tau2 = 100.; 
 
	if (tau1 > tau2) 
	  return tau2; 
	else 
	  return tau1; 
    }
开发者ID:Azhag,项目名称:master-thesis,代码行数:35,代码来源:GillespiePetzoldStepsize.cpp


示例12: CharPolyBound

NTL_START_IMPL

static
long CharPolyBound(const mat_ZZ& a)
// This bound is computed via interpolation
// through complex roots of unity.

{
   long n = a.NumRows();
   long i;
   ZZ res, t1, t2;

   set(res);

   for (i = 0; i < n; i++) {
      InnerProduct(t1, a[i], a[i]);
      abs(t2, a[i][i]);
      mul(t2, t2, 2);
      add(t2, t2, 1);
      add(t1, t1, t2);
      if (t1 > 1) {
         SqrRoot(t1, t1);
         add(t1, t1, 1);
      }
      mul(res, res, t1);
   }

   return NumBits(res);
}
开发者ID:Brainloop-Security,项目名称:secret-sharing,代码行数:29,代码来源:mat_poly_ZZ.cpp


示例13: DoCP0Test

TInt DoCP0Test(TAny* aPtr)
	{
	TUint seed[2];
	seed[0]=(TUint)aPtr;
	seed[1]=0;
	TInt16 vec1[128];
	TInt16 vec2[128];
	TInt run;
	for (run=0; run<100000; ++run)
		{
		TInt n=(Random(seed)&63)+64;		// vector length
		TInt i;
		for (i=0; i<n; ++i)
			{
			vec1[i]=(TInt16)(Random(seed)&0xffff);
			vec2[i]=(TInt16)(Random(seed)&0xffff);
			TInt64 result, result2;
			InnerProduct(result,vec1,vec2,n);
			InnerProduct2(result2,vec1,vec2,n);
			if (result != result2)
				{
				User::Panic(_L("ERROR"),run);
				}
			}
		}
	return 0;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:27,代码来源:t_cp0.cpp


示例14: Evaluate

 double ScalarFiniteElement<D> :: 
 Evaluate (const IntegrationPoint & ip, FlatVector<double> x) const
 {
   VectorMem<20, double> shape(ndof);
   CalcShape (ip, shape);
   return InnerProduct (shape, x);
 }  
开发者ID:mliertzer,项目名称:ngsolve,代码行数:7,代码来源:scalarfe.cpp


示例15: ProjectPowers

void ProjectPowers(vec_zz_p& x, const vec_zz_p& a, long k,
                   const zz_pXArgument& H, const zz_pXModulus& F)

{
   long n = F.n;

   if (a.length() > n || k < 0 || NTL_OVERFLOW(k, 1, 0))
      Error("ProjectPowers: bad args");

   long m = H.H.length()-1;
   long l = (k+m-1)/m - 1;

   zz_pXMultiplier M;
   build(M, H.H[m], F);

   vec_zz_p s(INIT_SIZE, n);
   s = a;
   StripZeroes(s);

   x.SetLength(k);

   for (long i = 0; i <= l; i++) {
      long m1 = min(m, k-i*m);
      zz_p* w = &x[i*m];
      for (long j = 0; j < m1; j++)
         InnerProduct(w[j], H.H[j].rep, s);
      if (i < l)
         UpdateMap(s, s, M, F);
   }
}
开发者ID:av-elier,项目名称:fast-exponentiation-algs,代码行数:30,代码来源:lzz_pX1.c


示例16: CalculateHardening

    //--------------------------------------------------------------------------------
    //
    //  CalculateHardening
    //     Current used for testing the other parts of the code.
    //
    //
    //  This is almost a direct translation from Ricardo's "HARDEN" routine from fft3.for
    //
    //--------------------------------------------------------------------------------
    vector<Float> CalculateHardening( Float & AccumulatedShear,
                                      const Float              & TimeStep,
                                      const EigenRep           & StressState,
                                      const vector<EigenRep>   & SchmidtTensors,
                                      const vector<Float>      & CRSS,
                                      const vector<Float>      & GammaDotBase,         // reference shear rate
                                      const vector<int>        & RateSensitivity,
                                      const vector< vector< Float > > & HardeningMatrix,
                                      const vector<Float> & Tau0,
                                      const vector<Float> & Tau1,
                                      const vector<Float> & Theta0,
                                      const vector<Float> & Theta1  )
    {

      vector<Float> UpdatedCRSS    = CRSS;
      Float LocalShearAccumulation = 0;
      std::vector<Float> GammaDot( SchmidtTensors.size(), 0 );            
      for( int i = 0; i < SchmidtTensors.size(); i ++ )
      {
        Float RSS = InnerProduct( SchmidtTensors[i], StressState) / CRSS[i];
        if( RateSensitivity[i] > 0 )
          GammaDot[i] = GammaDotBase[i] * std::pow( std::fabs( RSS ), static_cast<int>( RateSensitivity[i] ) );
        else
          GammaDot[i] = GammaDotBase[i];
        LocalShearAccumulation += std::fabs( GammaDot[i] ) * TimeStep;
      }



      for( int i = 0; i < SchmidtTensors.size(); i ++ )
      {
        Float DTau = 0;
        for( int j = 0; j < SchmidtTensors.size(); j ++ )
          DTau += HardeningMatrix[i][j] * std::fabs( GammaDot[j] ) * TimeStep;


        Float Tiny = 1e-4 * Tau0[i];
        Float VoceFactor = 0;
        if( std::fabs( Theta0[i] ) > Tiny  )
        {
          VoceFactor = Theta1[i] * LocalShearAccumulation;
          if( std::fabs( Tau1[i]) > Tiny )
          {
            Float fRatio = std::fabs( Theta0[i] / Tau1[i] );
            Float ExpIni = exp( -AccumulatedShear       * fRatio );
            Float ExpDel = exp( -LocalShearAccumulation * fRatio );

            VoceFactor = VoceFactor - (fRatio * Tau1[i] * Theta1[i])/ fRatio * ExpIni
              * ( ExpDel - static_cast<Float>(1) ) - Theta1[i]/fRatio * ExpIni
              * ( ExpDel * ( ( AccumulatedShear + LocalShearAccumulation)
                             * fRatio + static_cast<Float>(1) )
                  - ( AccumulatedShear * fRatio + static_cast<Float>(1) ) );
          }
        }
        UpdatedCRSS[i] += DTau * VoceFactor / LocalShearAccumulation;
      }

      AccumulatedShear += LocalShearAccumulation;
      return UpdatedCRSS;
    }
开发者ID:exmatex,项目名称:VPFFT,代码行数:69,代码来源:Solvers.cpp


示例17: stb_InnerProduct

complex stb_InnerProduct(stabiliser *phi1, stabiliser *phi2)
{
    affine_sp a = afp_Copy(phi1->a); //This won't work. I need to define a copy method
    stabiliser stab;
    stab.a = &a;
    stab.q = phi1->q;
    affine_sp *a1 = phi1->a, *a2 = phi2->a;
    quadratic_fm *q1 = phi1->q, *q2 = phi2->q;
    for (int i = a2->k +1; i < a2->n; i++){
        alpha = InnerProduct(a2->h, a2->GBar[i])
        res = shrink(&stab, a2->HBar[i], alpha);
        if (res == EMPTY){
            return (complex) 0;
        }
    }
    short *y = (short *)calloc(a2->k, sizeof(short));
    short *scratch_space = (short *)calloc(a2->n, sizeof(short));
    short res = 0;
    AddVectors(a2->n, scratch_space, a1->h);
    AddVectors(a2->n, scratch_space, a2->h);
    short **R = (short **)calloc(a2->n, sizeof(short*));
    for (int i=0; i<a2->n; i++){R[i] = (short *)calloc(a2->n, sizeof(short));}
    for (int i = 0; i < a2->k; i++){
        y[i] = InnerProduct(scratch_space, a2->Gbar[i]);
        for (int j = 0; j < a.k; j++){
            R[j][i] = InnerProduct(a.G[j], a2.GBar[i]);
        }

    }
    qfm_BasisChange(q2, R);
    qfm_ShiftChange(q2, y);
    for (int i = 0; i<a2->n; i++){a2->h[i] = a1->h[i];}
    //Cleanup
    for(int i = 0; i<q2->k; i++){free(R[i]);}
    free(scratch_space);
    free (R);
    free(y);
    //Find the final quadratic form q
    q.Q = Modulo(q1->Q - q2->Q, 8);
    for (int i = 0; i < q.K; i++){ 
        q.D[i] = Modulo(q1->D[i]-q2->D[i], 8);
        for (int j = 0; j<q.k; j++){
            q.J[i][j] = Modulo(q1->J[i][j] - q2->J[i][j], 8);
        }
    }
    return pow(2, -1*(a1->k - a2->k)/2)*ExponentialSum(q);
}
开发者ID:padraic-padraic,项目名称:StabilizerRank,代码行数:47,代码来源:stabiliserproduct.c


示例18: IncrementalGS

static
void IncrementalGS(mat_ZZ& B, vec_long& P, vec_ZZ& D, vec_vec_ZZ& lam,
                   long& s, long k)
{
   long n = B.NumCols();
   long m = B.NumRows();

   static ZZ u, t1, t2;

   long i, j;

   for (j = 1; j <= k-1; j++) {
      long posj = P(j);
      if (posj == 0) continue;

      InnerProduct(u, B(k), B(j));
      for (i = 1; i <= posj-1; i++) {
         mul(t1, D[i], u);
         mul(t2, lam(k)(i), lam(j)(i));
         sub(t1, t1, t2);
         div(t1, t1, D[i-1]);
         u = t1;
      }

      lam(k)(posj) = u;
   }

   InnerProduct(u, B(k), B(k));
   for (i = 1; i <= s; i++) {
      mul(t1, D[i], u);
      mul(t2, lam(k)(i), lam(k)(i));
      sub(t1, t1, t2);
      div(t1, t1, D[i-1]);
      u = t1;
   }

   if (u == 0) {
      P(k) = 0;
   }
   else {
      s++;
      P(k) = s;
      D[s] = u;
   }
}
开发者ID:Macaulay2,项目名称:Singular,代码行数:45,代码来源:LLL.c


示例19: Convolution

long Convolution(CircultBuffer *rb,int const *Hn,int ADC_Value){ //Input ADCoutput,Output FIR coef
  long Sum=0;
  rb->NewValue=ADC_Value;
  rb->Coef[rb->Front] = ADC_Value;
  rb->Front++;
  rb->Front &=(rb->len-1);  //modular operation
  Sum=InnerProduct((int*)Hn,rb->Coef,rb->len,rb->Front);
  return Sum;
}
开发者ID:geniustom,项目名称:HRVM,代码行数:9,代码来源:Fir.c


示例20: InnerProduct

double CMercerKernel<vec3>::Evaluate(vec3* x, vec3* y) {

    double result = 0;

    for(size_t i=0; i<m_n; i++)
        result += InnerProduct(x[i],y[i]);

    return result;

}
开发者ID:caomw,项目名称:r4r,代码行数:10,代码来源:kernels.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ InputPortConfig_Void函数代码示例发布时间:2022-05-30
下一篇:
C++ InlineIsEqualGUID函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap