void CLCDScrollingText::SetText(LPCTSTR szText) { if (_tcscmp(szText, m_sText.c_str())) { ResetUpdate(); } CLCDText::SetText(szText); }
void CLCDStreamingText::SetText(LPCTSTR szText) { assert(NULL != szText); if(szText && _tcscmp(m_szText, szText)) { _tcsncpy(m_szText, szText, MAX_TEXT); m_bRecalcExtent = TRUE; ResetUpdate(); } }
void BasicSkewGenerator::UpdateSkewGenerator(ShortStack &total_theory) { // put everything to null ResetUpdate(); //for (unsigned int i_read=0; i_read<total_theory.my_hypotheses.size(); i_read++){ for (unsigned int i_ndx = 0; i_ndx < total_theory.valid_indexes.size(); i_ndx++) { unsigned int i_read = total_theory.valid_indexes[i_ndx]; AddCrossUpdate(total_theory.my_hypotheses[i_read]); } DoLatentUpdate(); // new latent predictors for sigma }
// important: residuals need to be reset before this operation void BasicBiasGenerator::UpdateBiasGenerator(ShortStack &my_theory) { ResetUpdate(); //for (unsigned int i_read=0; i_read<total_theory.my_hypotheses.size(); i_read++){ for (unsigned int i_ndx = 0; i_ndx < my_theory.valid_indexes.size(); i_ndx++) { unsigned int i_read = my_theory.valid_indexes[i_ndx]; AddCrossUpdate(my_theory.my_hypotheses[i_read]); } DoUpdate(); // new bias estimated //cout << "Bias " << bias_generator.latent_bias[0] << "\t" << bias_generator.latent_bias[1] << endl; }
void CLCDStreamingText::SetOrigin(int nX, int nY) { m_Origin.x = nX; m_Origin.y = nY; LCD_OBJECT_LIST::iterator it = m_Objects.begin(); if (it != m_Objects.end()) { CLCDBase *pObject = *it; POINT ptOldOrigin = pObject->GetOrigin(); pObject->SetOrigin(nX, nY); if ( (ptOldOrigin.x != nX) && (ptOldOrigin.y != nY) ) { ResetUpdate(); } } }
// important: residuals do not need to be reset before this operation (predictions have been corrected for bias already) void BasicSigmaGenerator::UpdateSigmaGenerator(ShortStack &total_theory) { // put everything to null ResetUpdate(); // float k_zero = 1.0f; for (unsigned int i_ndx = 0; i_ndx < total_theory.valid_indexes.size(); i_ndx++) { unsigned int i_read = total_theory.valid_indexes[i_ndx]; AddCrossUpdate(total_theory.my_hypotheses[i_read]); } // now that I've established basic weight, I can update for (unsigned int i_ndx = 0; i_ndx < total_theory.valid_indexes.size(); i_ndx++) { unsigned int i_read = total_theory.valid_indexes[i_ndx]; // additional variability from cluster shifting // bayesian multidimensional normal AddShiftCrossUpdate(total_theory.my_hypotheses[i_read], k_zero); } DoLatentUpdate(); // new latent predictors for sigma }
void CLCDScrollingText::OnDraw(CLCDGfxBase &rGfx) { if (!m_nTextLength) { return; } // calculate the scrolling distance if (-1 == m_nScrollingDistance) { CLCDText::OnDraw(rGfx); if (SCROLL_VERT == m_eScrollDir) { // determine how far we have to travel until scrolling stops m_nScrollingDistance = ((GetHeight()) >= GetVExtent().cy) ? 0 : (GetVExtent().cy - GetHeight()); SetLogicalSize(GetVExtent().cx, GetVExtent().cy); } else { // determine how far we have to travel until scrolling stops m_nScrollingDistance = ((GetWidth()) >= GetHExtent().cx) ? 0 : (GetHExtent().cx - GetWidth()); SetLogicalSize(max(GetSize().cx, GetHExtent().cx), GetHExtent().cy); } } switch(m_eState) { case STATE_START_DELAY: if (m_dwEllapsedTime > m_dwStartDelay) { m_eState = STATE_SCROLL; m_dwEllapsedTime = 0; m_dwLastUpdate = GetTickCount(); } break; case STATE_END_DELAY: if (m_dwEllapsedTime > m_dwEndDelay) { if (m_bRepeat) { ResetUpdate(); break; } m_dwEllapsedTime = 0; m_dwLastUpdate = GetTickCount(); m_eState = STATE_DONE; } break; case STATE_SCROLL: { // TODO: add some anti-aliasing on the movement // how much time has ellapsed? // given the speed, what is the total displacement? float fDistance = (float)(m_dwSpeed * m_dwEllapsedTime) / 1000.0f; m_fTotalDistance += fDistance; // we dont want the total distnace exceed our scrolling distance int nTotalOffset = min((int)m_fTotalDistance, m_nScrollingDistance); if (SCROLL_VERT == m_eScrollDir) { SetLogicalOrigin(GetLogicalOrigin().x, -1 * nTotalOffset); } else { SetLogicalOrigin(-1 * nTotalOffset, GetLogicalOrigin().y); } m_dwLastUpdate = GetTickCount(); if (nTotalOffset == m_nScrollingDistance) { m_eState = STATE_END_DELAY; } } break; case STATE_DONE: break; default: break; } CLCDText::OnDraw(rGfx); }
void CLCDScrollingText::SetScrollDirection(eSCROLL_DIR eScrollDir) { m_eScrollDir = eScrollDir; SetWordWrap(eScrollDir == SCROLL_VERT); ResetUpdate(); }
void cSetEqFormelles::SolveResetUpdate(double ExpectResidu,bool *OK) { Solve(ExpectResidu,OK); ResetUpdate(1.0); }