tnt_cmat.h Source File
Main Page Namespace List Compound List File List Namespace Members Compound Members File Members
Copyright By PowCoder代写 加微信 powcoder
tnt_cmat.h
Go to the documentation of this file.00001 /*
00003 * Template Numerical Toolkit (TNT)
00005 * Mathematical and Computational Sciences Division
00006 * National Institute of Technology,
00007 * Gaithersburg, MD USA
00010 * This software was developed at the National Institute of Standards and
00011 * Technology (NIST) by employees of the Federal Government in the course
00012 * of their official duties. Pursuant to title 17 Section 105 of the
00013 * United States Code, this software is not subject to copyright protection
00014 * and is in the public domain. NIST assumes no responsibility whatsoever for
00015 * its use by other parties, and makes no guarantees, expressed or implied,
00016 * about its quality, reliability, or any other characteristic.
00022 #ifndef TNT_CMAT_H
00023 #define TNT_CMAT_H
00025 #include “tnt_subscript.h”
00026 #include “tnt_vec.h”
00027 #include
00028 #include
00029 #include
00030 #include
00032 namespace TNT
00043 template
00044 class Matrix
00048 public:
00050 typedef Subscript size_type;
00051 typedef T value_type;
00052 typedef T element_type;
00053 typedef T* pointer;
00054 typedef T* iterator;
00055 typedef T& reference;
00056 typedef const T* const_iterator;
00057 typedef const T& const_reference;
00059 Subscript lbound() const { return 1;}
00061 protected:
00062 Subscript m_;
00063 Subscript n_;
00064 Subscript mn_; // total size
00065 T* v_;
00066 T** row_;
00067 T* vm1_ ; // these point to the same data, but are 1-based
00068 T** rowm1_;
00070 public:
00072 operator T**(){ return row_; }
00073 operator T**() const { return row_; }
00076 Subscript size() const { return mn_; }
00078 // constructors
00080 Matrix();
00082 Matrix(const Matrix
00084 Matrix(Subscript M, Subscript N, const T& value = T());
00086 Matrix(Subscript M, Subscript N, const T* v);
00088 Matrix(Subscript M, Subscript N, const char *s);
00090 ~Matrix();
00093 Matrix
00097 Matrix
00099 Matrix
00102 Subscript dim(Subscript d) const ;
00103 Subscript num_rows() const { return m_; }
00104 Subscript num_cols() const { return n_; }
00109 inline T* operator[](Subscript i);
00111 inline const T* operator[](Subscript i) const;
00113 inline reference operator()(Subscript i);
00115 inline const_reference operator()(Subscript i) const;
00118 inline reference operator()(Subscript i, Subscript j);
00122 inline const_reference operator() (Subscript i, Subscript j) const;
00128 /* *************************** I/O ********************************/
00130 template
00131 std::ostream& operator<<(std::ostream &s, const Matrix
00133 template
00134 std::istream& operator>>(std::istream &s, Matrix
00136 // *******************[ basic matrix algorithms ]***************************
00139 template
00140 Matrix
00142 template
00143 Matrix
00145 template
00146 Matrix
00149 template
00150 Matrix
00154 template
00155 inline Matrix
00157 template
00158 inline Matrix
00160 template
00161 inline int matmult(Matrix
00164 template
00165 Vector
00167 template
00168 inline Vector
00170 } // namespace TNT
00172 #endif
00173 // CMAT_H
Generated at Thu Jun 26 17:26:14 2003 for Template Numerical Toolkit (TNT) by
1.2.5 written by Dimitri van Heesch,
© 1997-2001
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com