Loading...
Searching...
No Matches
eigenval.h File Reference

Go to the source code of this file.

## Functions

matrix | evSwap (matrix M, int i, int j)
matrix | evRowElim (matrix M, int i, int j, int k)
matrix | evColElim (matrix M, int i, int j, int k)
matrix | evHessenberg (matrix M)

## Function Documentation

## evColElim()

matrix evColElim | ( | matrix | M,
|  | int | i,
|  | int | j,
|  | int | k )

Definition at line 76 of file eigenval.cc.

{
if(MATELEM(M,k,i)==0||MATELEM(M,k,j)==0)
return(M);
poly p=pNSet(nDiv(pGetCoeff(MATELEM(M,k,i)),pGetCoeff(MATELEM(M,k,j))));
pNormalize(p);
for(int l=1;l<=MATROWS(M);l++)
{
MATELEM(M,l,i)=pSub(MATELEM(M,l,i),ppMult_qq(p,MATELEM(M,l,j)));
pNormalize(MATELEM(M,l,i));
}
for(int l=1;l<=MATCOLS(M);l++)
{
MATELEM(M,j,l)=pAdd(MATELEM(M,j,l),ppMult_qq(p,MATELEM(M,i,l)));
pNormalize(MATELEM(M,j,l));
}
pDelete(&p);
return(M);
}
l
int l
Definition cfEzgcd.cc:100
i
int i
Definition cfEzgcd.cc:132
k
int k
Definition cfEzgcd.cc:99
p
int p
Definition cfModGcd.cc:4086
j
int j
Definition facHensel.cc:110
MATELEM
#define MATELEM(mat, i, j)
1-based access to matrix
Definition matpol.h:29
MATROWS
#define MATROWS(i)
Definition matpol.h:26
MATCOLS
#define MATCOLS(i)
Definition matpol.h:27
pGetCoeff
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition monomials.h:44
nDiv
#define nDiv(a, b)
Definition numbers.h:32
pAdd
#define pAdd(p, q)
Definition polys.h:204
pDelete
#define pDelete(p_ptr)
Definition polys.h:187
pNSet
#define pNSet(n)
Definition polys.h:314
pSub
#define pSub(a, b)
Definition polys.h:288
ppMult_qq
#define ppMult_qq(p, q)
Definition polys.h:209
pNormalize
#define pNormalize(p)
Definition polys.h:318
M
#define M
Definition sirandom.c:25

## evHessenberg()

matrix evHessenberg | ( | matrix | M | ) |

Definition at line 100 of file eigenval.cc.

{
int n=MATROWS(M);
if(n!=MATCOLS(M))
return(M);
for(int k=1,j=2;k<n-1;k++,j=k+1)
{
while((j<=n)
&&((MATELEM(M,j,k)==NULL)
|| (p_Totaldegree(MATELEM(M,j,k),currRing)!=0)))
j++;
if(j<=n)
{
M=evSwap(M,j,k+1);
for(int i=j+1;i<=n;i++)
M=evRowElim(M,i,k+1,k);
}
}
return(M);
}
evRowElim
matrix evRowElim(matrix M, int i, int j, int k)
Definition eigenval.cc:47
evSwap
matrix evSwap(matrix M, int i, int j)
Definition eigenval.cc:25
NULL
#define NULL
Definition omList.c:12
p_Totaldegree
static long p_Totaldegree(poly p, const ring r)
Definition p_polys.h:1528
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13

## evRowElim()

matrix evRowElim | ( | matrix | M,
|  | int | i,
|  | int | j,
|  | int | k )

Definition at line 47 of file eigenval.cc.

{
if(MATELEM(M,i,k)==NULL||MATELEM(M,j,k)==NULL)
return(M);
poly p1=pp_Jet0(MATELEM(M,i,k),currRing);
poly p2=pp_Jet0(MATELEM(M,j,k),currRing);
if ((p1==NULL)||(p2==NULL)) return (M);
poly p=pNSet(nDiv(pGetCoeff(p1),pGetCoeff(p2)));
pNormalize(p);
for(int l=1;l<=MATCOLS(M);l++)
{
MATELEM(M,i,l)=pSub(MATELEM(M,i,l),ppMult_qq(p,MATELEM(M,j,l)));
pNormalize(MATELEM(M,i,l));
}
for(int l=1;l<=MATROWS(M);l++)
{
MATELEM(M,l,j)=pAdd(MATELEM(M,l,j),ppMult_qq(p,MATELEM(M,l,i)));
pNormalize(MATELEM(M,l,j));
}
pDelete(&p);
pDelete(&p1);
pDelete(&p2);
return(M);
}
pp_Jet0
poly pp_Jet0(poly p, const ring R)
Definition p_polys.cc:4512

## evSwap()

matrix evSwap | ( | matrix | M,
|  | int | i,
|  | int | j )

Definition at line 25 of file eigenval.cc.

{
if(i==j)
return(M);
for(int k=1;k<=MATROWS(M);k++)
{
poly p=MATELEM(M,i,k);
MATELEM(M,i,k)=MATELEM(M,j,k);
MATELEM(M,j,k)=p;
}
for(int k=1;k<=MATCOLS(M);k++)
{
poly p=MATELEM(M,k,i);
MATELEM(M,k,i)=MATELEM(M,k,j);
MATELEM(M,k,j)=p;
}
return(M);
}