Пример #1
0
Файл: scs.c Проект: tkelman/scs
static void setSolution(Data * d, Work * w, Sol * sol, Info * info) {
	idxint l = d->n + d->m + 1;
	setx(d, w, sol);
	sety(d, w, sol);
	sets(d, w, sol);
	if (info->statusVal == 0 || info->statusVal == SOLVED) {
		pfloat tau = w->u[l - 1];
		pfloat kap = ABS(w->v[l - 1]);
		if (tau > INDETERMINATE_TOL && tau > kap) {
			info->statusVal = solved(d, sol, info, tau);
		} else {
			if (calcNorm(w->u, l) < INDETERMINATE_TOL * SQRTF((pfloat) l)) {
				info->statusVal = indeterminate(d, sol, info);
			} else {
				pfloat bTy = innerProd(d->b, sol->y, d->m);
				pfloat cTx = innerProd(d->c, sol->x, d->n);
				if (bTy < cTx) {
					info->statusVal = infeasible(d, sol, info);
				} else {
					info->statusVal = unbounded(d, sol, info);
				}
			}
		}
	} else if (info->statusVal == INFEASIBLE) {
		info->statusVal = infeasible(d, sol, info);
	} else {
		info->statusVal = unbounded(d, sol, info);
	}
}
Пример #2
0
WMPoint::WMPoint(double X, double Y, double Z)
{
    coordinates = Matrix(4,1,false);
    setx(X);
    sety(Y);
    setz(Z);
    coordinates[3][0] = 1;
}
Пример #3
0
int citemhandler::add(citem* itm, int layer){
    if (layer>=0 && layer<EF_LAYERS)
        if (itm){
            strand(itm->label,32);
            cengine::environment[EENVIRONMENT_OVER].add( itm->context, layer, itm->label);
            setx(itm->context, citemhandler::OFFSETX+erand()%400);
            sety(itm->context, citemhandler::OFFSETY+erand()%300);
            citemhandler::itemlist[layer]->add(itm, itm->label);
            return EE_OK;
        }
    return EE_ERROR;
}
Пример #4
0
int main (int argc, char *argv[]) {
    cfilesystem loader;
    int index;
    for (index = 0; index < EMUTEX_NULL; index++)
        pthread_mutex_init(&mutexes[index], NULL);
    if ((cengine::initialize("./default.config.xml", &argc, argv)) == EE_OK) {
        if ((cengine::initialize("./default.theme.dgt")) == EE_OK) {
            cengine::gameloop(loop);
            cengine::gamequit(clean);
            loader.init();
            if (loader.initialize("./default.loader.dfs")) {
                alpha[0] = alpha[1] = 0.0f;
                if ((loading[0] = enew ctarga())) {
                    if (loading[0]->initialize(loader.get("down"))) {
                        seta(loading[0], alpha[0]);
                        setx(loading[0], 10);
                        sety(loading[0], 400);
                        if ((loading[1] = enew ctarga())) {
                            if ((loading[1]->initialize(loader.get("up")))) {
                                seta(loading[1], alpha[1]);
                                setx(loading[1], 10);
                                sety(loading[1], 400);
                                cengine::environment[EENVIRONMENT_OVER].add(loading[0], 0);
                                cengine::environment[EENVIRONMENT_OVER].add(loading[1], 1);
                                loader.unload();
                                cengine::start();
                            }
                        } else
                            ekill("out of memory");
                    }
                } else
                    ekill("out of memory");
            }
        }
    }
    return 0;
}
Пример #5
0
void Point::translation(Point& _vector)
{
  setx(getx()+_vector.getx());
  sety(gety()+_vector.gety());
}
Пример #6
0
Point::Point(int xin, int yin){
	setx(xin);
	sety(yin);
}
Пример #7
0
Point::Point(){
	setx(0);
	sety(0);
}
Пример #8
0
void SourceGroup::setCoordinates( GLfloat x, GLfloat y, GLfloat orientation )
{
    setx( x );
    sety( y );
    setOrientation( orientation );
}
Пример #9
0
void SourceGroup::setPosition( GLfloat x, GLfloat y )
{
    setx( x );
    sety( y );
}
Пример #10
0
void Boom::move()
{
	sety();
}
Пример #11
0
Entity::Entity(int x, int y, prototile image):inventory()
{
    setx(x);
    sety(y);
    setRepresentation(image);
}