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; }
//---------------------------------------------------------------------------- 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; }