当前位置: 首页>>代码示例>>C++>>正文


C++ Polynomial::A方法代码示例

本文整理汇总了C++中Polynomial::A方法的典型用法代码示例。如果您正苦于以下问题:C++ Polynomial::A方法的具体用法?C++ Polynomial::A怎么用?C++ Polynomial::A使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Polynomial的用法示例。


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

示例1: rkPoly

void IntpAkimaUniform2<Real>::Construct (Polynomial& rkPoly, Real aafF[2][2],
    Real aafFX[2][2], Real aafFY[2][2], Real aafFXY[2][2])
{
    Real fDX = m_fXSpacing;
    Real fDY = m_fYSpacing;
    Real fInvDX = ((Real)1.0)/fDX, fInvDX2 = fInvDX*fInvDX;
    Real fInvDY = ((Real)1.0)/fDY, fInvDY2 = fInvDY*fInvDY;
    Real fB0, fB1, fB2, fB3;

    rkPoly.A(0,0) = aafF[0][0];
    rkPoly.A(1,0) = aafFX[0][0];
    rkPoly.A(0,1) = aafFY[0][0];
    rkPoly.A(1,1) = aafFXY[0][0];

    fB0 = (aafF[1][0] - rkPoly(0,0,fDX,(Real)0.0))*fInvDX2;
    fB1 = (aafFX[1][0] - rkPoly(1,0,fDX,(Real)0.0))*fInvDX;
    rkPoly.A(2,0) = ((Real)3.0)*fB0 - fB1;
    rkPoly.A(3,0) = (-((Real)2.0)*fB0 + fB1)*fInvDX;

    fB0 = (aafF[0][1] - rkPoly(0,0,(Real)0.0,fDY))*fInvDY2;
    fB1 = (aafFY[0][1] - rkPoly(0,1,(Real)0.0,fDY))*fInvDY;
    rkPoly.A(0,2) = ((Real)3.0)*fB0 - fB1;
    rkPoly.A(0,3) = (-((Real)2.0)*fB0 + fB1)*fInvDY;

    fB0 = (aafFY[1][0] - rkPoly(0,1,fDX,(Real)0.0))*fInvDX2;
    fB1 = (aafFXY[1][0] - rkPoly(1,1,fDX,(Real)0.0))*fInvDX;
    rkPoly.A(2,1) = ((Real)3.0)*fB0 - fB1;
    rkPoly.A(3,1) = (-((Real)2.0)*fB0 + fB1)*fInvDX;

    fB0 = (aafFX[0][1] - rkPoly(1,0,(Real)0.0,fDY))*fInvDY2;
    fB1 = (aafFXY[0][1] - rkPoly(1,1,(Real)0.0,fDY))*fInvDY;
    rkPoly.A(1,2) = ((Real)3.0)*fB0 - fB1;
    rkPoly.A(1,3) = (-((Real)2.0)*fB0 + fB1)*fInvDY;

    fB0 = (aafF[1][1] - rkPoly(0,0,fDX,fDY))*fInvDX2*fInvDY2;
    fB1 = (aafFX[1][1] - rkPoly(1,0,fDX,fDY))*fInvDX*fInvDY2;
    fB2 = (aafFY[1][1] - rkPoly(0,1,fDX,fDY))*fInvDX2*fInvDY;
    fB3 = (aafFXY[1][1] - rkPoly(1,1,fDX,fDY))*fInvDX*fInvDY;
    rkPoly.A(2,2) = ((Real)9.0)*fB0 - ((Real)3.0)*fB1 - ((Real)3.0)*fB2 + fB3;
    rkPoly.A(3,2) = (-((Real)6.0)*fB0 + ((Real)3.0)*fB1 + ((Real)2.0)*fB2 -
        fB3)*fInvDX;
    rkPoly.A(2,3) = (-((Real)6.0)*fB0 + ((Real)2.0)*fB1 + ((Real)3.0)*fB2 -
        fB3)*fInvDY;
    rkPoly.A(3,3) = (((Real)4.0)*fB0 - ((Real)2.0)*fB1 - ((Real)2.0)*fB2 +
        fB3)*fInvDX*fInvDY;
}
开发者ID:Hengplank,项目名称:kucgbowling,代码行数:46,代码来源:WmlIntpAkimaUniform2.cpp

