My Project
Loading...
Searching...
No Matches
Functions
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.

77{
78 if(MATELEM(M,k,i)==0||MATELEM(M,k,j)==0)
79 return(M);
80
83
84 for(int l=1;l<=MATROWS(M);l++)
85 {
88 }
89 for(int l=1;l<=MATCOLS(M);l++)
90 {
93 }
94
95 pDelete(&p);
96
97 return(M);
98}
int l
Definition: cfEzgcd.cc:100
int i
Definition: cfEzgcd.cc:132
int k
Definition: cfEzgcd.cc:99
int p
Definition: cfModGcd.cc:4078
int j
Definition: facHensel.cc:110
#define MATELEM(mat, i, j)
1-based access to matrix
Definition: matpol.h:29
#define MATROWS(i)
Definition: matpol.h:26
#define MATCOLS(i)
Definition: matpol.h:27
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
#define nDiv(a, b)
Definition: numbers.h:32
#define pAdd(p, q)
Definition: polys.h:203
#define pDelete(p_ptr)
Definition: polys.h:186
#define pNSet(n)
Definition: polys.h:313
#define pSub(a, b)
Definition: polys.h:287
#define ppMult_qq(p, q)
Definition: polys.h:208
#define pNormalize(p)
Definition: polys.h:317
#define M
Definition: sirandom.c:25

◆ evHessenberg()

matrix evHessenberg ( matrix  M)

Definition at line 100 of file eigenval.cc.

101{
102 int n=MATROWS(M);
103 if(n!=MATCOLS(M))
104 return(M);
105
106 for(int k=1,j=2;k<n-1;k++,j=k+1)
107 {
108 while((j<=n)
109 &&((MATELEM(M,j,k)==NULL)
110 || (p_Totaldegree(MATELEM(M,j,k),currRing)!=0)))
111 j++;
112
113 if(j<=n)
114 {
115 M=evSwap(M,j,k+1);
116
117 for(int i=j+1;i<=n;i++)
118 M=evRowElim(M,i,k+1,k);
119 }
120 }
121
122 return(M);
123}
matrix evRowElim(matrix M, int i, int j, int k)
Definition: eigenval.cc:47
matrix evSwap(matrix M, int i, int j)
Definition: eigenval.cc:25
#define NULL
Definition: omList.c:12
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1505
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.

48{
49 if(MATELEM(M,i,k)==NULL||MATELEM(M,j,k)==NULL)
50 return(M);
51 poly p1=pp_Jet(MATELEM(M,i,k),0,currRing);
52 poly p2=pp_Jet(MATELEM(M,j,k),0,currRing);
53 if ((p1==NULL)||(p2==NULL)) return (M);
54
55 poly p=pNSet(nDiv(pGetCoeff(p1),pGetCoeff(p2)));
57
58 for(int l=1;l<=MATCOLS(M);l++)
59 {
62 }
63 for(int l=1;l<=MATROWS(M);l++)
64 {
67 }
68
69 pDelete(&p);
70 pDelete(&p1);
71 pDelete(&p2);
72
73 return(M);
74}
poly pp_Jet(poly p, int m, const ring R)
Definition: p_polys.cc:4358

◆ evSwap()

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

Definition at line 25 of file eigenval.cc.

26{
27 if(i==j)
28 return(M);
29
30 for(int k=1;k<=MATROWS(M);k++)
31 {
32 poly p=MATELEM(M,i,k);
33 MATELEM(M,i,k)=MATELEM(M,j,k);
34 MATELEM(M,j,k)=p;
35 }
36
37 for(int k=1;k<=MATCOLS(M);k++)
38 {
39 poly p=MATELEM(M,k,i);
40 MATELEM(M,k,i)=MATELEM(M,k,j);
41 MATELEM(M,k,j)=p;
42 }
43
44 return(M);
45}