/usr/include/arb_calc.h is in libflint-arb-dev 2.8.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | /*=============================================================================
This file is part of ARB.
ARB is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
ARB is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ARB; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
=============================================================================*/
/******************************************************************************
Copyright (C) 2013 Fredrik Johansson
******************************************************************************/
#ifndef ARB_CALC_H
#define ARB_CALC_H
#include "arb.h"
#include "arb_poly.h"
#include "arb_mat.h"
#ifdef __cplusplus
extern "C" {
#endif
extern TLS_PREFIX int arb_calc_verbose;
typedef int (*arb_calc_func_t)(arb_ptr out,
const arb_t inp, void * param, slong order, slong prec);
#define ARB_CALC_SUCCESS 0
#define ARB_CALC_IMPRECISE_INPUT 1
#define ARB_CALC_NO_CONVERGENCE 2
/* Root-finding */
typedef struct
{
arf_struct a;
arf_struct b;
}
arf_interval_struct;
typedef arf_interval_struct arf_interval_t[1];
typedef arf_interval_struct * arf_interval_ptr;
typedef const arf_interval_struct * arf_interval_srcptr;
static __inline__ void
arf_interval_init(arf_interval_t v)
{
arf_init(&v->a);
arf_init(&v->b);
}
static __inline__ void
arf_interval_clear(arf_interval_t v)
{
arf_clear(&v->a);
arf_clear(&v->b);
}
static __inline__ arf_interval_ptr
_arf_interval_vec_init(slong n)
{
slong i;
arf_interval_ptr v = (arf_interval_ptr) flint_malloc(sizeof(arf_interval_struct) * n);
for (i = 0; i < n; i++)
arf_interval_init(v + i);
return v;
}
static __inline__ void
_arf_interval_vec_clear(arf_interval_ptr v, slong n)
{
slong i;
for (i = 0; i < n; i++)
arf_interval_clear(v + i);
flint_free(v);
}
static __inline__ void
arf_interval_set(arf_interval_t v, const arf_interval_t u)
{
arf_set(&v->a, &u->a);
arf_set(&v->b, &u->b);
}
static __inline__ void
arf_interval_swap(arf_interval_t v, arf_interval_t u)
{
arf_swap(&v->a, &u->a);
arf_swap(&v->b, &u->b);
}
static __inline__ void
arf_interval_get_arb(arb_t x, const arf_interval_t v, slong prec)
{
arb_set_interval_arf(x, &v->a, &v->b, prec);
}
static __inline__ void
arf_interval_printd(const arf_interval_t v, slong n)
{
flint_printf("[");
arf_printd(&v->a, n);
flint_printf(", ");
arf_printd(&v->b, n);
flint_printf("]");
}
/* bisection */
int arb_calc_partition(arf_interval_t L, arf_interval_t R,
arb_calc_func_t func, void * param, const arf_interval_t block, slong prec);
slong arb_calc_isolate_roots(arf_interval_ptr * blocks, int ** flags,
arb_calc_func_t func, void * param,
const arf_interval_t block, slong maxdepth, slong maxeval, slong maxfound,
slong prec);
int arb_calc_refine_root_bisect(arf_interval_t r, arb_calc_func_t func,
void * param, const arf_interval_t start, slong iter, slong prec);
/* newton iteration */
void arb_calc_newton_conv_factor(arf_t conv_factor,
arb_calc_func_t func, void * param, const arb_t conv_region, slong prec);
int arb_calc_newton_step(arb_t xnew, arb_calc_func_t func, void * param,
const arb_t x, const arb_t conv_region, const arf_t conv_factor, slong prec);
int arb_calc_refine_root_newton(arb_t r, arb_calc_func_t func,
void * param, const arb_t start, const arb_t conv_region,
const arf_t conv_factor, slong eval_extra_prec, slong prec);
#ifdef __cplusplus
}
#endif
#endif
|