28 #ifndef SCIMATH_LSQMATRIX_H
29 #define SCIMATH_LSQMATRIX_H
32 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Utilities/RecordTransformable.h>
static Bool putCArray(String &error, RecordInterface &out, const String &fname, uInt len, const uInt *const in)
void reset()
Reset all data to zero.
LSQMatrix()
Default constructor (empty, only usable after a set(n))
void addDiagonal_pub(uInt n, Double fac)
Add fac to n-length of diagonal.
static Bool putCArray(String &error, RecordInterface &out, const String &fname, uInt len, const Double *const in)
Convert a carray to/from a record.
void decRow_pub(Double *&row, uInt i) const
void addDiagonal(uInt n, Double fac)
Add fac to n-length of diagonal.
void toAipsIO(AipsIO &out) const
void clear()
Clear matrix.
static const String tmatsiz
Record field names.
Double * trian_p
Matrix (triangular n_p * n_p)
Double operator[](uInt index) const
static void getCArray(AipsIO &in, uInt len, Double *&out)
void incRow_pub(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
void deinit()
De-initialise matrix.
uInt nrows() const
Get number of rows.
LSQMatrix(uInt n)
Construct an object with the number of rows and columns indicated.
static void getCArray(AipsIO &in, uInt len, uInt *&out)
uInt nelements_pub() const
Get length of triangular array.
Bool toRecord(String &error, RecordInterface &out) const
Create a record from an LSQMatrix.
LSQMatrix & operator=(const LSQMatrix &other)
Assignment (deep copy)
static Bool getCArray(String &error, const RecordInterface &in, const String &fname, uInt len, Double *&out)
static void putCArray(AipsIO &out, uInt len, const Double *const in)
Double * row_pub(uInt i) const
A set of public interface functions.
void set(uInt n)
Set new sizes (default is for Real, a Bool argument will make it complex)
void fromAipsIO(AipsIO &in)
Save or restore using AipsIO.
Double * diag(uInt i) const
Get diagonal element pointer [i][i]
Double * diag_pub(uInt i) const
Get diagonal element pointer [i][i]
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 doDiagonal(uInt n)
Make diagonal element 1 if zero (Note that this is always called when invert() is called).
Double maxDiagonal(uInt n)
Determine max of abs values of n-length of diagonal.
Double maxDiagonal_pub(uInt n)
Determine max of abs values of n-length of diagonal.
Double * row(uInt i) const
Get row pointer in normal equation (points to element [i][0])
uInt len_p
Derived sizes (all 0 if n_p equals 0)
uInt n_p
Matrix size (linear size)
static Bool getCArray(String &error, const RecordInterface &in, const String &fname, uInt len, uInt *&out)
void mulDiagonal(uInt n, Double fac)
Multiply n-length of diagonal with 1+fac
void init()
Initialise matrix.
void mulDiagonal_pub(uInt n, Double fac)
Multiply n-length of diagonal with 1+fac
void copy(const LSQMatrix &other)
Copy data.
void doDiagonal_pub(uInt n)
Make diagonal element 1 if zero (Note that this is always called when invert() is called).
Double & operator[](uInt index)
Index an element in the triangularised matrix.
static void putCArray(AipsIO &out, uInt len, const uInt *const in)
uInt nrows_pub() const
Get number of rows.
const String & ident() const
Get identification of record.
uInt nelements() const
Get length of triangular array.
static const String tmatdat
Bool fromRecord(String &error, const RecordInterface &in)
Create a Matrix from a record.
LSQMatrix(const LSQMatrix &other)
Copy constructor (deep copy)
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.