Initial revision.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@366 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
96eb037c60
commit
727742f4bc
12 changed files with 472 additions and 0 deletions
38
SWIG/Examples/guile/matrix/matrix.i
Normal file
38
SWIG/Examples/guile/matrix/matrix.i
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// FILE : matrix.i
|
||||
|
||||
%init Matrix_init
|
||||
%{
|
||||
|
||||
void set_m(double **M, int i, int j, double val) {
|
||||
M[i][j] = val;
|
||||
}
|
||||
|
||||
double get_m(double **M, int i, int j) {
|
||||
return M[i][j];
|
||||
}
|
||||
%}
|
||||
|
||||
%section "Matrix Operations"
|
||||
extern double **new_matrix();
|
||||
/* Creates a new matrix and returns a pointer to it */
|
||||
|
||||
extern void destroy_matrix(double **M);
|
||||
/* Destroys the matrix M */
|
||||
|
||||
extern void print_matrix(double **M);
|
||||
/* Prints out the matrix M */
|
||||
|
||||
extern void set_m(double **M, int i, int j, double val);
|
||||
/* Sets M[i][j] = val*/
|
||||
|
||||
extern double get_m(double **M, int i, int j);
|
||||
/* Returns M[i][j] */
|
||||
|
||||
extern void mat_mult(double **a, double **b, double **c);
|
||||
/* Multiplies matrix a by b and places the result in c*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue