Points&Forces (core)
Software tools facilitating the task of surveying architecture
a_mat_sq.h
Go to the documentation of this file.
1 /*
2  Copyright 2010-2017 Pierre SMARS (smars@yuntech.edu.tw)
3  This program is free software: you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation, either version 2 of the License, or
6  (at your option) any later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 #ifndef _VE_MAT_SQ_H_
17 #define _VE_MAT_SQ_H_
18 
19 // .NAME a_mat - a square matrix unit
20 // .PORTABILITY : ansi C++
21 // .SECTION Author
22 // Pierre Smars
23 
24 #include <valarray>
25 #include "a_mat.h"
26 
28 class a_mat_sq : public a_mat
29 {
30  public:
31  a_mat_sq(UI i, double v = 0) : a_mat(i,i,v) {}; //v : value
32  a_mat_sq(int i, double v = 0) : a_mat(i,i,v) {};
33  a_mat_sq(const a_mat& m): a_mat(m) {};
34  double determinant() const;
35  double trace() const;
36  inline UI dim() const {return maxi_;}
37  void settoI();
38  a_mat_sq& operator=(const a_mat_sq& m);
39  a_mat_sq& operator=(const a_mat& m);
40  ~a_mat_sq();
41 
42  inline a_mat& operator*=(double v) {return a_mat::operator*=(v);}
43  a_mat_sq & operator*=(const a_mat_sq m);
44  protected:
45  void compatible(const a_mat& m) const;
46 };
47 
48 #endif
unsigned int UI
Definition: a_mat.h:23
a square matrix unit
Definition: a_mat_sq.h:29
double determinant() const
Definition: a_mat_sq.cxx:83
a_mat_sq(const a_mat &m)
Definition: a_mat_sq.h:33
a_mat_sq(int i, double v=0)
Definition: a_mat_sq.h:32
UI dim() const
Definition: a_mat_sq.h:36
void settoI()
Definition: a_mat_sq.cxx:41
~a_mat_sq()
Definition: a_mat_sq.cxx:22
a_mat_sq & operator=(const a_mat_sq &m)
Definition: a_mat_sq.cxx:33
double trace() const
Definition: a_mat_sq.cxx:75
a_mat_sq(UI i, double v=0)
Definition: a_mat_sq.h:31
void compatible(const a_mat &m) const
Definition: a_mat_sq.cxx:27
a_mat & operator*=(double v)
Definition: a_mat_sq.h:42
Definition: a_mat.h:42
a_mat & operator*=(double v)
Definition: a_mat.cxx:103
UI maxi_
Definition: a_mat.h:88