home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / g / bug / 2327 < prev    next >
Encoding:
Text File  |  1993-01-25  |  14.2 KB  |  1,216 lines

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!solace.me.uiuc.edu!tiller
  2. From: tiller@solace.me.uiuc.edu (Mike Tiller)
  3. Newsgroups: gnu.g++.bug
  4. Subject: Bug
  5. Date: 25 Jan 1993 20:47:36 -0500
  6. Organization: GNUs Not Usenet
  7. Lines: 1203
  8. Sender: daemon@cis.ohio-state.edu
  9. Approved: bug-g++@prep.ai.mit.edu
  10. Distribution: gnu
  11. Message-ID: <9301242343.AA16187@solace.me.uiuc.edu>
  12.  
  13. This dumps core on a sparc-sunos-4.1
  14.  
  15. # 1 "Element.c"
  16. # 1 "Element.h" 1
  17.  
  18.  
  19.  
  20. # 1 "/wren7/tiller/Include/Gen/Array.h" 1
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. # 1 "/usr/local/gnu/lib/g++-include/stdio.h" 1 3
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52. #pragma interface
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. # 1 "/usr/local/gnu/lib/g++-include/_G_config.h" 1 3
  65.   
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. typedef long _G_clock_t;
  73. typedef short _G_dev_t;
  74. typedef long   _G_fpos_t;
  75. typedef unsigned short _G_gid_t;
  76. typedef unsigned long _G_ino_t;
  77. typedef unsigned short _G_mode_t;
  78. typedef short _G_nlink_t;
  79. typedef long _G_off_t;
  80. typedef int _G_pid_t;
  81. typedef int _G_ptrdiff_t;
  82. typedef int _G_sigset_t;
  83. typedef int _G_size_t;
  84. typedef long _G_time_t;
  85. typedef unsigned short _G_uid_t;
  86. typedef unsigned short _G_wchar_t;
  87. typedef int   _G_ssize_t;
  88. typedef char*   _G_va_list;
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110. # 33 "/usr/local/gnu/lib/g++-include/stdio.h" 2 3
  111.  
  112.  
  113. extern "C" {
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147. # 1 "/usr/local/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/include/stdio.h" 1 3
  148.  
  149.  
  150.  
  151.  
  152.  
  153. extern    struct    _iobuf {
  154.     int    _cnt;
  155.     unsigned char *_ptr;
  156.     unsigned char *_base;
  157.     int    _bufsiz;
  158.     short    _flag;
  159.     char    _file;         
  160. } _iob[];
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201. extern struct _iobuf     *__hide_fopen ();
  202. extern struct _iobuf     *__hide_fdopen ();
  203. extern struct _iobuf     *__hide_freopen ();
  204. extern struct _iobuf     *__hide_popen ();
  205. extern struct _iobuf     *tmpfile();
  206. extern long    __hide_ftell ();
  207. extern char    *fgets();
  208. extern char    *gets();
  209. extern char    *__hide_sprintf ();
  210. extern char    *ctermid();
  211. extern char    *cuserid();
  212. extern char    *__hide_tempnam ();
  213. extern char    *tmpnam();
  214.  
  215.  
  216. extern    int    __hide_printf (char *, ...);
  217. extern    int    __hide_fprintf (struct _iobuf  *, char *, ...);
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224. # 69 "/usr/local/gnu/lib/g++-include/stdio.h" 2 3
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264. }
  265.  
  266. extern "C" {
  267.  
  268. int    fclose(struct _iobuf *);
  269. struct _iobuf *  fdopen(int, const char*);
  270. int    fflush(struct _iobuf *);
  271. int    fgetc(struct _iobuf *);
  272. char*  fgets(char*, int, struct _iobuf  *);
  273. struct _iobuf *  fopen(const char*, const char*);
  274. int    fprintf(struct _iobuf *, const char* ...);
  275. int    fputc(int, struct _iobuf *);
  276. int    fputs(const char*, struct _iobuf *);
  277. _G_size_t  fread(void*, _G_size_t , _G_size_t , struct _iobuf *);
  278.  
  279.  
  280.  
  281. struct _iobuf *  freopen(const char*, const char*, struct _iobuf *);
  282.  
  283. int    fscanf(struct _iobuf *, const char* ...);
  284. int    fseek(struct _iobuf *, long, int);
  285. long   ftell(struct _iobuf  *);
  286. _G_size_t  fwrite(const void*, _G_size_t , _G_size_t , struct _iobuf *);
  287. char*  gets(char*);
  288. int    getw(struct _iobuf *);
  289. int    pclose(struct _iobuf *);
  290. void   perror(const char*);
  291. struct _iobuf *  popen(const char*, const char*);
  292. int    printf(const char* ...);
  293. int    puts(const char*);
  294. int    putw(int, struct _iobuf *);
  295. int    rewind(struct _iobuf *);
  296. int    scanf(const char* ...);
  297. void   setbuf(struct _iobuf *, char*);
  298. void   setbuffer(struct _iobuf *, char*, int);
  299. int    setlinebuf(struct _iobuf *);
  300. int    setvbuf(struct _iobuf *, char*, int, _G_size_t );
  301. int    sscanf(char*, const char* ...);
  302. struct _iobuf *  tmpfile();
  303. int    ungetc(int, struct _iobuf *);
  304. int    vfprintf (...) ;
  305. int    vprintf (...) ;
  306. char*  sprintf (...) ;
  307. char*  vsprintf (...) ;
  308.  
  309. extern int _filbuf (...) ;
  310. extern int _flsbuf (...) ;
  311.  
  312. }
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331. # 11 "/wren7/tiller/Include/Gen/Array.h" 2
  332.  
  333.  
  334.  
  335. template <class T>
  336. class    Array
  337. {
  338.     protected:
  339.         T    *array;
  340.         int    size;
  341.         T    Default;
  342.  
  343.     public:
  344.         void    SetSize(int s)
  345.         {
  346.             T    *temp;
  347.             int    i;
  348.  
  349.             if (array == 0 )
  350.             {
  351.                 array = new T[s];
  352.                 for(i=0;i<s;i++)
  353.                     array[i] = Default;
  354.             }
  355.             else
  356.             {
  357.                 temp = array;
  358.                 array = new T[s];
  359.                 for(i=0;i<s;i++)
  360.                     if (i<size)
  361.                         array[i] = temp[i];
  362.                     else
  363.                         array[i] = Default;
  364.  
  365.                 delete [] temp;
  366.             }
  367.             size = s;
  368.         }
  369.         Array()
  370.         {
  371.             size = 0;
  372.             array = 0 ;
  373.         }
  374.         Array(T *init, int n)
  375.         {
  376.             int    i;
  377.             size = 0;
  378.             for(i=1;i<=n;i++)
  379.                 operator+=(init[i-1]);
  380.         }
  381.         Array(const T& a)
  382.         {
  383.             size = 0;
  384.             array = 0 ;
  385.             operator+=(a);
  386.         }
  387.         Array(const T& a, const T& b)
  388.         {
  389.             size = 0;
  390.             array = 0 ;
  391.             operator+=(a);
  392.             operator+=(b);
  393.         }
  394.         Array(const T& a, const T& b, const T& c)
  395.         {
  396.             size = 0;
  397.             array = 0 ;
  398.             operator+=(a);
  399.             operator+=(b);
  400.             operator+=(c);
  401.         }
  402.         inline void SetDef(const T& def) { Default = def; }
  403.         Array(const Array &a)
  404.         {
  405.             int    i;
  406.  
  407.             size = a.size;
  408.             array = new T[size];
  409.             for(i=0;i<size;i++)
  410.                 array[i] = a.array[i];
  411.             Default = a.Default;
  412.         }
  413.         void operator=(const Array &a)
  414.         {
  415.             int    i;
  416.  
  417.             size = a.size;
  418.             array = new T[size];
  419.             for(i=0;i<size;i++)
  420.                 array[i] = a.array[i];
  421.             Default = a.Default;
  422.         }
  423.         int    OutOfRange(int i)
  424.         {
  425.             if (i-1 >= size || i-1 < 0)
  426.                 return(1);
  427.             else
  428.                 return(0);
  429.         }
  430.         inline int Size() const { return(size); }
  431.         inline T& Elem(int i) {
  432.             if (i-1 >= size)
  433.                 SetSize(i);
  434.             return(array[i-1]);
  435.         }
  436.         inline const T& ConstElem(int i) const {
  437.             if (i-1 >= size)
  438.                 return(Default);
  439.             return(array[i-1]);
  440.         }
  441.         inline T GetCopy(int i) const
  442.         {
  443.             if (i-1 >= size)
  444.                 return(Default);
  445.             return(array[i-1]);
  446.         }
  447.         inline void Append(const T& a)
  448.         {
  449.             SetSize(size+1);
  450.             array[size-1] = a;
  451.         }
  452.         inline T Last()
  453.         {
  454.             return(array[size-1]);
  455.         }
  456.         inline T Remove(int n)
  457.         {
  458.             T    ret = Default;
  459.             if (n>size || n<1)
  460.                 return(ret);
  461.             else
  462.             {
  463.                 T    *temp;
  464.                 int    i, j;
  465.  
  466.                 temp = array;
  467.                 array = new T[size-1];
  468.                 for(i=0,j=0;i<size;i++)
  469.                 {
  470.                     if (i==n-1)
  471.                     {
  472.                         ret = temp[i];
  473.                     }
  474.                     else
  475.                     {
  476.                         array[j] = temp[i];
  477.                         j++;
  478.                     }
  479.                 }
  480.                 delete [] temp;
  481.                 size--;
  482.             }
  483.  
  484.             return(ret);
  485.         }
  486.         inline void Append(T *a)
  487.         {
  488.             SetSize(size+1);
  489.             array[size-1] = *a;
  490.         }
  491.  
  492.         inline const T& operator()(int i) const { return(ConstElem(i)); }
  493.         inline T& operator[](int i) { return(Elem(i)); }
  494.  
  495.         inline void operator+=(const T& a)
  496.         {
  497.             SetSize(size+1);
  498.             array[size-1] = a;
  499.         }
  500.         inline T *operator+=(T *a)
  501.         {
  502.             SetSize(size+1);
  503.             array[size-1] = *a;
  504.             return(a);
  505.         }
  506.         inline    void    Empty()
  507.         {
  508.             delete [] array;
  509.             array = new T[1];
  510.             size = 0;
  511.         }
  512.         inline    void    Clear()
  513.         {
  514.  
  515.             delete [] array;
  516.         }
  517.         virtual ~Array()
  518.         {
  519.             Clear();
  520.         }
  521. };
  522.  
  523.  
  524. # 4 "Element.h" 2
  525.  
  526. # 1 "/wren7/tiller/Include/Gen/AArray.h" 1
  527.  
  528.  
  529.  
  530.  
  531.  
  532. # 1 "/wren7/tiller/Include/Gen/Array.h" 1
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539. # 202 "/wren7/tiller/Include/Gen/Array.h"
  540.  
  541. # 6 "/wren7/tiller/Include/Gen/AArray.h" 2
  542.  
  543.  
  544. template    <class K, class V>
  545. class AArray
  546. {
  547.     private:
  548.         Array<K>    key;
  549.         Array<V>    value;
  550.     public:
  551.         AArray() { }
  552.         AArray(const AArray &a)
  553.         {
  554.             key = a.key;
  555.             value = a.value;
  556.         }
  557.         AArray operator=(const AArray &a)
  558.         {
  559.             key = a.key;
  560.             value = a.value;
  561.             return(a);
  562.         }
  563.         V& operator[](K index)
  564.         {
  565.             int    i;
  566.  
  567.             for(i=1;i<=key.Size();i++)
  568.             {
  569.                 if (key[i]==index)
  570.                     return(value[i]);
  571.             }
  572.             key+=index;
  573.             value.SetSize(key.Size());
  574.             return(value[key.Size()]);
  575.         }
  576.         int Get(int p, K& k,V& v)
  577.         {
  578.             if (p>=1 && p<=key.Size())
  579.             {
  580.                 k = key(p);
  581.                 v = value(p);
  582.                 return 1;
  583.             }
  584.             return 0;
  585.         }
  586.         void Empty() { key.Empty(); value.Empty(); }
  587.         int    Size() { return(key.Size()); }
  588.         void SetDef(V a) { value.SetDef(a); }
  589.         Array<K> Key() { return(key); }
  590. };
  591.  
  592.  
  593. # 5 "Element.h" 2
  594.  
  595. # 1 "/wren7/tiller/Include/Scalar.h" 1
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602. # 1 "/usr/local/gnu/lib/g++-include/math.h" 1 3
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624. #pragma interface
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636. # 64 "/usr/local/gnu/lib/g++-include/math.h" 3
  637.  
  638. extern "C" {
  639.  
  640. double  acos(double);
  641. double  acosh(double);
  642. double  asin(double);
  643. double  asinh(double);
  644. double  atan(double);
  645. double  atan2(double, double);
  646. double  atanh(double);
  647. double  cbrt(double);
  648. double  ceil(double);
  649. double  copysign(double,double);
  650. double  cos(double);
  651. double  cosh(double);
  652. double  drem(double,double);
  653. double  erf(double);
  654. double  erfc(double);
  655. double  exp(double);
  656. double  expm1(double);
  657. double  fabs(double);
  658. double  finite(double);
  659. double  floor(double);
  660. double    fmod(double, double);
  661. double  frexp(double, int*);
  662. double  gamma(double);
  663. double  hypot(double,double);
  664. double  infnan(int);
  665.  
  666.  
  667. int     isinf(double);
  668. int     isnan(double);
  669.  
  670. double  j0(double);
  671. double  j1(double);
  672. double  jn(int, double);
  673. double  ldexp(double, int);
  674. double  lgamma(double);
  675. double  log(double);
  676. double  log10(double);
  677. double  log1p(double);
  678. double  logb(double);
  679. double  modf(double, double*);
  680. double  pow(double, double);
  681. double  rint(double);
  682. double  scalb(double, int);
  683. double  sin(double);
  684. double  sinh(double);
  685. double  sqrt(double);
  686. double  tan(double);
  687. double  tanh(double);
  688. double  y0(double);
  689. double  y1(double);
  690. double  yn(int, double);
  691. double    exp10(double);
  692. void    sincos(double,double*,double*);
  693.  
  694. double aint(double);
  695. double anint(double);
  696. int irint(double);
  697. int nint(double);
  698. }
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707. struct libm_exception
  708. {
  709.   int type;
  710.   char* name;
  711.   double arg1, arg2, retval;
  712. };
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721. extern "C" int matherr(libm_exception*);
  722.  
  723.  
  724.  
  725. # 1 "/usr/local/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/include/float.h" 1 3
  726.  
  727.  
  728.  
  729.  
  730.  
  731.     
  732.  
  733.  
  734.     
  735.  
  736.  
  737.     
  738.  
  739.  
  740.     
  741.  
  742.  
  743.     
  744.  
  745.  
  746.     
  747.  
  748.  
  749.     
  750.  
  751.  
  752.     
  753.  
  754.  
  755.     
  756.  
  757.  
  758.     
  759.  
  760.  
  761.     
  762.  
  763.  
  764.  
  765.     
  766.  
  767.  
  768.     
  769.  
  770.  
  771.     
  772.  
  773.  
  774.     
  775.  
  776.  
  777.     
  778.  
  779.  
  780.     
  781.  
  782.  
  783.     
  784.  
  785.  
  786.     
  787.  
  788.  
  789.     
  790.  
  791.  
  792.  
  793.     
  794.  
  795.  
  796.     
  797.  
  798.  
  799.     
  800.  
  801.  
  802.  
  803. union __convert_long_double {
  804.   int __convert_long_double_i[4];
  805.   long double __convert_long_double_d;
  806. };
  807.  
  808.  
  809.     
  810.  
  811.  
  812.     
  813.  
  814.  
  815.     
  816.  
  817.  
  818.     
  819.  
  820.  
  821.     
  822.  
  823.  
  824.     
  825.  
  826.  
  827.  
  828.  
  829. # 152 "/usr/local/gnu/lib/g++-include/math.h" 2 3
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900. # 7 "/wren7/tiller/Include/Scalar.h" 2
  901.  
  902.  
  903.  
  904.  
  905. # 1 "/wren7/tiller/Include/Gen/Array.h" 1
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912. # 202 "/wren7/tiller/Include/Gen/Array.h"
  913.  
  914. # 11 "/wren7/tiller/Include/Scalar.h" 2
  915.  
  916.  
  917. # 1 "/wren7/tiller/Include/adExpr.h" 1
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924. # 1 "/wren7/tiller/Include/GC.h" 1
  925.  
  926.  
  927. extern    "C" {
  928. # 1 "/usr/local/gnu/lib/g++-include/stdio.h" 1 3
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947. # 174 "/usr/local/gnu/lib/g++-include/stdio.h" 3
  948.  
  949. # 4 "/wren7/tiller/Include/GC.h" 2
  950.  
  951. };
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958. class    GC
  959. {
  960.     private:
  961.         class    GC    *GC_next;
  962.         class    GC    *GC_prev;
  963.         static    class    GC    *head;
  964.         static    class    GC    *tail;
  965.  
  966.     protected:
  967.         int    ref_count;
  968.  
  969.     public:
  970.         static    int        GC_size;
  971.         GC();
  972.         inline    void    Ref() { ref_count++; }
  973.         inline    void    UnRef() { ref_count--; }
  974.         inline    int        AmountOfGarbage() { return(GC_size); }
  975.         static    void    Clean();
  976.         static    void    Print();     
  977.         GC        *RemoveMe();
  978.         ~GC();
  979. };
  980.  
  981.  
  982. # 7 "/wren7/tiller/Include/adExpr.h" 2
  983.  
  984.  
  985. class    adExpression : public GC
  986. {
  987.     private:
  988.     public:
  989.         adExpression() { }
  990.         virtual    ~adExpression() { }
  991.         virtual double    Value() = 0;
  992.         virtual    double    D(const class Scalar&) = 0;
  993.         virtual void    Print() = 0;
  994. };
  995.  
  996. class    adConstExpr : public adExpression
  997. {
  998.     private:
  999.         double    v;
  1000.     public:
  1001.         adConstExpr(double);
  1002.         double    Value();
  1003.         double    D(const class Scalar&);
  1004.         void Print() { printf(" <([%d] Const %g)> ", ref_count, v); }
  1005. };
  1006.  
  1007. class    adBinExpr : public adExpression
  1008. {
  1009.     protected:
  1010.         adExpression    *e1, *e2;
  1011.     public:
  1012.         adBinExpr(const Scalar&, const Scalar&);
  1013.         void Print()
  1014.         {
  1015.             printf(" <([%d] Bin ", ref_count);
  1016.             e1->Print();
  1017.             e2->Print();
  1018.             printf(")> ");
  1019.         }
  1020.         ~adBinExpr();
  1021. };
  1022.  
  1023. class    adAddExpr : public adBinExpr
  1024. {
  1025.     public:
  1026.         adAddExpr(const Scalar&, const Scalar&);
  1027.         double    Value();
  1028.         double    D(const class Scalar&);
  1029. };
  1030.  
  1031. class    adMultExpr : public adBinExpr
  1032. {
  1033.     public:
  1034.         adMultExpr(const Scalar&, const Scalar&);
  1035.         double    Value();
  1036.         double    D(const class Scalar&);
  1037. };
  1038.  
  1039. class    adSubExpr : public adBinExpr
  1040. {
  1041.     public:
  1042.         adSubExpr(const Scalar&, const Scalar&);
  1043.         double    Value();
  1044.         double    D(const class Scalar&);
  1045. };
  1046.  
  1047. class    adDivExpr : public adBinExpr
  1048. {
  1049.     public:
  1050.         adDivExpr(const Scalar&, const Scalar&);
  1051.         double    Value();
  1052.         double    D(const class Scalar&);
  1053. };
  1054.  
  1055. class    adPowExpr : public adExpression
  1056. {
  1057.     protected:
  1058.         adExpression    *b;
  1059.         double    exp;
  1060.     public:
  1061.         adPowExpr(const Scalar&, double);
  1062.         double    Value();
  1063.         double    D(const class Scalar&);
  1064.         void Print()
  1065.         {
  1066.             printf(" <([%d] Pow ", ref_count);
  1067.             b->Print();
  1068.             printf(" %g)> ", exp);
  1069.         }
  1070.         ~adPowExpr();
  1071. };
  1072.  
  1073. class    adExtExpr : public adExpression
  1074. {
  1075.     typedef    double    (*DF)(const Scalar &, const Scalar &);
  1076.     protected:
  1077.         adExpression *b;
  1078.         DF        df;
  1079.     public:
  1080.         adExtExpr(const Scalar&, DF);
  1081.         double    Value() { return(b->Value()); }
  1082.         double    D(const Scalar &e);
  1083.         void Print()
  1084.         {
  1085.             printf(" <([%d] External )> ", ref_count);
  1086.         }
  1087. };
  1088.  
  1089.  
  1090. Scalar operator+(double, const Scalar&);
  1091. Scalar operator+(const Scalar&, double);
  1092. Scalar operator+(const Scalar&, const Scalar&);
  1093.  
  1094.  
  1095. Scalar operator-(double, const Scalar&);
  1096. Scalar operator-(const Scalar&, double);
  1097. Scalar operator-(const Scalar&, const Scalar&);
  1098.  
  1099.  
  1100. Scalar operator*(double, const Scalar&);
  1101. Scalar operator*(const Scalar&, double);
  1102. Scalar operator*(const Scalar&, const Scalar&);
  1103.  
  1104.  
  1105. Scalar operator/(double, const Scalar&);
  1106. Scalar operator/(const Scalar&, double);
  1107. Scalar operator/(const Scalar&, const Scalar&);
  1108.  
  1109.  
  1110. Scalar    pow(const Scalar&, double);
  1111.  
  1112.  
  1113. # 13 "/wren7/tiller/Include/Scalar.h" 2
  1114.  
  1115.  
  1116. class    Scalar
  1117. {
  1118.     private:
  1119.         adExpression    *p;
  1120.  
  1121.     public:
  1122.         Scalar();
  1123.         Scalar(double);
  1124.         Scalar(adExpression *);
  1125.         Scalar(const Scalar &);
  1126.         inline    double Value() const
  1127.         {
  1128.             return(p->Value());
  1129.         }
  1130.         inline    double    D(const Scalar& e) const
  1131.         {
  1132.             return(p->D(e));
  1133.         }
  1134.         void    Print()
  1135.         {
  1136.             p->Print();
  1137.             printf("\n");
  1138.         }
  1139.         void operator=(double);
  1140.         ~Scalar();
  1141.         inline    operator adExpression*() const { return(p); }
  1142.         inline    operator double() const { return(p->Value()); }
  1143.  
  1144.         int    operator==(const Scalar &e) { return(e.p==p); }
  1145.         void operator+=(const Scalar&);
  1146.         void operator-=(const Scalar&);
  1147.         void operator*=(const Scalar&);
  1148.         void operator/=(const Scalar&);
  1149.  
  1150.         static    Scalar Default();
  1151.         static    Scalar Invalid();
  1152.  
  1153.         friend    void    operator=(Scalar &, const Scalar &);
  1154.         friend    adExpression;
  1155.         friend    adConstExpr;
  1156.         friend    adAddExpr;
  1157.         friend    adMultExpr;
  1158. };
  1159.  
  1160. inline    void    operator=(Scalar &e, const Scalar &s)
  1161. {
  1162.     e.p->UnRef();
  1163.     e.p = s.p;
  1164.     e.p->Ref();
  1165. }
  1166.  
  1167. class    ScVector : public Array<Scalar>
  1168. {
  1169.     public:
  1170.         ScVector() : Array<Scalar>() { }
  1171.         ScVector(double *v, int n)
  1172.         {
  1173.             int    i;
  1174.             
  1175.             for(i=0;i<n;i++)
  1176.                 Append(Scalar(v[i]));
  1177.         }
  1178.         int    Offset(Scalar& e)
  1179.         {
  1180.             int    i;
  1181.  
  1182.             for(i=0;i<size;i++)
  1183.                 if (array[i]==e)
  1184.                     return(i+1);
  1185.             return(-1);
  1186.         }
  1187. };
  1188.  
  1189. # 114 "/wren7/tiller/Include/Scalar.h"
  1190.  
  1191.  
  1192.  
  1193. # 6 "Element.h" 2
  1194.  
  1195.  
  1196. typedef    AArray<int,Scalar>    LocVec;
  1197. typedef    AArray<int,LocVec>    LocMat;
  1198.  
  1199. class Element
  1200. {
  1201.     public:
  1202.         virtual    void Stiff(LocMat&) = 0;
  1203.         virtual    void Force(LocVec&) = 0;
  1204. };
  1205.  
  1206.  
  1207. # 1 "Element.c" 2
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.