My Project  debian-1:4.1.1-p2+ds-4build1
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 
82  pNormalize(p);
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 }

◆ 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 }

◆ 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)));
56  pNormalize(p);
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 }

◆ 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 }
j
int j
Definition: facHensel.cc:105
k
int k
Definition: cfEzgcd.cc:92
MATELEM
#define MATELEM(mat, i, j)
Definition: matpol.h:28
evRowElim
matrix evRowElim(matrix M, int i, int j, int k)
Definition: eigenval.cc:47
pDelete
#define pDelete(p_ptr)
Definition: polys.h:166
ppMult_qq
#define ppMult_qq(p, q)
Definition: polys.h:187
evSwap
matrix evSwap(matrix M, int i, int j)
Definition: eigenval.cc:25
currRing
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
i
int i
Definition: cfEzgcd.cc:125
M
#define M
Definition: sirandom.c:24
nDiv
#define nDiv(a, b)
Definition: numbers.h:32
pNSet
#define pNSet(n)
Definition: polys.h:287
pAdd
#define pAdd(p, q)
Definition: polys.h:182
pp_Jet
poly pp_Jet(poly p, int m, const ring R)
Definition: p_polys.cc:4238
MATCOLS
#define MATCOLS(i)
Definition: matpol.h:27
NULL
#define NULL
Definition: omList.c:9
l
int l
Definition: cfEzgcd.cc:93
p_Totaldegree
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1435
p
int p
Definition: cfModGcd.cc:4019
pNormalize
#define pNormalize(p)
Definition: polys.h:291
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:48
MATROWS
#define MATROWS(i)
Definition: matpol.h:26
pSub
#define pSub(a, b)
Definition: polys.h:261