Changeset dd2aa36 in git


Ignore:
Timestamp:
Jun 21, 1999, 7:34:15 PM (25 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
1354bda55ee798716af916942e769a15d6728278
Parents:
d1f46162556b5ef35ebcf98cea94b1706df61795
Message:
* hannes: fixed verbosity of general.lib::kmemory


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/general.lib

    rd1f461 rdd2aa36  
    1 // $Id: general.lib,v 1.12 1999-06-18 13:47:27 greuel Exp $
     1// $Id: general.lib,v 1.13 1999-06-21 17:34:15 Singular Exp $
    22//system("random",787422842);
    33//GMG, last modified 18.6.99
    44///////////////////////////////////////////////////////////////////////////////
    55
    6 version="$Id: general.lib,v 1.12 1999-06-18 13:47:27 greuel Exp $";
     6version="$Id: general.lib,v 1.13 1999-06-21 17:34:15 Singular Exp $";
    77info="
    88LIBRARY:  general.lib   PROCEDURES OF GENERAL TYPE
     
    1313 factorial(n[,../..]);  n factorial (=n!) (type int), [type string/number]
    1414 fibonacci(n[,p]);      nth Fibonacci number [char p]
    15  kmemory([n]);          active [allocated] memory in kilobyte
     15 kmemory([n[,v]]);      active [allocated] memory in kilobyte
    1616 killall();             kill all user-defined variables
    1717 number_e(n);           compute exp(1) up to n decimal digits
     
    231231
    232232proc kmemory (list #)
    233 "USAGE:   kmemory([n]); n = int
     233"USAGE:   kmemory([n,[v]]); n = int
    234234RETURN:  memory in kilobyte of type int
    235235         n=0: memory used by active variables (same as no parameters)
     
    237237         n=2: difference between top and init memory adress (sbrk memory)
    238238         n!=0,1,2: 0
    239 DISPLAY: detailed information about allocated and used memory if n!=0,1,2
     239DISPLAY: detailed information about allocated and used memory if v!=0
    240240NOTE:    kmemory uses internal function 'memory' to compute kilobyte, and
    241241         is the same as 'memory' for n!=0,1,2
     
    244244{
    245245   int n;
     246   int verb;
    246247   if (size(#) != 0)
    247248   {
    248249     n=#[1];
     250     if (size(#) >1)
     251     { verb=#[2]; }
    249252   }
    250253   
    251   if ( n==0)
    252   { dbprint(printlevel-voice+3,
    253     "// memory used, at the moment, by active variables (kilobyte):"); }
    254   if ( n==1 )
    255   { dbprint(printlevel-voice+3,
    256     "// total memory allocated, at the moment, by SINGULAR (kilobyte):"); }
     254  if ( verb != 0)
     255  {
     256    if ( n==0)
     257    { dbprint(printlevel-voice+3,
     258      "// memory used, at the moment, by active variables (kilobyte):"); }
     259    if ( n==1 )
     260    { dbprint(printlevel-voice+3,
     261      "// total memory allocated, at the moment, by SINGULAR (kilobyte):"); }
     262   }
    257263   return ((memory(n)+1023)/1024);
    258264}
     
    260266{ "EXAMPLE:"; echo = 2;
    261267   kmemory();
    262    kmemory(1);
     268   kmemory(1,1);
    263269}
    264270///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.