メインページ   クラス階層   構成   ファイル一覧   構成メンバ   ファイルメンバ  

CollocWt.h

解説を見る。
00001 /*
00002 
00003 Copyright (C) 1996, 1997 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 2, or (at your option) any
00010 later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, write to the Free
00019 Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020 
00021 */
00022 
00023 #if !defined (octave_CollocWt_h)
00024 #define octave_CollocWt_h 1
00025 
00026 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00027 #pragma interface
00028 #endif
00029 
00030 #include <iostream>
00031 
00032 #include "dMatrix.h"
00033 #include "dColVector.h"
00034 
00035 class
00036 CollocWt
00037 {
00038 public:
00039 
00040   CollocWt (void)
00041     : n (0), inc_left (0), inc_right (0), lb (0.0), rb (1.0),
00042       Alpha (0.0), Beta (0.0), r (), q (), A (), B (), initialized (0) { }
00043 
00044   CollocWt (int nc, int il, int ir)
00045     : n (nc), inc_left (il), inc_right (ir), lb (0.0), rb (1.0),
00046       Alpha (0.0), Beta (0.0), r (), q (), A (), B (), initialized (0) { }
00047 
00048   CollocWt (int nc, int il, int ir, double l, double rr)
00049     : n (nc), inc_left (il), inc_right (ir), lb (l), rb (rr),
00050       Alpha (0.0), Beta (0.0), r (), q (), A (), B (), initialized (0) { }
00051 
00052   CollocWt (int nc, double a, double b, int il, int ir)
00053     : n (nc), inc_left (il), inc_right (ir), lb (0.0), rb (1.0),
00054       Alpha (a), Beta (b), initialized (0) { }
00055 
00056   CollocWt (int nc, double a, double b, int il, int ir,
00057                       double ll, double rr)  
00058     : n (nc), inc_left (il), inc_right (ir), lb (ll), rb (rr),
00059       Alpha (a), Beta (b), r (), q (), A (), B (), initialized (0) { }
00060 
00061   CollocWt (const CollocWt& a)
00062     : n (a.n), inc_left (a.inc_left), inc_right (a.inc_right),
00063       lb (a.lb), rb (a.rb), Alpha (a.Alpha), Beta (a.Beta),
00064       r (a.r), q (a.q), A (a.A), B (a.B),
00065       initialized (a.initialized) { } 
00066 
00067   CollocWt& operator = (const CollocWt& a)
00068     {
00069       if (this != &a)
00070         {
00071           n = a.n;
00072           inc_left = a.inc_left;
00073           inc_right = a.inc_right;
00074           lb = a.lb;
00075           rb = a.rb;
00076           r = a.r;
00077           q = a.q;
00078           A = a.A;
00079           B = a.B;
00080           initialized = a.initialized;
00081         }
00082       return *this;
00083     }
00084 
00085   ~CollocWt (void) { }
00086 
00087   CollocWt& resize (int nc)
00088     {
00089       n = nc;
00090       initialized = 0;
00091       return *this;
00092     }
00093 
00094   CollocWt& add_left (void)
00095     {
00096       inc_left = 1;
00097       initialized = 0;
00098       return *this;
00099     }
00100 
00101   CollocWt& delete_left (void)
00102     {
00103       inc_left = 0;
00104       initialized = 0;
00105       return *this;
00106     }
00107 
00108   CollocWt& set_left (double val);
00109 
00110   CollocWt& add_right (void)
00111     {
00112       inc_right = 1;
00113       initialized = 0;
00114       return *this;
00115     }
00116 
00117   CollocWt& delete_right (void)
00118     {
00119       inc_right = 0;
00120       initialized = 0;
00121       return *this;
00122     }
00123 
00124   CollocWt& set_right (double val);
00125 
00126   CollocWt& set_alpha (double val)
00127     {
00128       Alpha = val;
00129       initialized = 0;
00130       return *this;
00131     }
00132 
00133   CollocWt& set_beta (double val)
00134     {
00135       Beta = val;
00136       initialized = 0;
00137       return *this;
00138     }
00139 
00140   int ncol (void) const { return n; }
00141 
00142   int left_included (void) const { return inc_left; }
00143   int right_included (void) const { return inc_right; }
00144 
00145   double left (void) const { return lb; }
00146   double right (void) const { return rb; }
00147 
00148   double width (void) const { return rb - lb; }
00149 
00150   double alpha (void) const { return Alpha; }
00151   double beta (void) const { return Beta; }
00152 
00153   ColumnVector roots (void) { if (!initialized) init (); return r; }
00154   ColumnVector quad (void) { if (!initialized) init (); return q; }
00155 
00156   ColumnVector quad_weights (void) { return quad (); }
00157 
00158   Matrix first (void) { if (!initialized) init (); return A; }
00159 
00160   Matrix second (void) { if (!initialized) init (); return B; }
00161 
00162   friend std::ostream& operator << (std::ostream&, const CollocWt&);
00163 
00164 protected:
00165 
00166   int n;
00167 
00168   int inc_left;
00169   int inc_right;
00170 
00171   double lb;
00172   double rb;
00173 
00174   double Alpha;
00175   double Beta;
00176 
00177   ColumnVector r;
00178   ColumnVector q;
00179 
00180   Matrix A;
00181   Matrix B;
00182 
00183   int initialized;
00184 
00185   void init (void);
00186 
00187   void error (const char *msg);
00188 };
00189 
00190 #endif
00191 
00192 /*
00193 ;;; Local Variables: ***
00194 ;;; mode: C++ ***
00195 ;;; End: ***
00196 */

Wed Dec 29 11:51:05 2004に生成されました。 doxygen1.2.18
SEO [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送