use of org.matheclipse.core.visit.AbstractVisitor in project symja_android_library by axkr.
the class SerializableTest method testIntegrateDefinition.
public void testIntegrateDefinition() {
RulesData rulesData = F.Integrate.getRulesData();
AbstractVisitor visitor = Share.createVisitor();
rulesData.accept(visitor);
equalsStringCopy(rulesData);
}
use of org.matheclipse.core.visit.AbstractVisitor in project symja_android_library by axkr.
the class SerializableTest method testSinDefinition.
public void testSinDefinition() {
// try to share common sub-IASTs first:
RulesData rulesData = F.Sin.getRulesData();
AbstractVisitor visitor = Share.createVisitor();
rulesData.accept(visitor);
equalsCopy(rulesData);
}
use of org.matheclipse.core.visit.AbstractVisitor in project symja_android_library by axkr.
the class KryoUtil method main.
public static void main(String[] args) throws Exception {
// List<Class<?>> asList = Arrays.asList(B3.class.getDeclaredClasses());
// for (int i = 0; i < asList.size(); i++) {
// System.out.println(
// "kryo.register(B3." + asList.get(i).getSimpleName() + ".class);");
// }
// List<Class<?>> asList = Arrays.asList(UtilityFunctionCtors.class.getDeclaredClasses());
// for (int i = 0; i < asList.size(); i++) {
// System.out.println("kryo.register(Class.forName(\"" + asList.get(i).toString().substring(6)
// + "\"), new IASTSerializer());");
// }
F.initSymbols();
Kryo kryo = initKryo();
// IBuiltInSymbol object = S.Im;
// IAST object = F.Sin(F.x);
// IAST object =F.ternaryAST3(F.f, F.x, F.Dummy("$dummy"), F.stringx("string"));
Integrate.CONST.await();
Context rubiContext = Context.RUBI;
Output rubiOutput = new Output(new FileOutputStream("rubi_context.bin"));
kryo.writeClassAndObject(rubiOutput, rubiContext);
rubiOutput.close();
Input rubInput = new Input(new FileInputStream("rubi_context.bin"));
rubiContext = (Context) kryo.readClassAndObject(rubInput);
System.out.println(rubiContext.toString());
rubInput.close();
IBuiltInSymbol symbol = S.Integrate;
RulesData rulesData = symbol.getRulesData();
AbstractVisitor visitor = Share.createVisitor();
rulesData.accept(visitor);
Output output = new Output(new FileOutputStream("integrate.bin"));
kryo.writeClassAndObject(output, rulesData);
output.close();
Input input = new Input(new FileInputStream("integrate.bin"));
RulesData object2 = (RulesData) kryo.readClassAndObject(input);
System.out.println(object2.definition());
input.close();
}
use of org.matheclipse.core.visit.AbstractVisitor in project symja_android_library by axkr.
the class SerializableTest method testSinDefinition.
public void testSinDefinition() {
// try to share common sub-IASTs first:
RulesData rulesData = F.Sin.getRulesData();
AbstractVisitor visitor = Share.createVisitor();
rulesData.accept(visitor);
equalsCopy(rulesData);
}
use of org.matheclipse.core.visit.AbstractVisitor in project symja_android_library by axkr.
the class SerializableTest method testIntegrateDefinition.
public void testIntegrateDefinition() {
// do a dummy evaluation to load integration rules
F.Integrate.of(F.x, F.x);
RulesData rulesData = F.Integrate.getRulesData();
AbstractVisitor visitor = Share.createVisitor();
rulesData.accept(visitor);
equalsStringCopy(rulesData);
}
Aggregations