Changeset 31c836 in git for Singular


Ignore:
Timestamp:
Mar 10, 2020, 3:15:39 PM (4 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ed7384a7d318d0c134a4985e814a9a2ca3eeb1fa
Parents:
0b3c231859f88bf091386e066109a0766f11896d
Message:
fix: redef, opt. for loops
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/algebra.lib

    r0b3c23 r31c836  
    390390    int m = ncols(A);
    391391    int s = size(B);
    392     int i;
     392    int i,@xx,@yy;
    393393    string mp = string(minpoly);
    394394 // --------------------- 1st variant of algorithm ----------------------
     
    397397    {
    398398      list l6; 
    399       for (int xx = 1; xx <= m; xx++)
     399      for (@xx = 1; @xx <= m; @xx++)
    400400      {
    401        l6[size(l6)+1] = "y("+string(xx)+")";
     401       l6[size(l6)+1] = "y("+string(@xx)+")";
    402402      }
    403403      ring R1 = create_ring(ringlist(br)[1], l6, "dp", "no_minpoly");
     
    411411 // ---------- create new ring with extra variables --------------------
    412412    list l7; 
    413     for (int xx = 1; xx <= n; xx++)
    414     {
    415      l7[size(l7)+1] = "x("+string(xx)+")";
    416     }
    417     for (int yy = 1; yy <= m; yy++)
    418     {
    419      l7[size(l7)+1] = "y("+string(yy)+")";
     413    for (@xx = n; @xx >= 1; @xx--)
     414    {
     415     l7[@xx] = "x("+string(@xx)+")";
     416    }
     417    for (@yy = m; @yy >= 1; @yy--)
     418    {
     419     l7[n+@yy] = "y("+string(@yy)+")";
    420420    }
    421421    ring R2 = create_ring(ringlist(br)[1], l7, "dp", "no_minpoly");
     
    447447       {
    448448        list l8; 
    449         for (int xx = 1; xx <= n; xx++)
     449        for (@xx = n; @xx >=1; @xx--)
    450450        {
    451          l8[size(l8)+1] = "x("+string(xx)+")";
     451         l8[@xx] = "x("+string(@xx)+")";
    452452        }
    453         for (int yy = 1; yy <= m; yy++)
     453        for (@yy = m; @yy >= 1; @yy--)
    454454        {
    455          l8[size(l8)+1] = "y("+string(yy)+")";
     455         l8[n+@yy] = "y("+string(@yy)+")";
    456456        }
    457457        setring(br);
Note: See TracChangeset for help on using the changeset viewer.