#ifndef MPVEC_H
#define MPVEC_H

#include <gmp.h>
#include <mpfr.h>
#include <mpc.h>
#include "params.h"
#include "poly.h"
#include "polz.h"

typedef mpc_t mpcvec[N/2];
typedef mpfr_t mpfrvec[N/2];

void mpcvec_init(mpc_t v[N/2]);
void mpcvec_clear(mpc_t v[N/2]);
void mpcvec_frompoly(mpc_t v[N/2], const poly *a);
void mpcvec_frompolz(mpc_t v[N/2], const polz *a);
void mpcvec_topolz(polz *r, const mpc_t v[N/2]);
void mpcvec_set(mpc_t u[N/2], const mpc_t v[N/2]);
void mpcvec_set_ui(mpc_t u[N/2], unsigned long a);
void mpcvec_set_si(mpc_t u[N/2], long a);
void mpcvec_set_fr(mpc_t u[N/2], const mpfr_t a);
void mpcvec_abssq(mpfr_t u[N/2], const mpc_t v[N/2]);
void mpcvec_conj(mpc_t u[N/2], const mpc_t v[N/2]);
void mpcvec_add(mpc_t w[N/2], const mpc_t u[N/2],  const mpc_t v[N/2]);
void mpcvec_add_ui(mpc_t u[N/2], const mpc_t v[N/2], unsigned long a);
void mpcvec_add_fr(mpc_t u[N/2], const mpc_t v[N/2],  const mpfr_t a);
void mpcvec_sub(mpc_t w[N/2], const mpc_t u[N/2],  const mpc_t v[N/2]);
void mpcvec_sub_ui(mpc_t u[N/2], const mpc_t v[N/2], unsigned long a);
void mpcvec_sub_fr(mpc_t u[N/2], const mpc_t v[N/2],  const mpfr_t a);
void mpcvec_mul(mpc_t w[N/2], const mpc_t u[N/2],  const mpc_t v[N/2]);
void mpcvec_mul_ui(mpc_t u[N/2], const mpc_t v[N/2], unsigned long a);
void mpcvec_mul_si(mpc_t u[N/2], const mpc_t v[N/2], long a);
void mpcvec_mul_fr(mpc_t u[N/2], const mpc_t v[N/2],  const mpfr_t a);
void mpcvec_mul_frvec(mpc_t w[N/2], const mpc_t u[N/2],  const mpfr_t v[N/2]);
void mpcvec_fma(mpc_t w[N/2],
                const mpc_t t[N/2],
                const mpc_t u[N/2],
                const mpc_t v[N/2]);
void mpcvec_div(mpc_t w[N/2], const mpc_t u[N/2],  const mpc_t v[N/2]);
void mpcvec_div_ui(mpc_t u[N/2], const mpc_t v[N/2], unsigned long a);
void mpcvec_div_fr(mpc_t u[N/2], const mpc_t v[N/2],  const mpfr_t a);
void mpcvec_div_frvec(mpc_t w[N/2], const mpc_t u[N/2],  const mpfr_t v[N/2]);

void mpfrvec_init(mpfr_t v[N/2]);
void mpfrvec_clear(mpfr_t v[N/2]);
void mpfrvec_add(mpfr_t w[N/2], const mpfr_t u[N/2],  const mpfr_t v[N/2]);
void mpfrvec_sub(mpfr_t w[N/2], const mpfr_t u[N/2],  const mpfr_t v[N/2]);
void mpfrvec_mul(mpfr_t w[N/2], const mpfr_t u[N/2],  const mpfr_t v[N/2]);

#endif
