/*
 * Biblioteca de Funcoes para manipulação de matrizes
 *----------------------------------------------------------------
 * Autores:
 * - Gustavo Sverzut Barbieri <ra008849@ic.unicamp.br> - Eng. Computação - Unicamp 
 * - Ivens Prates Teles Alves <ra008908@ic.unicamp.br> - Eng. Computação - Unicamp
 */

#ifndef _LIB_MATRIZ_H_
#define _LIB_MATRIZ_H_

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

typedef struct {
  double **info;
  int nl;
  int nc;
  char nome[10];
} Matriz;

#define MSG0 "Espaço Insuficiente na Memória. "
#define MSG1 "Estrutura Inexistente. "
#define MSG2 "Estruturas Incompatíveis para operação. "

#define Aviso(MSG,nomefuncao) fprintf(stderr,"Aviso: '%s' na função: '%s'\n",MSG,nomefuncao);

/* Funcoes Básicas de Matriz ------------------------------------------------------------------------*/
Matriz *matCria(int nl, int nc, char nome[]);
void    matDestroi(Matriz *m);
Matriz *matSoma(Matriz *m1, Matriz *m2, char nome[]);
Matriz *matSomaEscalar(Matriz *m1, double n, char nome[]);
Matriz *matMultiplica(Matriz *m1, Matriz *m2, char nome[]);
Matriz *matMultiplicaEscalar(Matriz *m1, double n, char nome[]);

/* Matrizes Especiais -------------------------------------------------------------------------------*/
Matriz *matHilbert(int n, char nome[]);
Matriz *matRandom(int m, int n,  char nome[], double x0, double x1);

/* Funcoes para Ler/Escrever Matrizes --------------------------------------------------------------*/
void matImprime(Matriz *m, char formato[]);
void matImprimeLatex(Matriz *m, char formato[]);
void matLer(Matriz *m);

#endif









