Home Online Manual
Top
Back: subst
Forward: syz
FastBack: Functions and system variables
FastForward: Control structures
Up: Functions
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

5.1.148 system

Syntax:
system ( string_expression )
system ( string_expression, expression )
Type:
depends on the desired function, may be none
Purpose:
interface to internal data and the operating system. The string_expression determines the command to execute. Some commands require an additional argument (second form) where the type of the argument depends on the command. See below for a list of all possible commands.
Note:
Not all functions work on every platform.
Functions:
system("alarm", int )
abort the Singular process after computing for that many seconds (system+user cpu time).
system("absFact", poly )
absolute factorization of the polynomial (from a polynomial ring over a transzedental extension) Returns a list of the ideal of the factors, intvec of multiplicities, ideal of minimal polynomials and the bumber of factors.
system("blackbox")
list all blackbox data types.
system("browsers");
returns a string about available help browsers. See The online help system.
system("bracket", poly, poly )
returns the Lie bracket [p,q].
system("btest", poly, i2 )
internal for shift algebra (with i2 variables): last block of the poly
system("complexNearZero", number_expression )
checks for a small value for floating point numbers
system("contributors")
returns names of people who contributed to the SINGULAR kernel as string.
system("cpu")
returns the number of cpus as int (for creating multiple threads/processes). (see system("--cpus")).
system("denom_list")
returns the list of denominators (number) which occured in the latest std computationi(s). Is reset to the empty list at ring changes or by this system call.
system("eigenvals", matrix )
returns the list of the eigenvalues of the matrix (as ideal, intvec). (see system("hessenberg")).
system("env", ring )
returns the enveloping algebra (i.e. R tensor R^opp) See system("opp").
system("executable", string )
returns the path of the command given as argument or the empty string (for: not found) See system("Singular"). See system("getenv","PATH").
system("freegb", ideal, i2, i3 )
returns the standrda basis in the shift algebra i(with i3 variables) up to degree i2. See system("opp").
system("getenv", string_expression)
returns the value of the shell environment variable given as the second argument. The return type is string.
system("getPrecDigits")
returns the precision for floating point numbers
system("gmsnf", ideal, ideal, matrix,int, int )
Gauss-Manin system: for gmspoly.lib, gmssing.lib
system("HC")
returns the degree of the "highest corner" from the last std computation (or 0).
system("hessenberg", matrix )
returns the Hessenberg matrix (via QR algorithm).
system("install", s1, s2, p3, i4 )
install a new method p3 for s2 for the newstruct type s1. s2 must be a reserved operator with i4 operands (i4 may be 1,2,3; use 4 for more than 3 or a varying number of arguments) See See Commands for user defined types.
system("LLL", B )
B must be a matrix or an intmat. Interface to NTLs LLL (Exact Arithmetic Variant over ZZ). Returns the same type as the input.
B is an m x n matrix, viewed as m rows of n-vectors. m may be less than, equal to, or greater than n, and the rows need not be linearly independent. B is transformed into an LLL-reduced basis. The first m-rank(B) rows of B are zero.
More specifically, elementary row transformations are performed on B so that the non-zero rows of new-B form an LLL-reduced basis for the lattice spanned by the rows of old-B.
system("nblocks") or system("nblocks", ring_name )
returns the number of blocks of the given ring, or of the current basering, if no second argument is given. The return type is int.
system("nc_hilb", ideal, int, [,...] )
internal support for ncHilb.lib, return nothing
system("neworder", ideal )
string of the ring variables in an heurically good order for char_series
system("newstruct")
list all newstruct data types.
system("opp", ring )
returns the opposite ring.
system("oppose", ring R, poly p )
returns the opposite polynomial of p from R.
system("pcvLAddL", list, list )
system("pcvPMulL", poly, list )
system("pcvMinDeg", poly )
system("pcvP2CV", list, int, int )
system("pcvCV2P", list, int, int )
system("pcvDim", int, int )
system("pcvBasis", int, int ) internal for mondromy.lib
system("pid")
returns the process number as int (for creating unique names).
system("random") or system("random", int )
returns or sets the seed of the random generator.
system("reserve", int )
reserve a port and listen with the given backlog. (see system("reservedLink")).
system("reservedLink")
accept a connect at the reserved port and return a (write-only) link to it. (see system("reserve")).
system("semaphore", string, int )
operations for semaphores: string may be "init", "exists", "acquire", "try_acquire", "release", "get_value", and int is the number of the semaphore. Returns -2 for wrong command, -1 for error or the result of the command.
system("semic", list, list )
or system("semic", list, list, int ) computes from list of spectrum numbers and list of spectrum numbers the semicontinuity index (qh, if 3rd argument is 1).
system("setenv",string_expression, string_expression)
sets the shell environment variable given as the second argument to the value given as the third argument. Returns the third argument. Might not be available on all platforms.
system("sh", string_expression )
shell escape, returns the return code of the shell as int. The string is sent literally to the shell.
system("shrinktest", poly, i2 )
internal for shift algebra (with i2 variables): shrink the poly
system("Singular")
returns the absolute (path) name of the running SINGULAR as string.
system("SingularLib")
returns the colon seperated library search path name as string.
system("spadd", list, list )
or system("spadd", list, list, int ) computes from list of spectrum numbers and list of spectrum numbers the sum of the lists.
system("spectrum", poly )
or system("spectrum", poly, int )
system("spmul", list, int )
or system("spmul", list, list, int ) computes from list of spectrum numbers the multiple of it.
system("std_syz", module, int )
compute a partial groebner base of a module, stopp after the given column
system("stest", poly, i2, i3, i4 )
internal for shift algebra (with i4 variables): shift the poly by i2, up to degree i3
system("tensorModuleMult", int, module )
internal for sheafcoh.lib (see id_TensorModuleMult)
system("twostd", ideal )
returns the two-sided standard basis of the two-sided ideal.
system("uname")
returns a string identifying the architecture for which SINGULAR was compiled.
system("version")
returns the version number of SINGULAR as int. (Version a-b-c-d returns a*10000+b*1000+c*100+d)
system("with")
without an argument: returns a string describing the current version of SINGULAR, its build options, the used path names and other configurations
with a string argument: test for that feature and return an int.
system("--cpus")
returns the number of available cpu cores as int (for using multiple cores). (see system("cpu")).
system("--")
prints the values of all options.
system("--long_option_name")
returns the value of the (command-line) option long_option_name. The type of the returned value is either string or int. See Command line options, for more info.
system("--long_option_name", expression)
sets the value of the (command-line) option long_option_name to the value given by the expression. Type of the expression must be string, or int. See Command line options, for more info. Among others, this can be used for setting the seed of the random number generator, the used help browser, the minimal display time, or the timer resolution.
Example:
 
