bridge/class-master/depend/pari/src/basemath/alglin1.c
/* find z such that A z = y. Return NULL if no solution */
find z such that A z = y. Return NULL if no solution
find z such that A z = y . Return NULL if no solution
GEN
gen_matcolinvimage(GEN A, GEN y, void *E, const struct bb_field *ff)
{
  pari_sp av = avma;
  long i, l = lg(A);
  GEN M, x, t;
  M = gen_ker(shallowconcat(A, y), 0, E, ff);
  i = lg(M) - 1;
  if (!i) { avma = av; return NULL; }
  x = gel(M, i);
  t = gel(x, l);
  if (ff->equal0(t)) { avma = av; return NULL; }
  t = ff->neg(E, ff->inv(E, t));
  setlg(x, l);
  for (i = 1; i < l; i++)
    gel(x, i) = ff->red(E, ff->mul(E, t, gel(x, i)));
  return gerepilecopy(av, x);
}
GEN gen_matcolinvimage ( GEN A , GEN y , void * E , const struct bb_field * ff ) { pari_sp av = avma ; long i , l = lg ( A ) ; GEN M , x , t ; M = gen_ker ( shallowconcat ( A , y ) , 0 , E , ff ) ; i = lg ( M ) - 1 ; if ( ! i ) { avma = av ; return NULL ; } x = gel ( M , i ) ; t = gel ( x , l ) ; if ( ff -> equal0 ( t ) ) { avma = av ; return NULL ; } t = ff -> neg ( E , ff -> inv ( E , t ) ) ; setlg ( x , l ) ; for ( i = 1 ; i < l ; i ++ ) gel ( x , i ) = ff -> red ( E , ff -> mul ( E , t , gel ( x , i ) ) ) ; return gerepilecopy ( av , x ) ; }
find z such that A z = y.
find z such that A z = y .