- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
I wrote this piece of C code:
double Matrix[] =
{
1, -1,
-1, 1
};
int nInfo;
char chUpper = 'U';
int nSize = 2;
dpotrf(
&chUpper,
&nSize,
Matrix,
&nSize,
&nInfo);
As far as my limited math understanding goes, my matrix is positive semidefinite, but nInfo is 2... Am I doing anything wrong?
Hagai.
double Matrix[] =
{
1, -1,
-1, 1
};
int nInfo;
char chUpper = 'U';
int nSize = 2;
dpotrf(
&chUpper,
&nSize,
Matrix,
&nSize,
&nInfo);
As far as my limited math understanding goes, my matrix is positive semidefinite, but nInfo is 2... Am I doing anything wrong?
Hagai.
Link kopiert
3 Antworten
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Quoting - hagai_sela
I wrote this piece of C code:
double Matrix[] =
{
1, -1,
-1, 1
};
int nInfo;
char chUpper = 'U';
int nSize = 2;
dpotrf(
&chUpper,
&nSize,
Matrix,
&nSize,
&nInfo);
As far as my limited math understanding goes, my matrix is positive semidefinite, but nInfo is 2... Am I doing anything wrong?
Hagai.
double Matrix[] =
{
1, -1,
-1, 1
};
int nInfo;
char chUpper = 'U';
int nSize = 2;
dpotrf(
&chUpper,
&nSize,
Matrix,
&nSize,
&nInfo);
As far as my limited math understanding goes, my matrix is positive semidefinite, but nInfo is 2... Am I doing anything wrong?
Hagai.
Your matrix is not positive definite which is why nInfo returns a value greater than zero. Here is the return information from LAPACK:
INFO (output) INTEGER
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
> 0: if INFO = i, the leading minor of order i is not
positive definite, and the factorization could not be
completed.
I tried this with [2 1;1 2] and it worked fine.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
it's not positive definite, but it is semi-positive definite. Isn't that enough?
Hagai.
Hagai.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Quoting - hagai_sela
it's not positive definite, but it is semi-positive definite. Isn't that enough?
Hagai.
Hagai.
Antworten
Themen-Optionen
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite