MatrixBase.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
44 #ifndef GNSSTK_MATRIX_BASE_HPP
45 #define GNSSTK_MATRIX_BASE_HPP
46 
47 #include "Vector.hpp"
48 
49 namespace gnsstk
50 {
52 
53 
55  NEW_EXCEPTION_CLASS(MatrixException, Exception);
56 
58  NEW_EXCEPTION_CLASS(SingularMatrixException, MatrixException);
59 
64  template <class T, class BaseClass>
66  {
67  public:
69  explicit ConstMatrixBase() {}
70 
71  virtual ~ConstMatrixBase()
72  {}
73 
75  size_t size() const
76  { return static_cast<const BaseClass*>(this)->size(); }
78  size_t cols() const
79  { return static_cast<const BaseClass*>(this)->cols(); }
81  size_t rows() const
82  { return static_cast<const BaseClass*>(this)->rows(); }
85  T operator() (size_t i, size_t j) const
86  { return constMatrixRef(i, j); }
87 
89  inline bool isSquare() const
90  { return ((rows() == cols()) && (rows() != 0)); }
92  inline bool isUT() const
93  {
94  if (!isSquare())
95  return false;
96  size_t i, j;
97  for (i = 1; i < rows(); i++)
98  for (j = 0; j < i; j++)
99  if ((*this)(i,j) != T(0))
100  return false;
101  return true;
102  }
104  inline bool isLT() const
105  {
106  if (!isSquare())
107  return false;
108  size_t i, j;
109  for (i = 0; i < rows(); i++)
110  for (j = i+1; j < cols(); j++)
111  if ((*this)(i,j) != T(0))
112  return false;
113  return true;
114  }
115 
117  inline bool isDiagonal() const
118  {
119  if (!isSquare())
120  return false;
121  size_t i, j;
122  for (i = 0; i < rows(); i++)
123  for (j = 0; j < cols(); j++)
124  if (i != j)
125  if ((*this)(i,j) != T(0))
126  return false;
127  return true;
128  }
131  inline bool isSymmetric() const
132  {
133  if (!isSquare())
134  return false;
135  size_t i,j;
136  for (i = 0; i < rows(); i++)
137  for (j = i + 1; j < cols(); j++)
138  if ((*this)(i,j) != (*this)(j,i))
139  return false;
140  return true;
141  }
142 
146  Vector<T> colCopy(size_t c, size_t r = 0) const
147  {
148 #ifdef RANGECHECK
149  if ((c >= cols()) || (r >= rows()))
150  {
151  MatrixException e("Invalid ConstMatrixBase index for colCopy");
152  GNSSTK_THROW(e);
153  }
154 #endif
155  Vector<T> toReturn(rows() - r);
156  size_t i;
157  for (i = r; i < rows(); i++)
158  toReturn(i - r) = (*this)(i, c);
159  return toReturn;
160  }
161 
165  Vector<T> rowCopy(size_t r, size_t c = 0) const
166  {
167 #ifdef RANGECHECK
168  if ((c >= cols()) || (r >= rows()))
169  {
170  MatrixException e("Invalid ConstMatrixBase index for rowCopy");
171  GNSSTK_THROW(e);
172  }
173 #endif
174  Vector<T> toReturn(cols() - c);
175  size_t i;
176  for (i = c; i < cols(); i++)
177  toReturn(i - c) = (*this)(r, i);
178  return toReturn;
179  }
180 
184  Vector<T> diagCopy(void) const
185  {
186  size_t i, n(cols());
187  if(rows() < n) n = rows();
188  Vector<T> toReturn(n);
189  for(i=0; i<n; i++)
190  toReturn(i) = (*this)(i,i);
191  return toReturn;
192  }
193 
194  protected:
198  inline T constMatrixRef(size_t i, size_t j) const
199  {
200  const BaseClass& b = static_cast<const BaseClass&>(*this);
201 #ifdef RANGECHECK
202  if ((i >= b.rows()) || (j > b.cols()))
203  {
204  MatrixException e("Invalid ConstMatrixBase index for ref");
205  GNSSTK_THROW(e);
206  }
207 #endif
208  return b(i,j);
209  }
210  };
211 
216  template <class T, class BaseClass>
217  class RefMatrixBase : public ConstMatrixBase<T, BaseClass>
218  {
219  public:
221  explicit RefMatrixBase() {}
222 
223  virtual ~RefMatrixBase()
224  {}
225 
227  T& operator() (size_t i, size_t j)
228  { return static_cast<BaseClass*>(this)->operator()(i,j); }
229 
231  size_t size() const
232  { return static_cast<const BaseClass*>(this)->size(); }
234  size_t cols() const
235  { return static_cast<const BaseClass*>(this)->cols(); }
237  size_t rows() const
238  { return static_cast<const BaseClass*>(this)->rows(); }
241  BaseClass& zeroize()
242  {
243  BaseClass& me = static_cast<BaseClass&>(*this);
244  size_t i, j;
245  for (i=0; i < me.rows(); i++)
246  for (j=0; j < me.cols(); j++)
248  me(i,j) = T(0);
249  return me;
250  }
253  BaseClass& zeroizeRow(size_t r)
254  {
255  BaseClass& me = static_cast<BaseClass&>(*this);
256  size_t j;
257  for (j=0; j < me.cols(); j++)
258  if (ABS(me(r, j)) < RefVectorBaseHelper::zeroTolerance)
259  me(r, j) = T(0);
260  return me;
261  }
264  BaseClass& zeroizeCol(size_t c)
265  {
266  BaseClass& me = static_cast<BaseClass&>(*this);
267  size_t i;
268  for (i=0; i < me.rows(); i++)
270  me(i,c) = T(0);
271  return me;
272  }
273 
274 
275 
278  //MatBaseNewAssignOperator(assignFrom, =);
279  //MatBaseNewAssignOperator(operator+=, +=);
280  //MatBaseNewAssignOperator(operator-=, -=);
281 
282  // MatBaseNewAssignOperator(assignFrom, =);
283 
288  template <class E> BaseClass& assignFrom(const ConstMatrixBase<T, E>& x)
289  {
290  //MatBaseArrayAssignMacro(=);
291  BaseClass& me = static_cast<BaseClass&>(*this);
292 #ifdef RANGECHECK
293  if(x.rows() != me.rows() || x.cols() != me.cols()) {
294  MatrixException e("Invalid dimensions for Matrix assignFrom(Matrix)");
295  GNSSTK_THROW(e);
296  }
297 #endif
298  size_t i,j;
299  for (i=0; i < me.rows(); i++)
300  for (j=0; j < me.cols(); j++)
301  me(i,j) = x(i,j);
302  return me;
303  }
308  template <class E> BaseClass& assignFrom(const ConstVectorBase<T, E>& x)
309  {
310  //MatBaseArrayAssignMacroVecSource(=);
311  BaseClass& me = static_cast<BaseClass&>(*this);
312 #ifdef RANGECHECK
313  if(x.size() != me.rows() * me.cols()) {
314  MatrixException e("Invalid dimensions for Matrix assignFrom(Vector)");
315  GNSSTK_THROW(e);
316  }
317 #endif
318  size_t i,j;
319  for (i=0; i < me.rows(); i++)
320  for (j=0; j < me.cols(); j++)
321  me(i,j) = x[i*me.cols()+j];
322  return me;
323  }
328  BaseClass& assignFrom(const std::valarray<T>& x)
329  {
330  //MatBaseArrayAssignMacroVecSource(=);
331  BaseClass& me = static_cast<BaseClass&>(*this);
332 #ifdef RANGECHECK
333  if(x.size() != me.rows() * me.cols()) {
334  MatrixException e("Invalid dimensions for Matrix assignFrom(valarray)");
335  GNSSTK_THROW(e);
336  }
337 #endif
338  size_t i,j;
339  for (i=0; i < me.rows(); i++)
340  for (j=0; j < me.cols(); j++)
341  me(i,j) = x[i*me.cols()+j];
342  return me;
343  }
346  BaseClass& assignFrom(const T* x)
347  {
348  //MatBaseArrayAssignMacroVecSource(=);
349  BaseClass& me = static_cast<BaseClass&>(*this);
350  size_t i,j;
351  for (i=0; i < me.rows(); i++)
352  for (j=0; j < me.cols(); j++)
353  me(i,j) = x[i*me.cols()+j]; // no way to RANGECHECK on x[..]!
354  return me;
355  }
357  BaseClass& assignFrom(T x)
358  {
359  //MatBaseAtomicAssignMacro(=);
360  BaseClass& me = static_cast<BaseClass&>(*this);
361  size_t i,j;
362  for (i=0; i < me.rows(); i++)
363  for (j=0; j < me.cols(); j++)
364  me(i,j) = x;
365  return me;
366  }
367 
368  // MatBaseNewAssignOperator(operator+=, +=);
373  template <class E> BaseClass& operator+=(const ConstMatrixBase<T, E>& x)
374  {
375  //MatBaseArrayAssignMacro(+=);
376  BaseClass& me = static_cast<BaseClass&>(*this);
377 #ifdef RANGECHECK
378  if(x.rows() != me.rows() || x.cols() != me.cols()) {
379  MatrixException e("Invalid dimensions for Matrix operator+=(Matrix)");
380  GNSSTK_THROW(e);
381  }
382 #endif
383  size_t i,j;
384  for (i=0; i < me.rows(); i++)
385  for (j=0; j < me.cols(); j++)
386  me(i,j) += x(i,j);
387  return me;
388  }
393  template <class E> BaseClass& operator+=(const ConstVectorBase<T, E>& x)
394  {
395  //MatBaseArrayAssignMacroVecSource(+=);
396  BaseClass& me = static_cast<BaseClass&>(*this);
397 #ifdef RANGECHECK
398  if(x.size() != me.rows() * me.cols()) {
399  MatrixException e("Invalid dimensions for Matrix operator+=(Vector)");
400  GNSSTK_THROW(e);
401  }
402 #endif
403  size_t i,j;
404  for (i=0; i < me.rows(); i++)
405  for (j=0; j < me.cols(); j++)
406  me(i,j) += x[i*me.cols()+j];
407  return me;
408  }
413  BaseClass& operator+=(const std::valarray<T>& x)
414  {
415  //MatBaseArrayAssignMacroVecSource(+=);
416  BaseClass& me = static_cast<BaseClass&>(*this);
417 #ifdef RANGECHECK
418  if(x.size() != me.rows() * me.cols()) {
419  MatrixException e("Invalid dimensions for Matrix operator+=(valarray)");
420  GNSSTK_THROW(e);
421  }
422 #endif
423  size_t i,j;
424  for (i=0; i < me.rows(); i++)
425  for (j=0; j < me.cols(); j++)
426  me(i,j) += x[i*me.cols()+j];
427  return me;
428  }
431  BaseClass& operator+=(const T* x)
432  {
433  //MatBaseArrayAssignMacroVecSource(+=);
434  BaseClass& me = static_cast<BaseClass&>(*this);
435  size_t i,j;
436  for (i=0; i < me.rows(); i++)
437  for (j=0; j < me.cols(); j++)
438  me(i,j) += x[i*me.cols()+j]; // no way to RANGECHECK on x[..]!
439  return me;
440  }
442  BaseClass& operator+=(T x)
443  {
444  //MatBaseAtomicAssignMacro(+=);
445  BaseClass& me = static_cast<BaseClass&>(*this);
446  size_t i,j;
447  for (i=0; i < me.rows(); i++)
448  for (j=0; j < me.cols(); j++)
449  me(i,j) += x;
450  return me;
451  }
452 
453 
454  //#define MatBaseNewAssignOperator(operator-=, -=)
459  template <class E> BaseClass& operator-=(const ConstMatrixBase<T, E>& x)
460  {
461  //MatBaseArrayAssignMacro(-=);
462  BaseClass& me = static_cast<BaseClass&>(*this);
463 #ifdef RANGECHECK
464  if(x.rows() != me.rows() || x.cols() != me.cols()) {
465  MatrixException e("Invalid dimensions for Matrix operator-=(Matrix)");
466  GNSSTK_THROW(e);
467  }
468 #endif
469  size_t i,j;
470  for (i=0; i < me.rows(); i++)
471  for (j=0; j < me.cols(); j++)
472  me(i,j) -= x(i,j);
473  return me;
474  }
479  template <class E> BaseClass& operator-=(const ConstVectorBase<T, E>& x)
480  {
481  //MatBaseArrayAssignMacroVecSource(-=);
482  BaseClass& me = static_cast<BaseClass&>(*this);
483 #ifdef RANGECHECK
484  if(x.size() != me.rows() * me.cols()) {
485  MatrixException e("Invalid dimensions for Matrix operator-=(Vector)");
486  GNSSTK_THROW(e);
487  }
488 #endif
489  size_t i,j;
490  for (i=0; i < me.rows(); i++)
491  for (j=0; j < me.cols(); j++)
492  me(i,j) -= x[i*me.cols()+j];
493  return me;
494  }
499  BaseClass& operator-=(const std::valarray<T>& x)
500  {
501  //MatBaseArrayAssignMacroVecSource(-=);
502  BaseClass& me = static_cast<BaseClass&>(*this);
503 #ifdef RANGECHECK
504  if(x.size() != me.rows() * me.cols()) {
505  MatrixException e("Invalid dimensions for Matrix operator-=(valarray)");
506  GNSSTK_THROW(e);
507  }
508 #endif
509  size_t i,j;
510  for (i=0; i < me.rows(); i++)
511  for (j=0; j < me.cols(); j++)
512  me(i,j) -= x[i*me.cols()+j];
513  return me;
514  }
517  BaseClass& operator-=(const T* x)
518  {
519  //MatBaseArrayAssignMacroVecSource(-=);
520  BaseClass& me = static_cast<BaseClass&>(*this);
521  size_t i,j;
522  for (i=0; i < me.rows(); i++)
523  for (j=0; j < me.cols(); j++)
524  me(i,j) -= x[i*me.cols()+j]; // no way to RANGECHECK on x[..]!
525  return me;
526  }
528  BaseClass& operator-=(T x)
529  {
530  //MatBaseAtomicAssignMacro(-=);
531  BaseClass& me = static_cast<BaseClass&>(*this);
532  size_t i,j;
533  for (i=0; i < me.rows(); i++)
534  for (j=0; j < me.cols(); j++)
535  me(i,j) -= x;
536  return me;
537  }
538 
539 
541  BaseClass& operator*=(const T x)
542  {
543  //MatBaseAtomicAssignMacro(*=);
544  BaseClass& me = static_cast<BaseClass&>(*this);
545  size_t i,j;
546  for (i=0; i < me.rows(); i++)
547  for (j=0; j < me.cols(); j++)
548  me(i,j) *= x;
549  return me;
550  }
551 
553  BaseClass& operator/=(const T x)
554  {
555  //MatBaseAtomicAssignMacro(/=);
556  BaseClass& me = static_cast<BaseClass&>(*this);
557  size_t i,j;
558  for (i=0; i < me.rows(); i++)
559  for (j=0; j < me.cols(); j++)
560  me(i,j) /= x;
561  return me;
562  }
563 
565  const BaseClass operator-()
566  {
567  const T x=T(-1);
568  BaseClass me = static_cast<BaseClass>(*this);
569  size_t i,j;
570  for (i=0; i < me.rows(); i++)
571  for (j=0; j < me.cols(); j++)
572  me(i,j) *= x;
573  return me;
574  }
575 
579  BaseClass& swapRows(size_t row1, size_t row2)
580  {
581  BaseClass& me = static_cast<BaseClass&>(*this);
582 #ifdef RANGECHECK
583  if ( (row1 >= me.rows()) || (row2 >= me.rows()) )
584  {
585  MatrixException e("Invalid rows for swapRows");
586  GNSSTK_THROW(e);
587  }
588 #endif
589  size_t i;
590  T temp;
591  for (i = 0; i < me.cols(); i++)
592  {
593  temp = me(row1, i);
594  me(row1,i) = me(row2,i);
595  me(row2,i) = temp;
596  }
597  return me;
598  }
599 
603  BaseClass& swapCols(size_t col1, size_t col2)
604  {
605  BaseClass& me = static_cast<BaseClass&>(*this);
606 #ifdef RANGECHECK
607  if ( (col1 >= me.cols()) || (col2 >= me.cols()) )
608  {
609  MatrixException e("Invalid columns for swapCols");
610  GNSSTK_THROW(e);
611  }
612 #endif
613  size_t i;
614  T temp;
615  for (i = 0; i < me.rows(); i++)
616  {
617  temp = me(i, col1);
618  me(i, col1) = me(i, col2);
619  me(i, col2) = temp;
620  }
621  return me;
622  }
623  };
624 
628  template <class T, class BaseClass>
630  {
632  size_t rowSize() const
633  { return static_cast<const BaseClass*>(this)->rowSize(); }
635  size_t rowStart() const
636  { return static_cast<const BaseClass*>(this)->rowStart(); }
638  size_t rowStride() const
639  { return static_cast<const BaseClass*>(this)->rowStride(); }
641  size_t colSize() const
642  { return static_cast<const BaseClass*>(this)->colSize(); }
644  size_t colStart() const
645  { return static_cast<const BaseClass*>(this)->colStart(); }
647  size_t colStride() const
648  { return static_cast<const BaseClass*>(this)->colStride(); }
649  protected:
654  inline void matSliceCheck(size_t sourceRowSize,
655  size_t sourceColSize) const
656  {
657  //#ifdef RANGECHECK
658  if (rowSize() > 0)
659  {
660  if ( (rowStart() >= sourceRowSize) ||
661  ((rowStart() + (rowSize()-1) * rowStride()) >= sourceRowSize))
662  {
663  MatrixException e("Invalid row range for slice");
664  GNSSTK_THROW(e);
665  }
666  }
667  if (colSize() > 0)
668  {
669  if ( (colStart() >= sourceColSize) ||
670  ((colStart() + (colSize()-1) * colStride()) >= sourceColSize))
671  {
672  MatrixException e("Invalid col range for slice");
673  GNSSTK_THROW(e);
674  }
675  }
676  //#endif
677  }
678  };
679 
681  template <class T, class BaseClass>
682  class ConstMatrixSliceBase : public MatrixSliceBase<T, BaseClass>,
683  public ConstMatrixBase<T, BaseClass>
684  {
685  public:
686  explicit ConstMatrixSliceBase() {}
687  };
688 
690  template <class T, class BaseClass>
691  class RefMatrixSliceBase : public MatrixSliceBase<T, BaseClass>,
692  public RefMatrixBase<T, BaseClass>
693  {
694  public:
695  explicit RefMatrixSliceBase() {}
696  };
697 
699 
700 } // namespace
701 
702 #include "MatrixBaseOperators.hpp"
703 
704 #endif
gnsstk::RefMatrixBase
Definition: MatrixBase.hpp:217
gnsstk::RefMatrixBase::operator/=
BaseClass & operator/=(const T x)
divides each element in this matrix by x.
Definition: MatrixBase.hpp:553
gnsstk::ConstMatrixSliceBase
Base class for an unmodifiable matrix slice.
Definition: MatrixBase.hpp:682
gnsstk::RefMatrixBase::operator+=
BaseClass & operator+=(const ConstMatrixBase< T, E > &x)
Definition: MatrixBase.hpp:373
gnsstk::ConstMatrixBase::ConstMatrixBase
ConstMatrixBase()
default constructor
Definition: MatrixBase.hpp:69
gnsstk::ConstMatrixBase::rowCopy
Vector< T > rowCopy(size_t r, size_t c=0) const
Definition: MatrixBase.hpp:165
gnsstk::ConstMatrixBase::isSymmetric
bool isSymmetric() const
Definition: MatrixBase.hpp:131
gnsstk::RefMatrixBase::size
size_t size() const
returns the rows()*cols() size of the matrix
Definition: MatrixBase.hpp:231
gnsstk::RefMatrixBase::operator+=
BaseClass & operator+=(const ConstVectorBase< T, E > &x)
Definition: MatrixBase.hpp:393
gnsstk::RefMatrixBase::operator*=
BaseClass & operator*=(const T x)
multiplies each element in this matrix by x.
Definition: MatrixBase.hpp:541
gnsstk::RefMatrixBase::operator-=
BaseClass & operator-=(const std::valarray< T > &x)
Definition: MatrixBase.hpp:499
gnsstk::MatrixSliceBase::colSize
size_t colSize() const
returns the number of columns in this slice
Definition: MatrixBase.hpp:641
gnsstk::RefMatrixBase::swapRows
BaseClass & swapRows(size_t row1, size_t row2)
Definition: MatrixBase.hpp:579
gnsstk::ConstMatrixBase::diagCopy
Vector< T > diagCopy(void) const
Definition: MatrixBase.hpp:184
gnsstk::RefMatrixBase::assignFrom
BaseClass & assignFrom(const std::valarray< T > &x)
Definition: MatrixBase.hpp:328
gnsstk::RefMatrixBase::operator-=
BaseClass & operator-=(const ConstVectorBase< T, E > &x)
Definition: MatrixBase.hpp:479
gnsstk::MatrixSliceBase
Definition: MatrixBase.hpp:629
gnsstk::ConstMatrixBase::operator()
T operator()(size_t i, size_t j) const
Definition: MatrixBase.hpp:85
gnsstk::RefMatrixBase::operator-=
BaseClass & operator-=(T x)
Definition: MatrixBase.hpp:528
gnsstk::ConstMatrixBase::isUT
bool isUT() const
returns true if this is an upper triangular matrix.
Definition: MatrixBase.hpp:92
gnsstk::RefMatrixBase::operator-=
BaseClass & operator-=(const ConstMatrixBase< T, E > &x)
Definition: MatrixBase.hpp:459
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::RefMatrixBase::zeroizeCol
BaseClass & zeroizeCol(size_t c)
Definition: MatrixBase.hpp:264
example4.temp
temp
Definition: example4.py:35
gnsstk::NEW_EXCEPTION_CLASS
NEW_EXCEPTION_CLASS(FileSpecException, gnsstk::Exception)
gnsstk::RefMatrixBase::operator+=
BaseClass & operator+=(T x)
Definition: MatrixBase.hpp:442
gnsstk::ConstMatrixBase::size
size_t size() const
the rows()*cols() size of the matrix.
Definition: MatrixBase.hpp:75
gnsstk::RefMatrixSliceBase
Base class for a modifiable matrix slice.
Definition: MatrixBase.hpp:691
gnsstk::RefMatrixBase::~RefMatrixBase
virtual ~RefMatrixBase()
Definition: MatrixBase.hpp:223
gnsstk::ConstMatrixBase::rows
size_t rows() const
the number of rows in the matrix
Definition: MatrixBase.hpp:81
gnsstk::MatrixSliceBase::matSliceCheck
void matSliceCheck(size_t sourceRowSize, size_t sourceColSize) const
Definition: MatrixBase.hpp:654
gnsstk::MatrixSliceBase::rowSize
size_t rowSize() const
returns the number of rows in this slice
Definition: MatrixBase.hpp:632
gnsstk::RefMatrixBase::assignFrom
BaseClass & assignFrom(T x)
Definition: MatrixBase.hpp:357
gnsstk::ConstMatrixBase::cols
size_t cols() const
the number of columns in the matrix
Definition: MatrixBase.hpp:78
gnsstk::MatrixSliceBase::colStart
size_t colStart() const
returns the starting row in the base matrix of this slice
Definition: MatrixBase.hpp:644
gnsstk::ConstMatrixBase::~ConstMatrixBase
virtual ~ConstMatrixBase()
Definition: MatrixBase.hpp:71
gnsstk::MatrixSliceBase::colStride
size_t colStride() const
returns the number of elements between the i'th and i+1'th row
Definition: MatrixBase.hpp:647
gnsstk::RefMatrixBase::assignFrom
BaseClass & assignFrom(const ConstVectorBase< T, E > &x)
Definition: MatrixBase.hpp:308
gnsstk::RefMatrixBase::operator-
const BaseClass operator-()
unary minus: multiplies each element in this matrix by -1.
Definition: MatrixBase.hpp:565
gnsstk::RefMatrixBase::operator-=
BaseClass & operator-=(const T *x)
Definition: MatrixBase.hpp:517
gnsstk::ConstMatrixBase::isDiagonal
bool isDiagonal() const
returns true if this is a diagonal matrix
Definition: MatrixBase.hpp:117
gnsstk::RefMatrixBase::zeroize
BaseClass & zeroize()
Definition: MatrixBase.hpp:241
gnsstk::Vector
Definition: Vector.hpp:67
gnsstk::ConstVectorBase::size
size_t size() const
Returns the size of the base class.
Definition: VectorBase.hpp:112
ABS
#define ABS(x)
Definition: MathBase.hpp:73
gnsstk::ConstMatrixBase
Definition: MatrixBase.hpp:65
gnsstk::RefMatrixBase::cols
size_t cols() const
returns the number of columns in the matrix
Definition: MatrixBase.hpp:234
gnsstk::RefMatrixBase::zeroizeRow
BaseClass & zeroizeRow(size_t r)
Definition: MatrixBase.hpp:253
gnsstk::RefMatrixBase::assignFrom
BaseClass & assignFrom(const T *x)
Definition: MatrixBase.hpp:346
gnsstk::ConstVectorBase
Definition: VectorBase.hpp:105
gnsstk::RefMatrixBase::rows
size_t rows() const
returns the number of rows in the matrix
Definition: MatrixBase.hpp:237
gnsstk::RefMatrixSliceBase::RefMatrixSliceBase
RefMatrixSliceBase()
Definition: MatrixBase.hpp:695
gnsstk::ConstMatrixBase::colCopy
Vector< T > colCopy(size_t c, size_t r=0) const
Definition: MatrixBase.hpp:146
gnsstk::RefMatrixBase::RefMatrixBase
RefMatrixBase()
default constructor
Definition: MatrixBase.hpp:221
gnsstk::ConstMatrixBase::isLT
bool isLT() const
returns true if this is a lower triangular matrix.
Definition: MatrixBase.hpp:104
gnsstk::RefMatrixBase::operator+=
BaseClass & operator+=(const T *x)
Definition: MatrixBase.hpp:431
gnsstk::MatrixSliceBase::rowStride
size_t rowStride() const
returns the number of elements between the i'th and i+1'th row
Definition: MatrixBase.hpp:638
gnsstk::RefMatrixBase::operator+=
BaseClass & operator+=(const std::valarray< T > &x)
Definition: MatrixBase.hpp:413
GNSSTK_THROW
#define GNSSTK_THROW(exc)
Definition: Exception.hpp:366
gnsstk::RefMatrixBase::operator()
T & operator()(size_t i, size_t j)
returns a reference to the (i,j) element of the matrix.
Definition: MatrixBase.hpp:227
gnsstk::RefVectorBaseHelper::zeroTolerance
static GNSSTK_EXPORT double zeroTolerance
Definition: VectorBase.hpp:147
gnsstk::MatrixSliceBase::rowStart
size_t rowStart() const
returns the starting row in the base matrix of this slice
Definition: MatrixBase.hpp:635
gnsstk::RefMatrixBase::assignFrom
BaseClass & assignFrom(const ConstMatrixBase< T, E > &x)
Definition: MatrixBase.hpp:288
MatrixBaseOperators.hpp
gnsstk::ConstMatrixBase::constMatrixRef
T constMatrixRef(size_t i, size_t j) const
Definition: MatrixBase.hpp:198
gnsstk::ConstMatrixSliceBase::ConstMatrixSliceBase
ConstMatrixSliceBase()
Definition: MatrixBase.hpp:686
gnsstk::ConstMatrixBase::isSquare
bool isSquare() const
returns true if this is a square matrix (false for a null matrix).
Definition: MatrixBase.hpp:89
Vector.hpp
gnsstk::RefMatrixBase::swapCols
BaseClass & swapCols(size_t col1, size_t col2)
Definition: MatrixBase.hpp:603


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:39