Changeset 8c4ee5d in git for Singular/LIB/deform.lib


Ignore:
Timestamp:
Jan 24, 1998, 2:06:00 PM (26 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
Children:
c9567bfac5f32486500c38100e3dcb22da219bb4
Parents:
f1201aeda3c936a00561052557964a012e827d7e
Message:
* hannes: added lift_kbase to deform.lib


git-svn-id: file:///usr/local/Singular/svn/trunk@1061 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/deform.lib

    rf1201a r8c4ee5d  
    1 // $Id: deform.lib,v 1.4 1998-01-23 15:44:59 Singular Exp $
     1// $Id: deform.lib,v 1.5 1998-01-24 13:06:00 Singular Exp $
    22//(bm, last modified 12/97)   
    33///////////////////////////////////////////////////////////////////////////////
     
    99 lift_rel_kb(N,M[,kbM,p]) lifting N into a kbase of M
    1010 kill_rings(["prefix"])   kills the exported rings from above
     11 lift_kbase(N,M);         coef-matrix expressing N as lin. comb. of k-basis of M
    1112 
    1213  SUB-PROCEDURES            used by main procedure:
     
    892893   return(dv);
    893894}
     895
     896
     897///////////////////////////////////////////////////////////////////////////////
     898
     899proc lift_kbase (N, M)
     900USAGE:   lift_kbase(N,M); N,M=poly/ideal/vector/module
     901RETURN:  matrix A, coefficient matrix expressing N as linear combination of
     902         k-basis of M. Let the k-basis have k elements and size(N)=c columns.
     903         Then A satisfies:
     904             matrix(reduce(N,std(M)),k,c) = matrix(kbase(std(M)))*A
     905ASSUME:  dim(M)=0 and the monomial ordering is a well ordering or the last
     906         block of the ordering is c or C
     907EXAMPLE: example lift_kbase; shows an example
     908{
     909//----------  initialisation  -------------------------------------------------
     910   string ords = ordstr(basering);
     911   int    d,col,k,l;
     912   module kb;
     913   matrix testm;
     914   vector v,p,q;
     915//------- check wether ordering is correct ------------------------------------
     916   k=1;
     917   for( l=1;l<=nvars(basering);l=l+1 ) { k=k*(lead(1+var(l))==var(l)); }
     918   if( k==0 )
     919   {
     920      if( ords[size(ords)]!="c" and ords[size(ords)]!="C" )
     921      {
     922         "// change ordering!";
     923         "// ordering "+ordstr(basering)+" not implemented for this proc";
     924         return();
     925      }
     926   }
     927//----------  check assumtions  -----------------------------------------------
     928   if( typeof(N)=="poly" ) { ideal J=ideal(N); kill N; module N=J; kill J; }
     929   if( typeof(M)=="poly" ) { ideal J=ideal(M); kill M; module M=J; }
     930   M = std(M);
     931   d = vdim(M);
     932   if( d<1 )
     933   { "// second argument in `lift_kbase` has vdim",d; return(); }
     934//----------  compute kbase and reduce(N,M) -----------------------------------
     935   kb = kbase(M);
     936   col = ncols(N);
     937   N = reduce(N,M);
     938   N = matrix(N,nrows(N),col);
     939//----------  collecting coefficients of reduce(N,M) --------------------------
     940   matrix result[d][col];
     941   for( l=1;l<=col;l=l+1 )
     942   {
     943      v = N[l];
     944      if( size(v)>0 )
     945      {
     946         for( k=1;k<=d;k=k+1 )
     947         {
     948            p = kb[k];
     949            q = lead(v);
     950            if( size(p-q)<2 )
     951            {
     952               result[k,l] = leadcoef(q);
     953               v = v-q;
     954               if( size(v)<1 ) { k=d+1; }
     955               else { k=0; }
     956            }
     957         }
     958      }
     959   }
     960//---------  final test -------------------------------------------------------
     961   testm = matrix(N,nrows(kb),ncols(result))- matrix(kb)*result;
     962   if( size(module(testm))!=0 )
     963   {
     964      "// proc `lift_kbase` did'nt work correctly!";
     965      "// Please inform tthe authors";
     966      return();
     967   }
     968   return(result);
     969}
     970example
     971{"EXAMPLE:";     echo=2;
     972  ring R=0,(x,y),ds;
     973  module M=[x2,xy],[y2,xy],[0,xx],[0,yy];
     974  module N=[x3+xy,x],[x,x+y2];
     975  print(M);
     976  module kb=kbase(std(M));
     977  print(kb);
     978  print(N);
     979  matrix A=lift_kbase(N,M);
     980  print(A);
     981  matrix(reduce(N,std(M)),nrows(kb),ncols(A)) - matrix(kbase(std(M)))*A;
     982}
Note: See TracChangeset for help on using the changeset viewer.