"Fossies" - the Fresh Open Source Software Archive

Member "jas-2.6/examples/montes_ex51s.rb" (7 Sep 2014, 1397 Bytes) of package /linux/privat/jas-2.6.5988-src.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #
    2 # jruby examples for jas.
    3 # $Id: montes_ex51s.rb 4897 2014-09-07 13:00:06Z kredel $
    4 #
    5 
    6 require "examples/jas"
    7 
    8 # Montes JSC 2002, 33, 183-208, example 5.1, simplified
    9 # integral function coefficients
   10 
   11 r = PolyRing.new( PolyRing.new(QQ(),"a, b",PolyRing.lex), "u,z,y,x", PolyRing.lex );
   12 puts "Ring: " + str(r);
   13 puts;
   14 
   15 #automatic: one,a,b,u,z,y,x = r.gens();
   16 puts "gens: " + r.gens().each{ |f| str(f) }.join(",");
   17 puts;
   18 
   19 f1 = 756 * x - 39 * a * b - 4 * b - 155 - 117 * a + ( 117 * a + 51 ) * u;
   20 f2 = 189 * y + 6 * a * b - 107 - 43 * b + 18 * a - ( 18 * a - 123 ) * u;
   21 f3 = 756 * z - 1439 + 236 * b + 99 * a + 33 * a * b - ( 99 * a - 15 ) * u;
   22 f4 = ( 9 * a**2 - 30 * a + 21 ) * u - 9 * a**2 - 3 * a**2 * b + 11 * a * b + 22 * a - 49 + 28 * b;
   23 
   24 F = [f1,f2,f3,f4];
   25 
   26 puts "F: " + F.each{ |f| str(f) }.join(",");
   27 puts;
   28 
   29 #startLog();
   30 
   31 If = r.paramideal( "", list = F );
   32 puts "ParamIdeal: " + str(If);
   33 puts;
   34 
   35 ## G = If.GB();
   36 ## puts "GB: " + str(G);
   37 ## puts;
   38 ## sys.exit();
   39 
   40 GS = If.CGBsystem();
   41 GS = If.CGBsystem();
   42 GS = If.CGBsystem();
   43 puts "CGBsystem: " + str(GS);
   44 puts;
   45 
   46 bg = GS.isCGBsystem();
   47 if bg
   48     puts "isCGBsystem: true";
   49 else
   50     puts "isCGBsystem: false";
   51 end
   52 puts;
   53 
   54 terminate();
   55 exit();
   56 
   57 CG = If.CGB();
   58 puts "CGB: " + str(CG);
   59 puts;
   60 
   61 bg = CG.isCGB();
   62 if bg
   63     puts "isCGB: true";
   64 else
   65     puts "isCGB: false";
   66 end
   67 puts;
   68 
   69 terminate();
   70 #------------------------------------------
   71 #exit();
   72