version 1.71, 2017/02/21 09:20:23 |
version 1.72, 2017/08/31 08:08:25 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/array.c,v 1.70 2017/01/08 03:05:39 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/array.c,v 1.71 2017/02/21 09:20:23 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "base.h" |
#include "base.h" |
Line 159 typedef struct _ent { int j; unsigned int e; } ent; |
|
Line 159 typedef struct _ent { int j; unsigned int e; } ent; |
|
|
|
ent *get_row(FILE *,int *l); |
ent *get_row(FILE *,int *l); |
void put_row(FILE *out,int l,ent *a); |
void put_row(FILE *out,int l,ent *a); |
int lu_elim(int *l,ent **a,int k,int i,int mul,int mod); |
void lu_elim(int *l,ent **a,int k,int i,int mul,int mod); |
|
void lu_append(int *,ent **,int *,int,int,int); |
|
void solve_l(int *,ent **,int,int *,int); |
|
void solve_u(int *,ent **,int,int *,int); |
|
|
|
|
static int *ul,*ll; |
static int *ul,*ll; |
static ent **u,**l; |
static ent **u,**l; |
static int modulus; |
static int modulus; |
Line 225 ent *get_row(FILE *in,int *l) |
|
Line 229 ent *get_row(FILE *in,int *l) |
|
return a; |
return a; |
} |
} |
|
|
int lu_gauss(int *ul,ent **u,int *ll,ent **l,int n,int mod) |
void lu_gauss(int *ul,ent **u,int *ll,ent **l,int n,int mod) |
{ |
{ |
int i,j,k,s,mul; |
int i,j,k,s,mul; |
unsigned int inv; |
unsigned int inv; |
Line 248 int lu_gauss(int *ul,ent **u,int *ll,ent **l,int n,int |
|
Line 252 int lu_gauss(int *ul,ent **u,int *ll,ent **l,int n,int |
|
|
|
#define INITLEN 10 |
#define INITLEN 10 |
|
|
lu_append(int *l,ent **a,int *l2,int k,int i,int mul) |
void lu_append(int *l,ent **a,int *l2,int k,int i,int mul) |
{ |
{ |
int len; |
int len; |
ent *p; |
ent *p; |
Line 271 lu_append(int *l,ent **a,int *l2,int k,int i,int mul) |
|
Line 275 lu_append(int *l,ent **a,int *l2,int k,int i,int mul) |
|
|
|
/* a[k] = a[k]-mul*a[i] */ |
/* a[k] = a[k]-mul*a[i] */ |
|
|
int lu_elim(int *l,ent **a,int k,int i,int mul,int mod) |
void lu_elim(int *l,ent **a,int k,int i,int mul,int mod) |
{ |
{ |
ent *ak,*ai,*w; |
ent *ak,*ai,*w; |
int lk,li,j,m,p,q,r,s,t,j0; |
int lk,li,j,m,p,q,r,s,t,j0; |
Line 319 int lu_elim(int *l,ent **a,int k,int i,int mul,int mod |
|
Line 323 int lu_elim(int *l,ent **a,int k,int i,int mul,int mod |
|
l[k] = j; |
l[k] = j; |
} |
} |
|
|
int solve_l(int *ll,ent **l,int n,int *rhs,int mod) |
void solve_l(int *ll,ent **l,int n,int *rhs,int mod) |
{ |
{ |
int j,k,s,len; |
int j,k,s,len; |
ent *p; |
ent *p; |
Line 333 int solve_l(int *ll,ent **l,int n,int *rhs,int mod) |
|
Line 337 int solve_l(int *ll,ent **l,int n,int *rhs,int mod) |
|
} |
} |
} |
} |
|
|
int solve_u(int *ul,ent **u,int n,int *rhs,int mod) |
void solve_u(int *ul,ent **u,int n,int *rhs,int mod) |
{ |
{ |
int j,k,s,len,inv; |
int j,k,s,len,inv; |
ent *p; |
ent *p; |
Line 3087 void mat_to_gfmmat(MAT m,unsigned int md,GFMMAT *rp) |
|
Line 3091 void mat_to_gfmmat(MAT m,unsigned int md,GFMMAT *rp) |
|
TOGFMMAT(row,col,wmat,*rp); |
TOGFMMAT(row,col,wmat,*rp); |
} |
} |
|
|
void Pgeninvm_swap(arg,rp) |
void Pgeninvm_swap(NODE arg,LIST *rp) |
NODE arg; |
|
LIST *rp; |
|
{ |
{ |
MAT m; |
MAT m; |
pointer **mat; |
pointer **mat; |
|
|
} |
} |
} |
} |
|
|
gauss_elim_geninv_mod_swap(mat,row,col,md,invmatp,indexp) |
int gauss_elim_geninv_mod_swap(unsigned int **mat,int row,int col,unsigned int md, |
unsigned int **mat; |
unsigned int ***invmatp,int **indexp) |
int row,col; |
|
unsigned int md; |
|
unsigned int ***invmatp; |
|
int **indexp; |
|
{ |
{ |
int i,j,k,inv,a,n,m; |
int i,j,k,inv,a,n,m; |
unsigned int *t,*pivot,*s; |
unsigned int *t,*pivot,*s; |