#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 c, x, b;

	set_bnc_default_prec_decimal(50);

	x = init_mpfmatrix(DIM, DIM);
	b = init_mpfmatrix(DIM, DIM);
	c = init_mpfmatrix(DIM, DIM);

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

	add_mpfmatrix(c, x, b);

	print_mpfmatrix(c);

	free_mpfmatrix(x);
	free_mpfmatrix(b);
	free_mpfmatrix(c);

	return EXIT_SUCCESS;
}

