예제 #1
0
void FORTE_FB_FT_PIDWL::setInitialValues(){
  KP() = 1.0;
  TN() = 1.0;
  TV() = 1.0;
  LIM_L() = -1.0E38;
  LIM_H() = 1.0E38;
}
예제 #2
0
void AddTvForm::on_saveButton_clicked()
{
    QByteArray  model,manufacturer,photourl,description;
    double screensize,price;
    int availability;
    bool can3D;
    model = ui->modelLineEdit->text().toLatin1();
    manufacturer = ui->manufacturerLineEdit->text().toLatin1();
    photourl = ui->photoUrlLineEdit->text().toLatin1();
    description = ui->descriptionLineEdit->text().toLatin1();
    screensize = ui->screenSizeLineEdit->text().toDouble();
    price = ui->priceLineEdit->text().toDouble();
    can3D = ui->show3DBox->isChecked();
    availability = ui->availabilityLineEdit->text().toInt();
    //Create a new TV and set properties
    TV t= TV();
    t.setModel(model.constData());
    t.setManufacturer(manufacturer.constData());
    t.setPhotoUrl(photourl.constData());
    t.setDescription(description.constData());
    t.setScreenSize(screensize);
    t.setPrice(price);
    t.setCanShow3d(can3D);
    //Save TV to db
    ProductDAO productDao = ProductDAO(m_db);
    productDao.insertProductInDB(t,availability);
    this->hide();
}
template<class T_GRID> void LAPLACE_COLLIDABLE_UNIFORM<T_GRID>::
Initialize_Grid(const T_GRID& mac_grid_input)
{
    assert(mac_grid_input.DX()==TV() || mac_grid_input.Is_MAC_Grid());
    BASE::Initialize_Grid(mac_grid_input);
    if(levelset == levelset_default) phi_default.Resize(grid.Domain_Indices(1));
    Set_Up_Second_Order_Cut_Cell_Method(second_order_cut_cell_method);
}
예제 #4
0
template<class TV> void SparseMatrix::
multiply_helper(RawArray<const TV> x,RawArray<TV> result) const
{
    const int rows = this->rows();
    GEODE_ASSERT(columns()<=x.size() && rows<=result.size());
    RawArray<const int> offsets = J.offsets;
    RawArray<const int> J_flat = J.flat;
    RawArray<const T> A_flat = A.flat;
    for(int i=0;i<rows;i++){
        int end=offsets[i+1];TV sum=TV();
        for(int index=offsets[i];index<end;index++) sum+=A_flat[index]*x[J_flat[index]];
        result[i]=sum;}
    result.slice(rows,result.size()).zero();
}
예제 #5
0
파일: TV.cpp 프로젝트: birm/Elemental
void TV
( const AbstractDistMatrix<Real>& b, 
        Real lambda,
        AbstractDistMatrix<Real>& x,
  const qp::affine::Ctrl<Real>& ctrl )
{
    DEBUG_ONLY(CSE cse("TV"))
    mpi::Comm comm = b.Grid().Comm();
    DistMultiVec<Real> bDMV(comm), xDMV(comm);
    bDMV = b;
    xDMV = x;
    TV( bDMV, lambda, xDMV, ctrl );
    x = xDMV;
}
예제 #6
0
파일: smp.c 프로젝트: kstraube/hysim
#include <string.h>
#include <assert.h>
#include <pmap.h>
#include <env.h>
#include <trap.h>

/* Lookup table for core_id and per_cpu_inf, indexed by real __core_id() */
int hw_coreid_lookup[MAX_NUM_CPUS] = {[0 ... (MAX_NUM_CPUS - 1)] -1};
int os_coreid_lookup[MAX_NUM_CPUS] = {[0 ... (MAX_NUM_CPUS - 1)] -1};

/*************************** IPI Wrapper Stuff ********************************/
// checklists to protect the global interrupt_handlers for 0xf0, f1, f2, f3, f4
// need to be global, since there is no function that will always exist for them
handler_wrapper_t (RO handler_wrappers)[NUM_HANDLER_WRAPPERS];

static int smp_call_function(uint8_t type, uint32_t dest, poly_isr_t handler, TV(t) data,
                             handler_wrapper_t** wait_wrapper)
{
	int8_t state = 0;
	uint32_t wrapper_num;
	handler_wrapper_t* wrapper;
	extern atomic_t outstanding_calls;

	// prevents us from ever having more than NUM_HANDLER_WRAPPERS callers in
	// the process of competing for vectors.  not decremented until both after
	// the while(1) loop and after it's been waited on.
	atomic_inc(&outstanding_calls);
	if (atomic_read(&outstanding_calls) > NUM_HANDLER_WRAPPERS) {
		atomic_dec(&outstanding_calls);
		return -EBUSY;
	}