CPPLapack
 All Classes Files Functions Variables Friends Pages
dgematrix_small.hpp
Go to the documentation of this file.
1 //=============================================================================
2 //! Samll Real Double-precision General Dence Matrix Class
3 template<CPPL_INT m, CPPL_INT n> class dgematrix_small
4 {
5 public:
6  ///////////////////////////////////////////////
7  /////////////////// objects ///////////////////
8  ///////////////////////////////////////////////
9  double array[m*n]; //!< 1D array to store vector data
10 
11  ///////////////////////////////////////////////
12  ///////////////// constructors ////////////////
13  ///////////////////////////////////////////////
14  inline dgematrix_small();
15  inline explicit dgematrix_small(const dgematrix&);
16  inline ~dgematrix_small();
17 
18  ///////////////////////////////////////////////
19  ////////////////// functions //////////////////
20  ///////////////////////////////////////////////
21  //////// cast ////////
22  inline _dgematrix to_dgematrix() const;
23 
24  //////// io ////////
25  inline double& operator()(const CPPL_INT& i, const CPPL_INT& j);
26  inline double operator()(const CPPL_INT& i, const CPPL_INT& j) const;
27  inline dgematrix_small<m,n>& set(const CPPL_INT& i, const CPPL_INT& j, const double& v);
28  template<CPPL_INT _m, CPPL_INT _n> inline friend std::ostream& operator<<(std::ostream&, const dgematrix_small<_m,_n>&);
29  inline void read(const char* filename);
30  inline void write(const char* filename) const;
31 
32  //////// calc ////////
33 #ifndef _MSC_VER
34  template<CPPL_INT _m, CPPL_INT _n> inline friend dgematrix_small<n,m> t(const dgematrix_small<m,n>&);
35  template<CPPL_INT _m, CPPL_INT _n> inline friend void idamax(CPPL_INT&, CPPL_INT&, const dgematrix_small&);
36  template<CPPL_INT _m, CPPL_INT _n> inline friend double damax(const dgematrix_small&);
37 #endif//_MSC_VER
38 
39  //////// misc ////////
40  inline dgematrix_small<m,n>& zero();
42  inline dcovector_small<m> col(const CPPL_INT& j) const;
43  inline drovector_small<n> row(const CPPL_INT& i) const;
44 
45  ///////////////////////////////////////////////
46  ///////////// numerical operators /////////////
47  ///////////////////////////////////////////////
48 #ifndef _MSC_VER
49  //////// = ////////
50  template<CPPL_INT M, CPPL_INT N> inline dgematrix_small<M,N>& operator=(const dgematrix_small<M,N>&);
51  //////// += ////////
52  template<CPPL_INT M, CPPL_INT N> inline friend dgematrix_small<M,N>& operator+=(dgematrix_small<M,N>&, const dgematrix_small<M,N>&);
53  //////// -= ////////
54  template<CPPL_INT M, CPPL_INT N> inline friend dgematrix_small<M,N>& operator-=(dgematrix_small<M,N>&, const dgematrix_small<M,N>&);
55  //////// *= ////////
56  template<CPPL_INT M, CPPL_INT L, CPPL_INT N> inline friend dgematrix_small<M,N>& operator*=(dgematrix_small<M,L>&, const dgematrix_small<L,N>&);
57  template<CPPL_INT M, CPPL_INT N> inline friend dgematrix_small<M,N>& operator*=(dgematrix_small<M,N>&, const double&);
58  //////// /= ////////
59  template<CPPL_INT M, CPPL_INT N> inline friend dgematrix_small<M,N>& operator/=(dgematrix_small<M,N>&, const double&);
60  //////// unary ////////
61  template<CPPL_INT M, CPPL_INT N> inline friend const dgematrix_small<M,N>& operator+(const dgematrix_small<M,N>&);
62  template<CPPL_INT M, CPPL_INT N> inline friend dgematrix_small<M,N> operator-(const dgematrix_small<M,N>&);
63  //////// + ////////
64  template<CPPL_INT M, CPPL_INT N> inline friend dgematrix_small<M,N> operator+(const dgematrix_small<M,N>&, const dgematrix_small<M,N>&);
65  template<CPPL_INT M, CPPL_INT N> inline friend dgematrix_small<M,N> operator+(const dgematrix_small<M,N>&, const dsymatrix_small< N >&);
66  //////// - ////////
67  template<CPPL_INT M, CPPL_INT N> inline friend dgematrix_small<M,N> operator-(const dgematrix_small<M,N>&, const dgematrix_small<M,N>&);
68  template<CPPL_INT M, CPPL_INT N> inline friend dgematrix_small<M,N> operator-(const dgematrix_small<M,N>&, const dsymatrix_small< N >&);
69  //////// * ////////
70  template<CPPL_INT M, CPPL_INT N> inline friend dcovector_small< M > operator*(const dgematrix_small<M,N>&, const dcovector_small< N >&);
71  template<CPPL_INT M, CPPL_INT L, CPPL_INT N> inline friend dgematrix_small<M,N> operator*(const dgematrix_small<M,L>&, const dgematrix_small<L,N>&);
72  template<CPPL_INT M, CPPL_INT N> inline friend dgematrix_small<M,N> operator*(const dgematrix_small<M,N>&, const dsymatrix_small< N >&);
73  template<CPPL_INT M, CPPL_INT N> inline friend dgematrix_small<M,N> operator*(const dgematrix_small<M,N>&, const double&);
74  //////// / ////////
75  template<CPPL_INT M, CPPL_INT N> inline friend dgematrix_small<M,N> operator/(const dgematrix_small<M,N>&, const double&);
76  //////// double ////////
77  template<CPPL_INT M, CPPL_INT N> inline friend dgematrix_small<M,N> operator*(const double&, const dgematrix_small<M,N>&);
78  //////// hadamerd ////////
79  template<CPPL_INT M, CPPL_INT N> inline friend dgematrix_small<M,N> hadamerd(const dgematrix_small<M,N>&, const dgematrix_small<M,N>&);
80  template<CPPL_INT N> inline friend dgematrix_small<N,N> hadamerd(const dgematrix_small<N,N>&, const dsymatrix_small< N >&);
81 #endif//_MSC_VER
82 };
83 
84 ///////////////////////////////////////////////////////////////////////////////
85 ///////////////////////////////////////////////////////////////////////////////
86 ///////////////////////////////////////////////////////////////////////////////
87 
88 inline double det(const dgemat2&);
89 inline dgemat2 inv(const dgemat2&);
90 inline dgemat2 rotate(const dgemat2&, const double&);
91 inline dgemat2 t2m(const double&);
92 
93 inline double det(const dgemat3&);
94 inline dgemat3 inv(const dgemat3&);
95 inline dgemat3 rotate(const dgemat3&, const dquater&);
96 inline dquater m2q(const dgemat3&);
97 
98 inline double det(const dgemat4&);
99 inline dgemat4 inv(const dgemat4&);
void write(const char *filename) const
dgematrix_small< m, n > & identity()
dgemat2 rotate(const dgemat2 &, const double &)
dgematrix_small< m, n > & set(const CPPL_INT &i, const CPPL_INT &j, const double &v)
double & operator()(const CPPL_INT &i, const CPPL_INT &j)
Samll Real Double-precision Symmetric Matrix Class.
void read(const char *filename)
friend dgematrix_small< n, m > t(const dgematrix_small< m, n > &)
friend dcovector_small< M > operator*(const dgematrix_small< M, N > &, const dcovector_small< N > &)
Samll Real Double-precision General Dence Matrix Class.
friend dgematrix_small< M, N > & operator/=(dgematrix_small< M, N > &, const double &)
_dgematrix i(const _dgbmatrix &mat)
friend dgematrix_small< M, N > & operator+=(dgematrix_small< M, N > &, const dgematrix_small< M, N > &)
dgematrix_small< m, n > & zero()
friend dgematrix_small< M, N > & operator-=(dgematrix_small< M, N > &, const dgematrix_small< M, N > &)
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
Samll Real Double-precision Row Vector Class.
dgematrix_small< M, N > & operator=(const dgematrix_small< M, N > &)
dcovector_small< m > col(const CPPL_INT &j) const
(DO NOT USE) Smart-temporary Real Double-precision General Dence Matrix Class
Definition: _dgematrix.hpp:3
friend dgematrix_small< M, N > operator-(const dgematrix_small< M, N > &)
dgemat2 inv(const dgemat2 &)
friend void idamax(CPPL_INT &, CPPL_INT &, const dgematrix_small &)
friend dgematrix_small< M, N > hadamerd(const dgematrix_small< M, N > &, const dgematrix_small< M, N > &)
Samll Real Double-precision Column Vector Class.
double array[m *n]
1D array to store vector data
friend double damax(const dgematrix_small &)
drovector_small< n > row(const CPPL_INT &i) const
friend dgematrix_small< M, N > & operator*=(dgematrix_small< M, L > &, const dgematrix_small< L, N > &)
double det(const dgemat2 &)
dquater m2q(const dgemat3 &)
friend const dgematrix_small< M, N > & operator+(const dgematrix_small< M, N > &)
friend dgematrix_small< M, N > operator/(const dgematrix_small< M, N > &, const double &)
_dgematrix to_dgematrix() const
dgemat2 t2m(const double &)