  
  [1m[4m[31m9. Miscellaneous functions[0m
  
  The  bahaviour  of  [1msimpcomp[0m  can  be  changed  by  setting  global options,
  functions for which will be described in the following.
  
  
  [1m[4m[31m9.1 [1msimpcomp[1m[4m[31m error handling[0m
  
  [1msimpcomp[0m can be configured to either enter a break loop when encountering an
  error  or  to  just  log  the  error and return [22m[32mfail[0m in the called function.
  Examples  for errors would be a computation failing or a [22m[32mSCSimplicialComplex[0m
  object having an inconsistent internal state
  
  [1m[4m[31m9.1-1 SCErrorBreak[0m
  
  [1m[34m> SCErrorBreak( [0m[22m[34mflag[0m[1m[34m ) _____________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m upon success, [22m[32mfail[0m otherwise.
  
  Sets whether [1msimpcomp[0m enters a break loop when encountering an error or just
  returns [22m[32mfail[0m in the function called.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCErrorBreak(true);[0m
    [22m[35m true[0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.1-2 SCErrorMail[0m
  
  [1m[34m> SCErrorMail( [0m[22m[34mflag[0m[1m[34m ) ______________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m upon success, [22m[32mfail[0m otherwise.
  
  Sets  whether  [1msimpcomp[0m  should  send  an  email to the address specified by
  [1m[34mSCMailSetAddress[0m ([1m9.2-6[0m) when encountering an error.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCErrorMail(true);[0m
    [22m[35m true[0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m9.2 Email notification system[0m
  
  [1msimpcomp[0m  comes with an email notification system that can be used for being
  notified of the progress of lengthy computations (such as reducing a complex
  via  bistellar flips). See below for a descriptions of the mail notification
  related functions.
  
  [1m[4m[31m9.2-1 SCMailClearPending[0m
  
  [1m[34m> SCMailClearPending( [0m[22m[34m[0m[1m[34m ) ___________________________________________[0mfunction
  [1mReturns:[0m  nothing.
  
  Clears a pending mail message.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCMailClearPending();[0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.2-2 SCMailIsEnabled[0m
  
  [1m[34m> SCMailIsEnabled( [0m[22m[34m[0m[1m[34m ) ______________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfalse[0m upon success, [22m[32mfail[0m otherwise.
  
  Returns [22m[32mtrue[0m when the mail notification system of [1msimpcomp[0m is enabled, [22m[32mfalse[0m
  otherwise. Default setting is [22m[32mfalse[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCMailIsEnabled();[0m
    [22m[35m false[0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.2-3 SCMailIsPending[0m
  
  [1m[34m> SCMailIsPending( [0m[22m[34m[0m[1m[34m ) ______________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfalse[0m upon success, [22m[32mfail[0m otherwise.
  
  Returns  [22m[32mtrue[0m  when  an  email  of the [1msimpcomp[0m email notification system is
  pending, [22m[32mfalse[0m otherwise.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCMailIsPending();[0m
    [22m[35m false[0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.2-4 SCMailSend[0m
  
  [1m[34m> SCMailSend( [0m[22m[34mmessage[, starttime][,][forcesend][0m[1m[34m ) _________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m  when  the  message  was sent, [22m[32mfalse[0m if it was not send, [22m[32mfail[0m
            upon an error.
  
  Tries  to send an email to the address specified by [1m[34mSCMailSetAddress[0m ([1m9.2-6[0m)
  using  the unix program [22m[32mmail[0m. The optional parameter [22m[34mstarttime[0m specifies the
  starting  time  (as  the  integer  unix timestamp) a calculation was started
  (then  the  duration  of  the  calculation  is  included  in the email), the
  optional boolean parameter [22m[34mforcewrite[0m can be used to force the sending of an
  email,  even  if  this  violates  the  minimal  email  sending interval, see
  [1m[34mSCMailSetMinInterval[0m ([1m9.2-8[0m).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCMailIsEnabled();[0m
    [22m[35m true[0m
    [22m[35m gap> SCMailSend("Hello, this is simpcomp.");[0m
    [22m[35m true[0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.2-5 SCMailSendPending[0m
  
  [1m[34m> SCMailSendPending( [0m[22m[34m[0m[1m[34m ) ____________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m upon success, [22m[32mfail[0m otherwise.
  
  Tries  to  send  a  pending email of the [1msimpcomp[0m email notification system.
  Returns [22m[32mtrue[0m on success or if there was no mail pending.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCMailSendPending();[0m
    [22m[35m true[0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.2-6 SCMailSetAddress[0m
  
  [1m[34m> SCMailSetAddress( [0m[22m[34maddress[0m[1m[34m ) ______________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m upon success, [22m[32mfail[0m otherwise.
  
  Sets the email address that should be used to send notification messages and
  enables   the   mail   notification   system   by  calling  [1m[34mSCMailSetEnabled[0m
  ([1m9.2-7[0m)([22m[32mtrue[0m).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCMailSetAddress("johndoe@somehost");[0m
    [22m[35m true[0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.2-7 SCMailSetEnabled[0m
  
  [1m[34m> SCMailSetEnabled( [0m[22m[34mflag[0m[1m[34m ) _________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m upon success, [22m[32mfail[0m otherwise.
  
  Enables  or disables the mail notification system of [1msimpcomp[0m. By default it
  is  disabled.  Returns  [22m[32mfail[0m  if  no  email  message was previously set with
  [1m[34mSCMailSetAddress[0m ([1m9.2-6[0m).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCMailSetAddress("johndoe@somehost"); #enables mail notification[0m
    [22m[35m true[0m
    [22m[35m gap> SCMailSetEnabled(false);[0m
    [22m[35m true[0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.2-8 SCMailSetMinInterval[0m
  
  [1m[34m> SCMailSetMinInterval( [0m[22m[34minterval[0m[1m[34m ) _________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m upon success, [22m[32mfail[0m otherwise.
  
  Sets  the minimal time interval in seconds that mail messages can be sent by
  [1msimpcomp[0m.  This  prevents  a  flooding  of  the specified email address with
  messages sent by [1msimpcomp[0m. Default is 3600, i.e. one hour.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCMailSetMinInterval(7200);[0m
    [22m[35m true[0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m9.3 Testing the functionality of [1msimpcomp[1m[4m[31m[0m
  
  [1msimpcomp[0m  makes  use of the [1mGAP[0m internal testing mechanisms and provides the
  user with a function to test the functionality of the package.
  
  [1m[4m[31m9.3-1 SCRunTest[0m
  
  [1m[34m> SCRunTest( [0m[22m[34m[0m[1m[34m ) ____________________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m upon success, [22m[32mfail[0m otherwise.
  
  Test    whether    the   package   [1msimpcomp[0m   is   functional   by   calling
  [22m[32mReadTest("GAPROOT/pkg/simpcomp/tst/simpcomp.tst");[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m gap> SCRunTest();[0m
    [22m[35m + test simpcomp package, version 1.1.9[0m
    [22m[35m + GAP4stones: 69988[0m
    [22m[35m true[0m
    [22m[35m [0m
  [22m[35m------------------------------------------------------------------[0m
  
