home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / e / e031 / 3.ddi / MATHZIP2 / STARTUP / SYSINIT.M < prev    next >
Encoding:
Text File  |  1991-08-26  |  6.2 KB  |  201 lines

  1. (* $Id: sysinit.m,v 1.3 1991/08/22 16:38:08 rory Exp $ *)
  2.  
  3. (* we put all this in the System context *)
  4.    Begin["System`"]
  5.  
  6. (* set up the first possible message *)
  7.    General::noopen = "Can't open `1`."
  8.  
  9. (* this message is here because we want to use Off[General::writewarn] *)
  10.    General::writewarn = "Defining rule for `1`."
  11.  
  12.    Off[General::newsym]
  13.  
  14. (* external packages communication (to be moved into the kernel) *)
  15.    << Install.m
  16.  
  17. (* install ExpandAll,ExpandDenominator,ExpandNumerator,PowerExpand *)
  18.    <<Expand.m
  19.  
  20. (* install ValueQ function *)
  21.    <<ValueQ.m
  22.  
  23. (* install basic Mathematica code for Integrate[ ] *)
  24.    <<Integrate.m
  25.  
  26. (* install SinIntegral, CosIntegral *)
  27.    <<SinIntegral.m
  28.  
  29. (* install inverse functions *)
  30.    <<InverseFunctions.m
  31.  
  32. (* install formats for Infinity *)
  33.    <<FormatInfinity.m
  34.  
  35. (* install multidimensional Fourier Transforms *)
  36.    <<Fourier.m
  37.  
  38. (* install RunThrough command *)
  39.    <<RunThrough.m
  40.  
  41. (* install Edit command *)
  42.    <<Edit.m
  43.  
  44. (* install SetAttributes and ClearAttributes commands.  Some of the
  45.     packages below use SetAttributes[ ] so keep this up here. *)
  46.    <<Attributes.m
  47.  
  48. (* install the correct conversion utilities for Plots *)
  49.   <<GraphicsCoercion.m
  50.  
  51. (* install Digits.m (obsolete) *)
  52.    << Digits.m
  53.  
  54. (* warning messages for obsolete options and functions *)
  55.   << Obsolete.m
  56.  
  57. (* Now carry out Thin system generation *)
  58.  
  59. $DumpedPackages = 
  60.   { "Install.m", "Expand.m", "ValueQ.m", "Integrate.m", "SinIntegral.m",
  61.     "InverseFunctions.m", "FormatInfinity.m", "Fourier.m", "RunThrough.m",
  62.     "Edit.m", "Attributes.m", "GraphicsCoercion.m", "Digits.m", "Obsolete.m"}
  63.  
  64. $DumpedPackages::usage = "$DumpedPackages gives a list of the packages which
  65.     have been dumped into the system."
  66.  
  67. System`Private`FatStuff := 
  68. (
  69. Get["msg.m"];             (* read in messages file *)
  70. Get["info.m"];             (* read in file of information about functions *)
  71. Get["Integrate/table.m"];     (* install code for indefinite integration  *)
  72. Get["Integrate/main.m"];     (* install code for definite integration  *)
  73. Get["Elliptic.m"];         (* install elliptic functions *)
  74. Get["HypergeometricPFQ.m"];     (* install generalized hypergeometric functions *)
  75. Get["Series.m"];         (* install additional Series definitions *)
  76. Get["ClebschGordan.m"];     (* install symbolic Clebsch-Gordan coefficients *)
  77. Get["LinearProgramming.m"];     (* install linear programming *)
  78. Get["PrimePi.m"];         (* install PrimePi *)
  79. Get["GroebnerBasis.m"];     (* install GroebnerBasis command *)
  80. Get["NSolve.m"];         (* install NSolve *)
  81. Get["ComplexExpand.m"];     (* definitions for ComplexExpand *)
  82. $DumpedPackages = Join[ $DumpedPackages,
  83.   {"msg.m", "info.m", "Integrate/table.m",
  84.    "Integrate/main.m", "Elliptic.m", "HypergeometricPFQ.m", "Series.m", 
  85.    "ClebschGordan.m", "LinearProgramming.m", "PrimePi.m", "GroebnerBasis.m",
  86.    "NSolve.m", "ComplexExpand.m"}]
  87. )
  88.  
  89. (* Thin system stuff  *)
  90.  
  91.  
  92. Unprotect[ $NewMessage]
  93.  
  94. Unprotect[ SystemStub]
  95.  
  96. Unprotect[AutoLoad]
  97.  
  98. Begin["`Private`"] 
  99.  
  100. $NewMessage :=
  101.         Function[ {Symb, Tag},
  102.                 Module[ {Res, Mname},
  103.                         Mname = ToString[ MessageName[Symb, Tag]] ;
  104.                         Res = If[ Tag =!= "usage",
  105.                                 FindList[ "msgthin.m",{ Mname,
  106.                                         ToString[MessageName[General, Tag]]}],
  107.                                 FindList[ "infothin.m", Mname]] ;
  108.             If[ ListQ[Res] && Apply[ And, Map[ StringQ, Res]],
  109.                       ToExpression[ Res]] ;
  110.                         ],
  111.                 {HoldAll}]
  112.  
  113. Attributes[ $NewMessage] = {Protected}
  114.  
  115. SystemStub[ Fn_, File_] :=
  116.         Block[{Args},
  117.                 Unprotect[ Fn] ;
  118.                 (Fn[Args___]:= AutoLoad[Fn,File,{Args}]);
  119.                 SetAttributes[Fn, {Protected, ReadProtected}]
  120.         ]
  121.  
  122. Attributes[ SystemStub] = {Protected}
  123.  
  124. AutoLoad[Fn_,File_,Args_]:=
  125.         Block[{},
  126.                 Get[File];
  127.                 Apply[Fn,Args]
  128.         ];
  129.  
  130. Attributes[ AutoLoad] = {Protected}
  131.  
  132. End[]
  133.  
  134. SystemStub[ Integrate`Definite, "Integrate`main`"];
  135. SystemStub[ Integrate`TableLookUp, "Integrate`table`"];
  136. SystemStub[ JacobiSN, "Elliptic.m"];
  137. SystemStub[ JacobiSD, "Elliptic.m"];
  138. SystemStub[ JacobiSC, "Elliptic.m"];
  139. SystemStub[ JacobiCS, "Elliptic.m"];
  140. SystemStub[ JacobiCN, "Elliptic.m"];
  141. SystemStub[ JacobiCD, "Elliptic.m"];
  142. SystemStub[ JacobiNC, "Elliptic.m"];
  143. SystemStub[ JacobiND, "Elliptic.m"];
  144. SystemStub[ JacobiDN, "Elliptic.m"];
  145. SystemStub[ JacobiDS, "Elliptic.m"];
  146. SystemStub[ JacobiDC, "Elliptic.m"];
  147. SystemStub[ JacobiAmplitude, "Elliptic.m"];
  148. SystemStub[ InverseJacobiSN, "Elliptic.m"];
  149. SystemStub[ InverseJacobiSD, "Elliptic.m"];
  150. SystemStub[ InverseJacobiSC, "Elliptic.m"];
  151. SystemStub[ InverseJacobiCS, "Elliptic.m"];
  152. SystemStub[ InverseJacobiCN, "Elliptic.m"];
  153. SystemStub[ InverseJacobiCD, "Elliptic.m"];
  154. SystemStub[ InverseJacobiNS, "Elliptic.m"];
  155. SystemStub[ InverseJacobiNC, "Elliptic.m"];
  156. SystemStub[ InverseJacobiDS, "Elliptic.m"];
  157. SystemStub[ InverseJacobiDC, "Elliptic.m"];
  158. SystemStub[ InverseJacobiDN, "Elliptic.m"];
  159. SystemStub[ InverseJacobiND, "Elliptic.m"];
  160. SystemStub[ EllipticNomeQ, "Elliptic.m"];
  161. SystemStub[ EllipticThetaS, "Elliptic.m"];
  162. SystemStub[ EllipticThetaC, "Elliptic.m"];
  163. SystemStub[ EllipticThetaN, "Elliptic.m"];
  164. SystemStub[ EllipticThetaD, "Elliptic.m"];
  165. SystemStub[ WeierstrassP, "Elliptic.m"];
  166. SystemStub[ WeierstrassPPrime, "Elliptic.m"];
  167. SystemStub[ InverseWeierstrassP, "Elliptic.m"];
  168. SystemStub[ HypergeometricPFQ, "HypergeometricPFQ.m"];
  169. SystemStub[ HypergeometricPFQRegularized, "HypergeometricPFQ.m"];
  170. SystemStub[InverseSeries, "Series.m"];
  171. SystemStub[Series, "Series.m"];
  172. SystemStub[SeriesData, "Series.m"];
  173. SystemStub[ ClebschGordan, "ClebschGordan.m"];
  174. SystemStub[ ThreeJSymbol, "ClebschGordan.m"];
  175. SystemStub[ SixJSymbol, "ClebschGordan.m"];
  176. SystemStub[ LinearProgramming, "LinearProgramming.m"];
  177. SystemStub[ PrimePi, "PrimePi.m"];
  178. SystemStub[ NSolve, "NSolve.m"];
  179. SystemStub[ GroebnerBasis, "GroebnerBasis.m"];
  180. SystemStub[ ComplexExpand, "ComplexExpand.m"];
  181. SystemStub[ TargetFunctions, "ComplexExpand.m"];
  182. SystemStub[ Sign, "ComplexExpand.m"];
  183.  
  184. (* End Thin system stuff *)
  185.  
  186.  
  187. (* NProtect functions READ this is LAST to prevent wrong symbols
  188.     being generated *)
  189. (*
  190.    <<NProt.m
  191. *)
  192.  
  193. (* this symbol will be evaluated when Mathematica ends *)
  194.    $Epilog := << end.m
  195.  
  196. (* restore previous context *)
  197.    End[]
  198.  
  199. (* standard return value for the Get which got this file *)
  200.    Null
  201.