> <\body> Power series are implemented within the class |mmx::series> from |algebramix/series.hpp>. <\cpp-code> #include \numerix/rational.hpp\ #include \algebramix/series.hpp\ \; series\rational\ z (rational (1), 1); // variable z series\rational\ f = 1 / (1 - z); mmout \\ f[10] \\ "\\n"; Series are implemented in a lazy way, which means that the precision has not to be specified in advance. Computations are actually done when a coefficient is actually needed. The precision used for printing the power series can be set to in the following way: <\cpp-code> series\C,V\::set_output_order (n); Instead of printing an approximation of the series, it is possible to display the formula it has been built from, as follows: <\cpp-code> series\C,V\::set_formula_output (true); Withing equality test the precision to be taken into account can be set to via: <\cpp-code> series\C,V\::set_cancel_order (n); The name of the variable to be printed can be set to with the following command: <\cpp-code> series\C,V\::set_variable_name ("z"); Naive algorithms for power series are implemented in |algebramix/series_naive.hpp>. For instance the product implemented therein has a quadratic cost. Over numerical types, elementary functions are available from |algebramix/series_elementary.hpp>. The relaxed product for power series is implemented in |algebramix/series_relaxed.hpp>. <\cpp-code> #include \numerix/rational.hpp\ #include \algebramix/series.hpp\ #include \algebramix/series_relaxed.hpp\ \; #define V series_relaxed\series_naive\ series\rational,V\ z (rational (1), 1); // variable z series\rational,V\ f = 1 / (1 - z); mmout \\ z[10] \\ "\\n"; The relaxed product has a softly linear cost. A series is said to be recursive if it satisfies an equation > that allows to compute the -th coefficient of as the -th coefficient of > with the only knownledge of the first coefficients of , whenever is larger than an integer called the . For example =f+z*f>+1, with =1> can be implemented as follows: <\cpp-code> template\typename C, typename V\ struct example_series_rep : recursive_series_rep\C,V\ \ \ example_series_rep () {} \ \ syntactic expression (const syntactic& z) const { \ \ \ \ return apply ("example", z); } \ \ series\C,V\ initialize () { \ \ \ \ series\C,V\ f= this-\me (); \ \ \ \ this-\initial (0)= C(1); \ \ \ \ return square (f) + lshiftz (f, 1) + C(1); } \; template\typename C, typename V\ example_series () { \ \ series_rep\C,V\* rep= new example_series_rep\C,V\ (); \ \ return recursive (series\C,V\ (rep)); } Implicit series are implemented in |algebramix/series_implicit.hpp>. Vectorial and matricial auxilary functions are available from |algebramix/series_vector.hpp> and |algebramix/series_matrix.hpp> respectively. They are useful for computing recursive vectors of series. interface> <\session|mathemagix|default> <\input> <|input> use "algebramix"; type_mode? := true; <\unfolded-io> <|unfolded-io> z == series (0 :\ Rational, 1 :\ Rational) <|unfolded-io> |)>>: > <\unfolded-io> <|unfolded-io> f == log (1 - z) <|unfolded-io> *z-*z-*z-*z-*z-*z-*z-*z+O|)>>: > <\unfolded-io> <|unfolded-io> f[20] <|unfolded-io> >: . If you don't have this file, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.> <\initial> <\collection>