|
algebramix_doc 0.3
|
#include <series_carry_naive.hpp>
Definition at line 696 of file series_carry_naive.hpp.
| system_root_series_rep | ( | const vector< generic > & | out2, |
| const vector< generic > & | vars2, | ||
| const vector< M, W > & | y02 | ||
| ) | [inline] |
Definition at line 825 of file series_carry_naive.hpp.
| vector< series<M,V> > _eps | ( | const generic & | f, |
| const vector< generic > & | x, | ||
| const series< vector< M, W >, V > & | y | ||
| ) | [inline] |
Definition at line 764 of file series_carry_naive.hpp.
References mmx::as_vector(), M, mmx::N(), mmx::rec_add(), mmx::rec_cst(), mmx::rec_lin(), mmx::rec_minus(), mmx::rec_prod(), mmx::rec_square(), and Series.
{
nat n = N(x);
if (is<Series> (f))
return rec_cst (as<Series> (f), n);
if (is<literal> (f)) {
for (nat i = 0; i < n; i++)
if (f == x[i]) {
vector<Series> tmp (Series (M(0) /*FIXME*/), n);
tmp [i] = Series (M(1));
return rec_lin (Series (y0[i]), tmp);
}
}
if (is<compound> (f)) {
if (N(f) == 2) {
if (f[0] == GEN_MINUS)
return rec_minus (_eps (f[1], x, y));
if (f[0] == GEN_SQUARE)
return rec_square (_eps (f[1], x, y), as_vector (y));
}
if (N(f) == 3) {
if (f[0] == GEN_MINUS)
return rec_minus (_eps (f[1], x, y), _eps (f[2], x, y));
if (f[0] == GEN_PLUS)
return rec_add (_eps (f[1], x, y), _eps (f[2], x, y));
if (f[0] == GEN_TIMES)
return rec_prod (_eps (f[1], x, y), _eps (f[2], x, y),
as_vector (y));
}
}
ERROR ("bug, unexpected type with generic"); }
| static series< vector<M,W> , V> _ev_der | ( | const vector< generic > & | f, |
| const vector< series< M, V > > & | a, | ||
| const vector< generic > & | x, | ||
| matrix< series< M, V >, matrix_naive > & | m | ||
| ) | [inline, static] |
Definition at line 750 of file series_carry_naive.hpp.
References mmx::as_series(), mmx::CF(), mmx::N(), and Series.
| static series<M,V> _ev_der | ( | const generic & | f, |
| const vector< series< M, V > > & | a, | ||
| const vector< generic > & | x, | ||
| vector< series< M, V > > & | grad | ||
| ) | [inline, static] |
Definition at line 703 of file series_carry_naive.hpp.
References mmx::CF(), mmx::coefficients(), default_p_expansion, M, mmx::N(), Series, and mmx::square().
{
grad = vector<Series> (Series (get_format1 (CF(a))), N(a));
if (is<literal> (f))
for (nat i = 0; i < N(a); i++)
if (f == x[i]) {
grad[i]= Series (M(1));
return a[i];
}
if (is<Series> (f))
return as<Series> (f);
if (is<compound> (f)) {
Series o;
if (N(f) == 2) {
if (f[0] == GEN_MINUS) {
o = -_ev_der (f[1], a, x, grad);
grad = -grad;
return o;
}
if (f[0] == GEN_SQUARE) {
o = _ev_der (f[1], a, x, grad);
Series ser_2 (coefficients (as<default_p_expansion(M)> (2)));
grad = ser_2 * o * grad;
return square (o);
}
}
if (N(f) == 3) {
vector<Series> grad2;
if (f[0] == GEN_MINUS) {
o = _ev_der (f[1], a, x, grad) - _ev_der (f[2], a, x, grad2);
grad = grad - grad2;
return o;
}
if (f[0] == GEN_PLUS) {
o = _ev_der (f[1], a, x, grad) + _ev_der (f[2], a, x, grad2);
grad = grad + grad2;
return o;
}
if (f[0] == GEN_TIMES) {
o = _ev_der (f[1], a, x, grad);
Series o2 = _ev_der (f[2], a, x, grad2);
grad = o*grad2 + grad*o2;
return o*o2;
} } }
ERROR ("bug, unexpected type with generic"); }
| syntactic expression | ( | const syntactic & | z | ) | const [inline] |
Definition at line 829 of file series_carry_naive.hpp.
{
return z; }
| virtual void Increase_order | ( | nat | l | ) | [inline, virtual] |
Reimplemented from recursive_series_rep< vector< M, W >, V >.
Definition at line 832 of file series_carry_naive.hpp.
References recursive_series_rep< C, V >::Increase_order().
| static void increase_order_generic | ( | generic | f, |
| nat | l | ||
| ) | [inline, static] |
Definition at line 804 of file series_carry_naive.hpp.
References mmx::increase_order(), and mmx::N().
{
if (is<Series> (f))
increase_order (as<Series> (f), l);
if (is<compound> (f)) {
if (N(f) == 2)
increase_order_generic (f[1], l);
if (N(f) == 3) {
increase_order_generic (f[1], l);
increase_order_generic (f[2], l);
}
}
}
| static void increase_order_generic | ( | vector< generic > | f, |
| nat | l | ||
| ) | [inline, static] |
Definition at line 818 of file series_carry_naive.hpp.
References mmx::N().
{
for (nat i = 0; i < N(f); i++)
increase_order_generic (f[i], l);
}
| vector< M, W > & initial | ( | nat | n2 | ) | [inline, inherited] |
Definition at line 131 of file series.hpp.
{
if (n2>=this->n) { this->n = n2+1; Set_order (this->n); }
return this->a[n2]; }
Implements recursive_series_rep< vector< M, W >, V >.
Definition at line 835 of file series_carry_naive.hpp.
References mmx::as_series(), mmx::as_vector(), mmx::N(), mmx::ser_ldiv_mat(), and Series_vector.
{
//double start = mmx_time ();
//double inter;
nat n= N(out);
ASSERT (N(vars) == n, "numbers of equations and variables don't match");
this->initial (0) = y0;
matrix<Series, matrix_naive> jac;
vector<Series> num = as_vector (_ev_der (out, as<vector<Series> > (y0),
vars, jac));
//mmout << "init: " << (int) (mmx_time() - start) << " + ";
//inter = mmx_time ();
vector<Series> eps = _eps (out, vars, this->me());
//mmout << (int) (mmx_time () - inter) << " + ";
//inter = mmx_time ();
Series_vector res = as_series (ser_ldiv_mat (jac, (jac * \
as<vector<Series> > (y0) - num - eps)));
//mmout << (int) (mmx_time () - inter) << " = ";
//mmout << (int) (mmx_time () - start) << " ms" << lf;
return res;
}
| vector< M, W > next | ( | ) | [inline, inherited] |
Definition at line 137 of file series.hpp.
{ return eq[this->n]; }
| vector<generic> out |
Definition at line 699 of file series_carry_naive.hpp.
| vector<generic> vars |
Definition at line 699 of file series_carry_naive.hpp.
Definition at line 700 of file series_carry_naive.hpp.