void CPCAGrid::BackTransform () { ASSERT_TEMPRANGE (0, 2) ; SMatD m_mTempPP (tempRef (0), m_dwPSub, m_dwPSub) ; SetDiag_sq (!m_mTempPP) ; int dwIdxRef = m_vOrd (0) ; set_neg (*m_vAfinBest) ; m_vAfinBest (dwIdxRef) += 1 ; double dNorm = norm2 (m_vAfinBest) ; if (dNorm > m_dZeroTol) { static const double dSqrt2 = sqrt ((double) 2.0) ; EO<SOP::a_divide>::VSc (*m_vAfinBest, dNorm / dSqrt2) ; EO<SOP::AsaBmC>::MVcVct (!m_mTempPP, m_vAfinBest, m_vAfinBest) ; } SMatD mProjSorted (tempRef (1), m_dwPSub, m_dwPSub) ; mProjSorted.CopyCol_Order_NC (m_mTempPP, *m_vOrd) ; // undo sorting SMatD mOldLoadings (tempRef (2), m_dwP, m_dwPSub) ; // 2do: copying cols should be done in constructor (using GetColRef () CopyCol (!mOldLoadings, m_mL, m_dwCurK, m_dwP) ; sme_matmult (mOldLoadings, mProjSorted, !m_mL.GetColRef (m_dwCurK, m_dwP)) ; sme_matmult_R (TempY (), mProjSorted.GetColRef (1, m_dwPSub), !TempYC ()) ; SwapTempY () ; }
void Table::bind_script(lua_State* const vm) { if(m_table_ref.m_lua == vm)return; if(m_table_ref.valid() ) { Lua_table_ref tempRef(vm); m_table_ref.swap(tempRef); } else m_table_ref.m_lua = vm; }
void CPCAGrid::GridPlane (double dCurSplit) { const double dASinNL = asin (m_dNL) ; const double dSm1 = (m_dwSplitCircle > 1) ? m_dwSplitCircle - 1 : 1 ; double dSplitFact = meal_PI () * dCurSplit ; InitPenalty () ; t_size i ; ASSERT_TEMPRANGE (11, 11) ; SVecD vProj (tempRef (11), m_dwN) ; m_dBestObj = meal_NegInf () ; if (m_dNL && fabs (m_dNL) < 1e-6) EvalDirection (1, 0) ; const t_size dwEnd = (dCurSplit == 1.0) ? m_dwSplitCircle - 1 : m_dwSplitCircle ; // dCurSplit means, that we're checking an angle of 180° ( = PI). thus the first and last checked point would be the same. for (i = 0; i < dwEnd; i++) { double dAngle = (i / dSm1 - 0.5) * dSplitFact + dASinNL; EvalDirection (cos (dAngle), sin (dAngle)) ; } if (m_dwCheckOrth) // always false for PCAgrid and sPCAgrid m_dCurScat = sqrt (CalcVarTrimmed (m_dNCL, m_dNL, m_dCurScat, m_dCurScatOrth)) ; // m_dCurScat = CalcScatTrimmed (m_dNCL, m_dNL, m_dCurScat, m_dCurScatOrth) ; // else // m_dCurScat = m_dCurScat ; }