Class LTF::RestartingMaxima
In: lib/ltf/restarting_maxima.rb
Parent: SimpleDelegator

RestartingMaxima delegates to a Maxima object. Input can be sent to Maxima only a given number of times (such as through puts or solve), after which a new Maxima process is started. This is to reduce memory usage if a very high number of independant calls are being made to Maxima.

Methods

bump   new   puts   restart   solve  

Attributes

max_sent  [R] 
num_sent  [R] 

Public Class methods

Initialize a new RestartingMaxima.

  • max_sent: The maximum number of times input can be sent to Maxima before restarting it.
  • args: The arguments to send to Maxima#initialize each time a new process is created.

Public Instance methods

Call Maxima#puts on the delegated Maxima object. Beforehand, possibly restart the Maxima process.

Call Maxima#solve on the delegated Maxima object. Beforehand, possibly restart the Maxima process.

Private Instance methods

Bump the input count and restart if necessary.

Restart the Maxima process by switching delegation to a new Maxima object.

[Validate]