ModelWPAMGPU::ModelWPAMGPU()
{
    variance = 100e-6f;
    dimmeas = 3;
    T = 1.0f/30.0f;

    addF();

    setUNoise();

	curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT);
	curandSetPseudoRandomGeneratorSeed(gen, 1234ULL);
}
void search()
{
    initMethodF();
    initMethodR();
    minVariance=1e10;
    while(true)
    {
        if(methodF[F-1]*methodR[R-1]>=3*methodF[0]*methodR[0])
        {
            sort();
        }
        if(not addF())
        {
            initMethodF();
            if(not addR())
            {
                break;
            }
        }
    }
}
Ejemplo n.º 3
0
BView* SeqEditMultiFilterWindow::NewPipelineView(BRect frame)
{
	BView*		v = new BView(frame, PIPELINE_STR, B_FOLLOW_ALL, 0);
	if (!v) return NULL;
	v->SetViewColor( Prefs().Color(AM_AUX_WINDOW_BG_C) );
	float			x = 5, y = 5;
	const char*		addL = "Add";
	const char*		deleteL = "Delete";
	float			buttonW = v->StringWidth(deleteL) + 30, buttonH = 24;
	/* Lay out the views.
	 */
	BRect			addF(x, 0, x + buttonW, buttonH);
	BRect			deleteF(addF.right + x, addF.top, addF.right + x + buttonW, addF.bottom);
	float			sbW = Prefs().Size(V_SCROLLBAR_X) + 3, sbH = Prefs().Size(H_SCROLLBAR_Y) + 3;
	BRect			pipelineF(x, addF.bottom + y, frame.Width() - sbW, frame.Height() - sbH);
	/* Create and add the views.
	 */
	BButton*	button = new BButton(addF, "add_btn", addL, new BMessage(ADD_PIPELINE_MSG), B_FOLLOW_LEFT | B_FOLLOW_TOP);
	if (button) v->AddChild(button);
	button = new BButton(deleteF, "del_btn", deleteL, new BMessage(DELETE_PIPELINE_MSG), B_FOLLOW_LEFT | B_FOLLOW_TOP);
	if (button) v->AddChild(button);
	mPipelineView = new SeqPipelineMatrixView(	pipelineF, "pipeline_matrix",
												AmPipelineMatrixRef(mMultiFilter),
												NULLINPUTOUTPUT_PIPELINE, SEQ_SUPPRESS_BACKGROUND);
	if (mPipelineView) {
		mPipelineView->SetResizingMode(B_FOLLOW_ALL);
		mPipelineView->SetShowProperties(true);
		mPipelineView->ForceViewColor( tint_color(Prefs().Color(AM_AUX_WINDOW_BG_C), B_DARKEN_1_TINT) );
		mPipelineScrollView = new BScrollView("pipeline_scroll", mPipelineView, B_FOLLOW_ALL, 0, true, true);	
		if (mPipelineScrollView) {
			v->AddChild(mPipelineScrollView);
			mPipelineScrollView->SetViewColor( Prefs().Color(AM_AUX_WINDOW_BG_C) );
		} else v->AddChild(mPipelineView);
	}
	return v;
}