My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
matvec.h
Go to the documentation of this file.
1 /*
2  * matvec.h - matrix vector class definitions
3  *
4  * Copyright (C) 2004, 2005, 2006, 2007, 2009 Stefan Jahn <stefan@lkcc.org>
5  *
6  * This is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This software is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this package; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * $Id: matvec.h 1825 2011-03-11 20:42:14Z ela $
22  *
23  */
24 
25 #ifndef __MATVEC_H__
26 #define __MATVEC_H__
27 
28 class matrix;
29 
30 class matvec
31 {
32  public:
33  matvec ();
34  matvec (int, int, int);
35  matvec (const matvec &);
36  ~matvec ();
37  int getSize (void) { return size; }
38  int getCols (void) { return cols; }
39  int getRows (void) { return rows; }
40  void setName (const char *);
41  char * getName (void);
42  void set (vector, int, int);
43  void set (matrix, int);
44  vector get (int, int);
45  matrix get (int);
46  static char * createMatrixString (const char *, int, int);
47  static char * createMatrixString (char, int, int);
48  static char * isMatrixVector (char *, int&, int&);
49  static matvec * getMatrixVector (vector *, char *);
50  static void getMatrixVectorSize (vector *, char *, int&, int&, int&);
51 
52  // operator functions
58  friend matvec operator + (matvec, nr_double_t);
59  friend matvec operator + (nr_double_t, matvec);
67  friend matvec operator - (matvec, nr_double_t);
68  friend matvec operator - (nr_double_t, matvec);
72  friend matvec operator / (matvec, nr_double_t);
78  friend matvec operator * (matvec, nr_double_t);
79  friend matvec operator * (nr_double_t, matvec);
83 
84  // intrinsic operator functions
88 
89  // other operations
90  friend matvec transpose (matvec);
91  friend matvec conj (matvec);
92  friend vector det (matvec);
93  friend matvec inverse (matvec);
94  friend matvec pow (matvec, int);
95  friend matvec pow (matvec, vector);
96  friend matvec twoport (matvec, char, char);
97  friend matvec real (matvec);
98  friend matvec imag (matvec);
99  friend matvec abs (matvec);
100  friend matvec dB (matvec);
101  friend matvec arg (matvec);
102  friend matvec adjoint (matvec);
103  friend vector rollet (matvec);
104  friend vector b1 (matvec);
105 
106  friend matvec stos (matvec, nr_complex_t, nr_complex_t z0 = 50.0);
107  friend matvec stos (matvec, nr_double_t, nr_double_t z0 = 50.0);
108  friend matvec stos (matvec, vector, nr_complex_t z0 = 50.0);
109  friend matvec stos (matvec, nr_complex_t, vector);
110  friend matvec stos (matvec, vector, vector);
111  friend matvec stoz (matvec, nr_complex_t z0 = 50.0);
112  friend matvec stoz (matvec, vector);
113  friend matvec ztos (matvec, nr_complex_t z0 = 50.0);
114  friend matvec ztos (matvec, vector);
115  friend matvec ztoy (matvec);
116  friend matvec stoy (matvec, nr_complex_t z0 = 50.0);
117  friend matvec stoy (matvec, vector);
118  friend matvec ytos (matvec, nr_complex_t z0 = 50.0);
119  friend matvec ytos (matvec, vector);
120  friend matvec ytoz (matvec);
121 
122  private:
123  int size;
124  int rows;
125  int cols;
126  char * name;
127  matrix * data;
128 };
129 
130 #endif /* __MATVEC_H__ */