The basic operations provided are referencing and indexing of cells,
rows, columns and diagonal of the triangular matrix.
The class is a private structure, with explicit friends.
Index an element in the triangularised matrix
Prerequisite
Etymology
From Least SQuares and Matrix
Synopsis
The LSQMatrix class contains the handling of the basic container used
in the LSQFit class and its derivatives.
This basic container is a triangular matrix.
Example
See the LSQFit class for its use.
Motivation
The class was written to isolate the handling of the normal equations
used in the LSQ classes.
To Do
Member Description
LSQMatrix()
Default constructor (empty, only usable after a set(n))
explicit LSQMatrix(uInt n)
Construct an object with the number of rows and columns indicated.
If a Bool argument is present, the number
will be taken as double the number given (assumes complex).
LSQMatrix(uInt n, Bool)
LSQMatrix(const LSQMatrix &other)
Copy constructor (deep copy)
LSQMatrix &operator=(const LSQMatrix &other)
Assignment (deep copy)
~LSQMatrix()
Double &operator[](uInt index)
const Double operator[](uInt index) const
void reset()
Reset all data to zero
void set(uInt n)
Set new sizes (default is for Real, a Bool argument will make it complex)
void set(uInt n, Bool)
Double *row(uInt i) const
Get row pointer in normal equation (points to element [i][0])
void incRow(Double *&row, uInt i) const
Get next row or previous row pointer in normal equation if the pointer
row is at row i.
void decRow(Double *&row, uInt i) const
Double *diag(uInt i) const
Get diagonal element pointer [i][i]
uInt nelements() const
Get length of triangular array
uInt nrows() const
Get number of rows
void copy(const LSQMatrix &other)
Copy data.
void init()
Initialise matrix
void clear()
Clear matrix
void deinit()
De-initialise matrix
void doDiagonal(uInt n)
Make diagonal element 1 if zero (Note that this is always called when
invert() is called). Only n-length sub-matrix is done.
void mulDiagonal(uInt n, Double fac)
Multiply n-length of diagonal with 1+fac