Newer
Older
// ============================================================================
// == ==
// == AMDiS - Adaptive multidimensional simulations ==
// == ==

Thomas Witkowski
committed
// == http://www.amdis-fem.org ==
// == ==
// ============================================================================

Thomas Witkowski
committed
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/** \file Cholesky.h */
#ifndef CHOLESKY_H
#define CHOLESKY_H
#include "FixVec.h"
using namespace std;
using namespace AMDiS;
/**
* \ingroup Solvers
*
* \brief
* Solves a symmetric positive definite system using Cholesky decomposition.
* Returns true if the matrix in (numerically) positive definite.
*/
class Cholesky
{
public:
/** \brief
* Computes the Cholesky factor of a positive definite matrix A.
* On input, only the upper triangle of A need be given; it is not modified.
* The Cholesky factor is returned in the lower triangle of A, except for its
* diagonal elements which are returned in P.
*/
static bool factorization(Matrix<double> *A, Vector<double> *p);
/** \brief
* Solves system A*X=B, where A is a positive definite matrix.
* If P=NULL; A is assumed to be positive definite, and a Cholesky
* decomposition is computed using the previous routine.
* If P is given, A and P are assumed to be already given as the output of
* the previous routine.
*/
static bool solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x,
Vector<double> *p = NULL);
static bool solve(Matrix<double> *A, Vector<WorldVector<double> > *b,
Vector<WorldVector<double> > *x,
Vector<double> *p = NULL);
};
#endif