void qrdec(mat A, mat R) that
performs in-place Gram-Schmidt orthogonalization of matrix A and
fills-in the matrix R.
void qrbak(mat Q, mat R, vec b, vec result)
which solves the equation QRx=b by back-substitution and
puts the result in vector result.
double absdet(mat R) which
calculates the absolute value of the determinant.
void inverse(mat Q, mat R, mat AI)
which calculates the inverse into matrix AI.
QR with member variables mat Q,
R; and the constructor QR(mat A) which first copies
A into Q and then performs the in-place orthogonalization.
void qrbak(vec b, vec result)
double absdet()
void inverse(mat AI)
main function which applies the implemented
functions on some data and checks that everything works as intended.
Hint: the total number of CPU-seconds used by a program
my_prog can be determined by the POSIX time
utility.
The command
\time --format "time = %U" --append --output=time.txt ./my_prog > /dev/null
or, in short
\time -f "%U" -ao time.txt ./my_prog > /dev/null
runs the program (disregarding the standard output) and appends the
number of consumed CPU-seconds to the file time.txt.
Without the --append (or, in short, -a) option
the file time.txt gets overwritten. Backslash here is
needed to run the actual utility rather than built-in bash command (with
similar possibilities, actually).
An example of the usage of time can be found here (see the
makefile).