Points&Forces (core)
Software tools facilitating the task of surveying architecture
a_mat_r.h
Go to the documentation of this file.
1 /*
2 Copyright 2010-2011 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_R_H_
17 #define _VE_MAT_R_H_
18 
19 // .NAME a_mat - a row 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_r : public a_mat
29 {
30 public:
31  a_mat_r(UI i, double v = 0) : a_mat(UI(1),i,v) {} //v : value
32  a_mat_r(int i, double v = 0) : a_mat(int(1),i,v) {}
33  a_mat_r& operator=(const a_mat& m);
34  inline double& operator()(const UI i) {return (*x_)[i];}
35  inline double operator()(const UI i) const {return (*x_)[i];}
36  double sumsq() const;
37  double norm() const;
38  void normalise();
39  void teller();
40 };
41 
42 a_mat_r cross(a_mat_r &, a_mat_r &); // cross product (works only with maxi_=3)
43 
44 #endif
unsigned int UI
Definition: a_mat.h:23
a_mat_r cross(a_mat_r &, a_mat_r &)
Definition: a_mat_r.cxx:52
a row matrix unit
Definition: a_mat_r.h:29
a_mat_r(UI i, double v=0)
Definition: a_mat_r.h:31
double norm() const
Definition: a_mat_r.cxx:40
double operator()(const UI i) const
Definition: a_mat_r.h:35
double & operator()(const UI i)
Definition: a_mat_r.h:34
double sumsq() const
Definition: a_mat_r.cxx:32
a_mat_r & operator=(const a_mat &m)
Definition: a_mat_r.cxx:24
a_mat_r(int i, double v=0)
Definition: a_mat_r.h:32
void teller()
void normalise()
Definition: a_mat_r.cxx:45
Definition: a_mat.h:42
std::valarray< double > * x_
Definition: a_mat.h:91