fix hw3 some changes
This commit is contained in:
38
hws/hw3/matutil.h
Normal file
38
hws/hw3/matutil.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef __MATUTIL_H__
|
||||
#define __MATUTIL_H__
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "nr.h"
|
||||
#include "nrutil.h"
|
||||
|
||||
|
||||
void print_vector_float(int size, float* v);
|
||||
|
||||
void print_vector_int(int size, int* v);
|
||||
|
||||
|
||||
|
||||
float **new_matrix(int m, int n);
|
||||
|
||||
void print_matrix(int m, int n, float **mat);
|
||||
|
||||
void copy_matrix(int m, int n, float **src, float **dst);
|
||||
|
||||
void simple_free_matrix(int m, int n, float **mat);
|
||||
|
||||
/**
|
||||
* a struct for get solution of ax = b
|
||||
*/
|
||||
typedef struct JMatrixData {
|
||||
int m, n;
|
||||
float **a;
|
||||
float **b;
|
||||
} JMatrixData;
|
||||
|
||||
JMatrixData* new_jmatdata(int m, int n);
|
||||
|
||||
void free_jmatdata(JMatrixData* data);
|
||||
|
||||
void copy_jmatdata(JMatrixData *src, JMatrixData *dst);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user