VCLib Documentation  6.12.2

Mathematics

Mathematics

Modules

 1D->1D Polynomial
 
 2D->1D Polynomial
 
 2D->2D Polynomial
 

Macros

#define max(a, b)   (((a) > (b)) ? (a) : (b))
 
#define min(a, b)   (((a) < (b)) ? (a) : (b))
 
#define sign(x)   ((x) > 0 ? 1: ((x) == 0 ? 0: (-1)))
 

Functions

I32 lu_inverse (vcmat *A, vcmat *y, F64 *det)
 Calculate the inverse of a n×n-matrix using the LU decomposition. More...
 
I32 lu_det (vcmat *A, F64 *det)
 Calculate the determinant of A n×n-matrix using the LU decomposition. More...
 
I32 vc_QR_solve (vcmat *A, vcvec *y, vcvec *x)
 Solve a system of linear equations using the Householder QR factorization. More...
 

Detailed Description

Functions in this group provide concepts like matrix, vector, ...

Macro Definition Documentation

◆ max

#define max (   a,
 
)    (((a) > (b)) ? (a) : (b))

Outputs the maximum of a and b.

◆ min

#define min (   a,
 
)    (((a) < (b)) ? (a) : (b))

Outputs the minimum of a and b.

◆ sign

#define sign (   x)    ((x) > 0 ? 1: ((x) == 0 ? 0: (-1)))

Outputs the sign of x, either 1, 0 or -1.

Function Documentation

◆ lu_inverse()

I32 lu_inverse ( vcmat *  A,
vcmat *  y,
F64 det 
)

The function calculates the inverse of the n×n-matrix a and outputs the result in matrix y. The function may be called in-place, i.e. a and y may be the same matrix. The function returns an error if the size of the matrices is not square and not identical. The determinant of the matrix det is output as a F64 value although possibly only calculated as a float value depending ont the type of a.

Parameters
Asource matrix
ydestination matrix
detdeterminant of A (output)

◆ lu_det()

I32 lu_det ( vcmat *  A,
F64 det 
)

The function calculates the determinant of the n×n matrix A. The function returns an error if the size of the matrix is not square. The determinant of the matrix det is output as a F64 value although possibly only calculated as a float value depending ont the type of A.

Parameters
Asource matrix
detdeterminant of A (output)

◆ vc_QR_solve()

I32 vc_QR_solve ( vcmat *  A,
vcvec *  y,
vcvec *  x 
)

The QR factorization using the Householder transform is a numerically stable tool for linear least square approximations.

See: Stoer, J "Einfuehrung in die Numerische Mathematik I" pp 164ff, Springer, 1976

The function solves the linear system ||Ax - y|| = min

Parameters
Asource matrix (dimensions m * n)
yinput vector (m)
xsolution vector (n)
detdeterminant of a (output)
See also
qr_househ_F64, qr_backs_F64().