Changeset 38f64f3 in git


Ignore:
Timestamp:
Jul 1, 2019, 2:09:17 PM (5 years ago)
Author:
Andreas Steenpass <steenpass@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
4b7966107c42517ad9414fb42aafae650eb74994
Parents:
4abcd2d774b1f54dbe0a29184ff63af5c678b3fa
Message:
add parse_var() to ring.lib
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/ring.lib

    r4abcd2 r38f64f3  
    14061406}
    14071407
     1408static proc parse_var(string v)
     1409{
     1410  if (v[1, 4] == "var(" && defined(basering))
     1411  {
     1412      int i = int(v[5,size(v)-5]);
     1413      v = ringlist(basering)[2][i];
     1414  }
     1415  return(v);
     1416}
     1417
    14081418/*
    14091419 * parses
     
    14151425  if (find(l2, "(", 1) == 0)   // no parentheses
    14161426  {
    1417       return(list(l2));
     1427      return(list(parse_var(l2)));
    14181428  }
    14191429  list V = tuple_to_tokens(l2);
     1430  for (int i = size(V); i > 0; i--)
     1431  {
     1432      V[i] = parse_var(V[i]);
     1433  }
    14201434  return(V);
    14211435}
     
    15271541
    15281542  /* L[1] */
    1529   if (typeof(l2) == "list")
     1543  if (typeof(l1) == "list")
    15301544  {
    15311545    if (no_minpoly)
     
    15421556      }
    15431557    }
     1558  }
     1559  if (typeof(l1) == "list" || typeof(l1) == "int")
     1560  {
    15441561    L[1] = l1;
    15451562  }
Note: See TracChangeset for help on using the changeset viewer.