示例#1
0
文件: fempair.cpp 项目: NII-APP/NPO
FEMPair::FEMPair(const FEM *b, const FEM *a, bool align, bool scale)
    : first(new FEM(*b))
    , second(new FEM(*a))
    , trunc(nullptr)
{
#ifndef QT_NO_DEBUG
    qDebug() << "construct pair" << a << b;
    QTime begin(QTime::currentTime());
#endif
    if (align) {
        first->alignZero();
        second->alignZero();
    }
    if (scale) {
        second->scaleTo(first->box().size());
    }
    trunc = FEM::truncation(*theory(), *practic());
    //estimate macMatrix
    makeMac(practic()->getModes(), trunc->getModes());

    calculateRelations();
#ifndef QT_NO_DEBUG
    qDebug() << "construct pair delay" << begin.msecsTo(QTime::currentTime()) << "ms";
#endif
}
示例#2
0
void SplitDefinitions::prepare() {
	savedOptions = BootstrappingUtils::setBootstrappingOptions();

	if (not getGlobal()->instance()->alreadyParsed("definitions")) {
		parsefile("definitions");
	}

	auto defnamespace = getGlobal()->getGlobalNamespace()->subspace("stdspace")->subspace("definitionbootstrapping");
	Assert(defnamespace != NULL);

	auto splitVoc = defnamespace->vocabulary("def_split_voc");
	Assert(splitVoc != NULL);
	sameDef = splitVoc->pred("samedef/2");
	Assert(sameDef != NULL);

	auto deptheo = defnamespace->theory("dependency");
	Assert(deptheo != NULL);
	splittheo = defnamespace->theory("def_split_theory");
	Assert(splittheo != NULL);
	splittheo = FormulaUtils::merge(splittheo, deptheo);
	Assert(splittheo != NULL);
}
示例#3
0
void sim(int argc, char *argv[])
{
	set_model_name("M/M/1 Queue");
	create("sim");
	cnt = NARS;
	for(int i = 1; i <= NARS; i++) {
		hold(expntl(IAR_TM));	// interarrival interval
		customer();		// generate next customer
		}
	done.wait();			// wait for last customer to depart
	report();			// model report
	theory();
	mdlstat();			// model statistics
}
示例#4
0
AbstractTheory* InternalArgument::get<AbstractTheory*>() {
	return theory();
}
示例#5
0
int main(){
	context ctx;
	theory temp = theory(ctx);
	return 0;
}