FV3_(efilter)::FV3_(efilter)() { lpfCof = 0.0f; hpfCof = 0.0f; updateP(&lpfL, lpfCof); updateP(&lpfR, lpfCof); updateZ(&hpfL, hpfCof); updateZ(&hpfR, hpfCof); }
double uhfsolve::solve(){ //carefully following the steps laid out on pages 74-77 in Thijssen setupUnitMatrices(); setupP(); iterations = 0; setupF(); //printMatrices(); while(convergenceCriteria()){ epsilon_prev = epsilon; energyPrev = energyCalc(); setupF(); diagonalizeF(); normalizeC(); updateP(); iterations += 1; //cout << energy() << endl; } //cout << "Converged in " << iterations << " iterations." << endl; //printMatrices(); //createDensityMap(); //return iterations; //C = Cu + Cd; return energyCalc(); }
Debugger::Debugger(QWidget *parent) : QMainWindow( parent ) , ui(new Ui::Debugger) , m_pItemAtPc( 0 ) , m_autoStepping( false ) { ui->setupUi(this); connect( ui->tableWidgetCode, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(setBreakpoint(int, int)) ); connect( ui->actionStep_Into, SIGNAL(triggered()), this, SIGNAL(stepInto()) ); connect( ui->actionStep_Over, SIGNAL(triggered()), this, SIGNAL(stepOver()) ); connect( ui->actionStep_Skip, SIGNAL(triggered()), this, SIGNAL(stepSkip()) ); connect( ui->actionContinue, SIGNAL(triggered()), this, SLOT(setupExecution()) ); connect( ui->radioButtonP, SIGNAL(clicked()), this, SLOT(updateP()) ); connect( ui->radioButtonX, SIGNAL(clicked()), this, SLOT(updateX()) ); connect( ui->radioButtonY, SIGNAL(clicked()), this, SLOT(updateY()) ); connect( ui->radioButtonL, SIGNAL(clicked()), this, SLOT(updateL()) ); connect( ui->lineEditX0, SIGNAL(editingFinished()), this, SLOT(setRegisterX0()) ); connect( ui->lineEditX1, SIGNAL(editingFinished()), this, SLOT(setRegisterX1()) ); connect( ui->lineEditY0, SIGNAL(editingFinished()), this, SLOT(setRegisterY0()) ); connect( ui->lineEditY1, SIGNAL(editingFinished()), this, SLOT(setRegisterY1()) ); connect( ui->lineEditA0, SIGNAL(editingFinished()), this, SLOT(setRegisterA0()) ); connect( ui->lineEditA1, SIGNAL(editingFinished()), this, SLOT(setRegisterA1()) ); connect( ui->lineEditA2, SIGNAL(editingFinished()), this, SLOT(setRegisterA2()) ); connect( ui->lineEditB0, SIGNAL(editingFinished()), this, SLOT(setRegisterB0()) ); connect( ui->lineEditB1, SIGNAL(editingFinished()), this, SLOT(setRegisterB1()) ); connect( ui->lineEditB2, SIGNAL(editingFinished()), this, SLOT(setRegisterB2()) ); connect( ui->lineEditR0, SIGNAL(editingFinished()), this, SLOT(setRegisterR0()) ); connect( ui->lineEditR1, SIGNAL(editingFinished()), this, SLOT(setRegisterR1()) ); connect( ui->lineEditR2, SIGNAL(editingFinished()), this, SLOT(setRegisterR2()) ); connect( ui->lineEditR3, SIGNAL(editingFinished()), this, SLOT(setRegisterR3()) ); connect( ui->lineEditR4, SIGNAL(editingFinished()), this, SLOT(setRegisterR4()) ); connect( ui->lineEditR5, SIGNAL(editingFinished()), this, SLOT(setRegisterR5()) ); connect( ui->lineEditR6, SIGNAL(editingFinished()), this, SLOT(setRegisterR6()) ); connect( ui->lineEditR7, SIGNAL(editingFinished()), this, SLOT(setRegisterR7()) ); connect( ui->lineEditN0, SIGNAL(editingFinished()), this, SLOT(setRegisterN0()) ); connect( ui->lineEditN1, SIGNAL(editingFinished()), this, SLOT(setRegisterN1()) ); connect( ui->lineEditN2, SIGNAL(editingFinished()), this, SLOT(setRegisterN2()) ); connect( ui->lineEditN3, SIGNAL(editingFinished()), this, SLOT(setRegisterN3()) ); connect( ui->lineEditN4, SIGNAL(editingFinished()), this, SLOT(setRegisterN4()) ); connect( ui->lineEditN5, SIGNAL(editingFinished()), this, SLOT(setRegisterN5()) ); connect( ui->lineEditN6, SIGNAL(editingFinished()), this, SLOT(setRegisterN6()) ); connect( ui->lineEditN7, SIGNAL(editingFinished()), this, SLOT(setRegisterN7()) ); connect( ui->lineEditM0, SIGNAL(editingFinished()), this, SLOT(setRegisterM0()) ); connect( ui->lineEditM1, SIGNAL(editingFinished()), this, SLOT(setRegisterM1()) ); connect( ui->lineEditM2, SIGNAL(editingFinished()), this, SLOT(setRegisterM2()) ); connect( ui->lineEditM3, SIGNAL(editingFinished()), this, SLOT(setRegisterM3()) ); connect( ui->lineEditM4, SIGNAL(editingFinished()), this, SLOT(setRegisterM4()) ); connect( ui->lineEditM5, SIGNAL(editingFinished()), this, SLOT(setRegisterM5()) ); connect( ui->lineEditM6, SIGNAL(editingFinished()), this, SLOT(setRegisterM6()) ); connect( ui->lineEditM7, SIGNAL(editingFinished()), this, SLOT(setRegisterM7()) ); connect( ui->lineEditSR, SIGNAL(editingFinished()), this, SLOT(setRegisterSR()) ); connect( ui->lineEditPC, SIGNAL(editingFinished()), this, SLOT(setRegisterPC()) ); connect( ui->lineEditLC, SIGNAL(editingFinished()), this, SLOT(setRegisterLC()) ); }
void CRSAFactorHintDlg::OnChangeEditb() { UpdateData(); if(m_choice==1){ updateP(); } updateDim(); }
void CRSAFactorHintDlg::OnRadiolsb() { UpdateData(); if(m_choice==1) updateP(); GetDlgItem(IDC_EDITGUESSP_LEFT)->ShowWindow(m_msbLsb==0); GetDlgItem(IDC_EDITGUESSP_RIGHT)->ShowWindow(m_msbLsb==1); GetDlgItem(IDC_EDITP_LEFT)->ShowWindow(m_msbLsb==0); GetDlgItem(IDC_EDITP_RIGHT)->ShowWindow(m_msbLsb==1); ((CEdit*)GetDlgItem(IDC_EDITP_RIGHT))->SetSel(0,-1); ((CEdit*)GetDlgItem(IDC_EDITGUESSP_RIGHT))->SetSel(0,-1); updateDim(); }
void op_x86_updateP( double *arg0, double *arg1, const double *arg2, int start, int finish ) { // process set elements for (int n=start; n<finish; n++) { // user-supplied kernel call updateP( arg0+n*1, arg1+n*1, arg2 ); } }
/////////////////////////////////////////// // Create a random example /////////////////////////////////////////// void CRSAFactorHintDlg::OnRandom() { UpdateData(); int m_bitsOfP=GetDlgItemInt(IDC_EDITBITSOFP); if (m_bitsOfN<=10){ CString tmp, myTitle; tmp.LoadString(IDS_RSA_FH_WRONGN); this->GetWindowText(myTitle); MessageBox(tmp,myTitle); } else if(m_bitsOfP<=5 || m_bitsOfP>=m_bitsOfN){ CString tmp, myTitle; tmp.LoadString(IDS_RSA_FH_WRONGP); this->GetWindowText(myTitle); MessageBox(tmp,myTitle); } else{ BeginWaitCursor(); int bitsOfQ=(m_bitsOfN-m_bitsOfP); SetSeed(to_ZZ(GetTime()*10000)); m_p = GenPrime_ZZ(m_bitsOfP); // generate N, p and q ZZ q = GenPrime_ZZ(bitsOfQ); m_N=m_p*q; int newbase=2; // check which representation to use if(m_base==0) newbase=10; if(m_base==1) newbase=16; // m_N=toString(N,newbase,newbase*newbase*2); // m_P=toString(m_p,newbase,newbase*newbase*2); UpdateData(false); updateP(); updateDim(); EndWaitCursor(); } }
void Debugger::updateData( const dsp_core_t* pCore ) { int regs = sizeof( pCore->registers ) / sizeof( pCore->registers[0] ); for( int i = 0; i < regs; ++i ) { QString str = QString::number( pCore->registers[i], 16 ); int justify; if( i == DSP_REG_X0 || i == DSP_REG_X1 || i == DSP_REG_Y0 || i == DSP_REG_Y1 || i == DSP_REG_A0 || i == DSP_REG_B0 || i == DSP_REG_A1 || i == DSP_REG_B1 ) { justify = 6; } else if( i == DSP_REG_A2 || i == DSP_REG_B2 ) { justify = 2; } else { justify = 4; } str = str.rightJustified( justify, '0' ).toUpper(); switch( i ) { case DSP_REG_X0: ui->lineEditX0->setText( str ); break; case DSP_REG_X1: ui->lineEditX1->setText( str ); break; case DSP_REG_Y0: ui->lineEditY0->setText( str ); break; case DSP_REG_Y1: ui->lineEditY1->setText( str ); break; case DSP_REG_A0: ui->lineEditA0->setText( str ); break; case DSP_REG_B0: ui->lineEditB0->setText( str ); break; case DSP_REG_A2: ui->lineEditA2->setText( str ); break; case DSP_REG_B2: ui->lineEditB2->setText( str ); break; case DSP_REG_A1: ui->lineEditA1->setText( str ); break; case DSP_REG_B1: ui->lineEditB1->setText( str ); break; case DSP_REG_R0: ui->lineEditR0->setText( str ); break; case DSP_REG_R1: ui->lineEditR1->setText( str ); break; case DSP_REG_R2: ui->lineEditR2->setText( str ); break; case DSP_REG_R3: ui->lineEditR3->setText( str ); break; case DSP_REG_R4: ui->lineEditR4->setText( str ); break; case DSP_REG_R5: ui->lineEditR5->setText( str ); break; case DSP_REG_R6: ui->lineEditR6->setText( str ); break; case DSP_REG_R7: ui->lineEditR7->setText( str ); break; case DSP_REG_N0: ui->lineEditN0->setText( str ); break; case DSP_REG_N1: ui->lineEditN1->setText( str ); break; case DSP_REG_N2: ui->lineEditN2->setText( str ); break; case DSP_REG_N3: ui->lineEditN3->setText( str ); break; case DSP_REG_N4: ui->lineEditN4->setText( str ); break; case DSP_REG_N5: ui->lineEditN5->setText( str ); break; case DSP_REG_N6: ui->lineEditN6->setText( str ); break; case DSP_REG_N7: ui->lineEditN7->setText( str ); break; case DSP_REG_M0: ui->lineEditM0->setText( str ); break; case DSP_REG_M1: ui->lineEditM1->setText( str ); break; case DSP_REG_M2: ui->lineEditM2->setText( str ); break; case DSP_REG_M3: ui->lineEditM3->setText( str ); break; case DSP_REG_M4: ui->lineEditM4->setText( str ); break; case DSP_REG_M5: ui->lineEditM5->setText( str ); break; case DSP_REG_M6: ui->lineEditM6->setText( str ); break; case DSP_REG_M7: ui->lineEditM7->setText( str ); break; case DSP_REG_SR: ui->lineEditSR->setText( str ); break; case DSP_REG_LC: ui->lineEditLC->setText( str ); break; } } QString str = QString::number( pCore->pc, 16 ); str = str.rightJustified( 4, '0' ).toUpper(); ui->lineEditPC->setText( str ); scrollToPc(); if( ui->radioButtonP->isChecked() ) { updateP(); } else if( ui->radioButtonX->isChecked() ) { updateX(); } else if( ui->radioButtonY->isChecked() ) { updateY(); } else if( ui->radioButtonL->isChecked() ) { updateL(); } // if waiting for another breakpoint if( m_autoStepping ) { if( !m_breakpoints.contains( m_pCurrentDspCore->pc ) ) { emit stepInto(); } else { m_autoStepping = false; } } }
void FV3_(efilter)::setLPF(fv3_float_t val) { lpfCof = val; updateP(&lpfL, lpfCof); updateP(&lpfR, lpfCof); }