#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define USE_GMP
#define USE_MPFR
#include "bnc.h"

#define DIM 5

int main()
{
	long int i, j;
	MPFMatrix x;
	MPFVector vc, vb;

	set_bnc_default_prec_decimal(50);

	x = init_mpfmatrix(DIM, DIM);

	vb = init_mpfvector(DIM);
	vc = init_mpfvector(DIM);

	for(i = 0; i < DIM; i++)
	{
		set_mpfvector_i_d(vb, i, (double)(DIM - i));
		for(j = 0; j < DIM; j++)
		{
			set_mpfmatrix_ij_d(x, i, j, (double)(i * DIM + j + 1));
		}
	}

	mul_mpfmatrix_mpfvec(vc, x, vb);

	print_mpfvector(vc);

	free_mpfmatrix(x);

	free_mpfvector(vb);
	free_mpfvector(vc);

	return EXIT_SUCCESS;
}

