Top |
NcmBinSplitNcmBinSplit — Binnary splitting algorithms used to evaluate sums fast and with arbitrary precision. |
void | (*NcmBinSplitEval) () |
NcmBinSplit * | ncm_binsplit_alloc () |
glong | ncm_binsplit_test_next () |
void | ncm_binsplit_join () |
void | ncm_binsplit_eval_join () |
gulong | ncm_binsplit_eval_prec () |
void | ncm_binsplit_get () |
void | ncm_binsplit_get_q () |
gdouble | ncm_binsplit_get_d () |
#define | NCM_BINSPLIT_DECL() |
#define | NCM_BINSPLIT_DENC_NULL() |
This object implements a binary splitting algorithm to evaluate sums with arbitrary precision.
NcmBinSplit *
ncm_binsplit_alloc (gpointer userdata
);
Allocates a new NcmBinSplit.
[skip]
glong ncm_binsplit_test_next (NcmBinSplit *bs
,NcmBinSplitEval bs_eval
,gulong nt
);
Computes the number of bits of precision that would be gained by adding
nt
terms to the sum.
[skip]
void ncm_binsplit_join (NcmBinSplit *bs
,NcmBinSplit *bs_l
,NcmBinSplit *bs_r
);
Joins two NcmBinSplit objects, it is assumed that bs_l
and bs_r
are
consecutive in the sum.
void ncm_binsplit_eval_join (NcmBinSplit *bs
,NcmBinSplitEval bs_eval
,gulong nt
);
Evaluates the sum of nt
terms and joins the result to the sum stored in
bs
.
[skip]
gulong ncm_binsplit_eval_prec (NcmBinSplit *bs
,NcmBinSplitEval bs_eval
,gulong step
,glong prec
);
Evaluates the sum until the number of bits of precision is greater or
equal to prec
.
[skip]
void ncm_binsplit_get (NcmBinSplit *bs
,mpfr_t res
);
Computes the value of the sum stored in bs
and stores the result in res
in the form of a mpfr_t.
[skip]
void ncm_binsplit_get_q (NcmBinSplit *bs
,mpq_t q
);
Computes the value of the sum stored in bs
and stores the result in q
.
The result is stored in the form of a mpq_t.
[skip]
gdouble ncm_binsplit_get_d (NcmBinSplit *bs
,mp_rnd_t rnd
);
Computes the value of the sum stored in bs
and stores the result in res
in the form of a double.
[skip]
#define NCM_BINSPLIT_DECL(name, v, u, n, data) static inline void name (mpz_t v, mpz_t u, gulong n, gpointer data)