示例2: rkPoly

//----------------------------------------------------------------------------
void Interp2DAkimaUniform::Construct (Polynomial& rkPoly, Real aafF[2][2],
    Real aafFX[2][2], Real aafFY[2][2], Real aafFXY[2][2])
{
    Real fDX = m_fXSpacing;
    Real fDY = m_fYSpacing;
    Real fInvDX = 1.0f/fDX, fInvDX2 = fInvDX*fInvDX;
    Real fInvDY = 1.0f/fDY, fInvDY2 = fInvDY*fInvDY;
    Real fB0, fB1, fB2, fB3;

    rkPoly.A(0,0) = aafF[0][0];
    rkPoly.A(1,0) = aafFX[0][0];
    rkPoly.A(0,1) = aafFY[0][0];
    rkPoly.A(1,1) = aafFXY[0][0];

    fB0 = (aafF[1][0] - rkPoly(0,0,fDX,0.0f))*fInvDX2;
    fB1 = (aafFX[1][0] - rkPoly(1,0,fDX,0.0f))*fInvDX;
    rkPoly.A(2,0) = 3.0f*fB0 - fB1;
    rkPoly.A(3,0) = (-2.0f*fB0 + fB1)*fInvDX;

    fB0 = (aafF[0][1] - rkPoly(0,0,0.0f,fDY))*fInvDY2;
    fB1 = (aafFY[0][1] - rkPoly(0,1,0.0f,fDY))*fInvDY;
    rkPoly.A(0,2) = 3.0f*fB0 - fB1;
    rkPoly.A(0,3) = (-2.0f*fB0 + fB1)*fInvDY;

    fB0 = (aafFY[1][0] - rkPoly(0,1,fDX,0.0f))*fInvDX2;
    fB1 = (aafFXY[1][0] - rkPoly(1,1,fDX,0.0f))*fInvDX;
    rkPoly.A(2,1) = 3.0f*fB0 - fB1;
    rkPoly.A(3,1) = (-2.0f*fB0 + fB1)*fInvDX;

    fB0 = (aafFX[0][1] - rkPoly(1,0,0.0f,fDY))*fInvDY2;
    fB1 = (aafFXY[0][1] - rkPoly(1,1,0.0f,fDY))*fInvDY;
    rkPoly.A(1,2) = 3.0f*fB0 - fB1;
    rkPoly.A(1,3) = (-2.0f*fB0 + fB1)*fInvDY;

    fB0 = (aafF[1][1] - rkPoly(0,0,fDX,fDY))*fInvDX2*fInvDY2;
    fB1 = (aafFX[1][1] - rkPoly(1,0,fDX,fDY))*fInvDX*fInvDY2;
    fB2 = (aafFY[1][1] - rkPoly(0,1,fDX,fDY))*fInvDX2*fInvDY;
    fB3 = (aafFXY[1][1] - rkPoly(1,1,fDX,fDY))*fInvDX*fInvDY;
    rkPoly.A(2,2) = 9.0f*fB0 - 3.0f*fB1 - 3.0f*fB2 + fB3;
    rkPoly.A(3,2) = (-6.0f*fB0 + 3.0f*fB1 + 2.0f*fB2 - fB3)*fInvDX;
    rkPoly.A(2,3) = (-6.0f*fB0 + 2.0f*fB1 + 3.0f*fB2 - fB3)*fInvDY;
    rkPoly.A(3,3) = (4.0f*fB0 - 2.0f*fB1 - 2.0f*fB2 + fB3)*fInvDX*fInvDY;
}
开发者ID:OpenXRay,项目名称:xray,代码行数:44,代码来源:MgcInterp2DAkimaUniform.cpp


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