Exemplo n.º 1
0
  /** Initializes Maxima. */
  public synchronized void initialize() {
    if (ggbMaxima != null) // this should never happen :)
    throw new IllegalStateException();

    MaximaConfiguration configuration = casParser.getKernel().getApplication().maximaConfiguration;

    if (configuration == null) configuration = JacomaxAutoConfigurator.guessMaximaConfiguration();

    MaximaProcessLauncher launcher = new MaximaProcessLauncher(configuration);
    ggbMaxima = launcher.launchInteractiveProcess();
    try {
      initMyMaximaFunctions();
      //			System.out.println(ggbMaxima.executeCall("1+2;"));

      int[] version = determineMaximaVersion();
      StringBuilder v = new StringBuilder("Maxima ");
      for (int i = 0; i < version.length; ++i) {
        v.append(version[i]);
        v.append('.');
      }
      Application.setCASVersionString(v.toString());

      // There are problems with Maxima versions < 5.22. See ticket #295
      if (version[0] < 5 || (version[0] == 5 && version[1] < 22))
        throw new MaximaVersionUnsupportedExecption(version);

    } catch (MaximaTimeoutException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
Exemplo n.º 2
0
 public CASmaxima(CASparser casParser) {
   super(casParser);
   Application.setCASVersionString("Maxima"); // called later on with eg "Maxima 5.22.1"
 }