// a listing of the current directory:
system("sh","ls");
// execute a shell, return to SINGULAR with exit:
system("sh","sh");
string unique_name="/tmp/xx"+string(system("pid"));
unique_name;
==> /tmp/xx4711
system("uname")
==> ix86-Linux
system("getenv","PATH");
==> /bin:/usr/bin:/usr/local/bin
system("Singular");
==> /usr/local/bin/Singular
// report value of all options
system("--");
==> // --batch           0
==> // --execute        
==> // --sdb             0
==> // --echo            1
==> // --profile         0
==> // --quiet           1
==> // --sort            0
==> // --random          12345678
==> // --no-tty          1
==> // --user-option    
==> // --allow-net       0
==> // --browser        
==> // --cntrlc         
==> // --emacs           0
==> // --no-stdlib       0
==> // --no-rc           1
==> // --no-warn         0
==> // --no-out          0
==> // --no-shell        0
==> // --min-time        "0.5"
==> // --cpus            4
==> // --MPport         
==> // --MPhost         
==> // --link           
==> // --ticks-per-sec   1
// set minimal display time to 0.02 seconds
system("--min-time", "0.02");
// set timer resolution to 0.01 seconds
system("--ticks-per-sec", 100);
// re-seed random number generator
system("--random", 12345678);
// allow your web browser to access HTML pages from the net
system("--allow-net", 1);
// and set help browser to firefox
system("--browser", "firefox");
==> // ** Could not get 'DataDir'.
==> // ** Either set environment variable 'SINGULAR_DATA_DIR' to 'DataDir',
==> // ** or make sure that 'DataDir' is at "/home/hannes/singular/doc/../Sin\
   gular/../share/"
==> // ** Could not get 'IdxFile'.
==> // ** Either set environment variable 'SINGULAR_IDX_FILE' to 'IdxFile',
==> // ** Could not get 'DataDir'.
==> // ** Either set environment variable 'SINGULAR_DATA_DIR' to 'DataDir',
==> // ** or make sure that 'DataDir' is at "/home/hannes/singular/doc/../Sin\
   gular/../share/"
==> // ** or make sure that 'IdxFile' is at "%D/singular/singular.idx"
==> // ** resource `x` not found
==> // ** Setting help browser to 'dummy'.