Changeset 4de1db in git


Ignore:
Timestamp:
Jan 19, 2011, 7:09:50 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
93134ce8b1735ff9eee324c4ecb029187ba24c08
Parents:
8c097e100503580a34ad9e198d2f1c1adaad7576
Message:
FIX: issues in homolog.lib (Tor/Ext/Ext_R)
ADD: BUG in general.lib (sort)

git-svn-id: file:///usr/local/Singular/svn/trunk@13800 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular/LIB
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/general.lib

    r8c097e r4de1db  
    797797   module( M[ sort(lead(M), "c,dp")[2] ] );
    798798   sort( M, sort(lead(M), "c,dp")[2] )[1];
     799
     800   // BUG: Please, don't use this sort for integer vectors or lists
     801   // with them if there can be negative integers!
     802   // TODO: for some HiWi
     803   sort(3..-3)[1];
     804   sort(list(-v, v))[1];
     805
    799806}
    800807///////////////////////////////////////////////////////////////////////////////
  • Singular/LIB/homolog.lib

    r8c097e r4de1db  
    497497  intvec A1,A2,A3;
    498498  int s = size(v);
    499   intvec v1 = sort(v)[1];
    500   max = v1[s];                 // the maximum integer occurring in intvec v
     499  max = Max(v);                // the maximum integer occurring in intvec v
    501500  int p = printlevel-voice+3;  // p=printlevel+1 (default: p=1)
    502501  // --------------- Variante mit sres
     
    810809  intmat Be;
    811810  int s = size(v);
    812   intvec v1 = sort(v)[1];
    813   max = v1[s];                    // the maximum integer occurring in intvec v
     811  max = Max(v);                   // the maximum integer occurring in intvec v
    814812  int p = printlevel-voice+3;     // p=printlevel+1 (default: p=1)
    815813//---------- test: coker(N)=basering, coker(N)=0 ? ----------------------------
     
    12941292  intmat Be;
    12951293  int s = size(v);
    1296   intvec v1 = sort(v)[1];
    1297   max = v1[s];                   // maximum integer occurring in intvec v
     1294  max = Max(v);                  // maximum integer occurring in intvec v
    12981295  int p = printlevel-voice+3;    // p=printlevel+1 (default: p=1)
    12991296
     
    19291926}
    19301927
     1928// taken from qhmoduli.lib
     1929static proc Max(data)
     1930"USAGE:   Max(data); intvec/list of integers
     1931PURPOSE: find the maximal integer contained in 'data'
     1932RETURN:  list
     1933ASSUME:  'data' contians only integers and is not empty
     1934"
     1935{
     1936  int i;
     1937  int max = data[1];
     1938
     1939  for(i = size(data); i>1;i--)
     1940  {
     1941    if(data[i] > max) { max = data[i]; }
     1942  }
     1943  return(max);
     1944}
     1945example
     1946{"EXAMPLE:";  echo = 2;
     1947  Max(list(1,2,3));
     1948}
Note: See TracChangeset for help on using the changeset viewer.