MCPcopy Create free account
hub / github.com/Singular/Singular / intersect

Method intersect

factory/DegreePattern.cc:68–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67
68void DegreePattern::intersect (const DegreePattern& degPat)
69{
70 if (degPat.getLength() < getLength())
71 {
72 DegreePattern bufDeg= *this;
73 *this= degPat;
74 return (*this).intersect (bufDeg);
75 }
76
77 int count= 0;
78 int length= tmin (getLength(), degPat.getLength());
79 int* buf= new int [length];
80 for (int i= 0; i < length; i++)
81 {
82 if (degPat.find ((*this)[i]))
83 {
84 buf[i]= (*this)[i];
85 count++;
86 }
87 else
88 buf[i]= -1;
89 }
90 ASSERT ( count > 0, "count > 0 expected" );
91
92 init (count);
93 count= 0;
94 for (int i= 0; i < length; i++)
95 {
96 if (buf[i] != -1)
97 {
98 (*this) [count]= buf[i];
99 count++;
100 }
101 }
102 delete[] buf;
103}
104
105void DegreePattern::refine ()
106{

Callers 7

biFactorizeFunction · 0.80
extFactorRecombinationFunction · 0.80
factorRecombinationFunction · 0.80
earlyFactorDetectionFunction · 0.80
extEarlyFactorDetectionFunction · 0.80
facFqBivar.ccFile · 0.80
biFactorizeFunction · 0.80

Calls 4

tminFunction · 0.85
initFunction · 0.85
getLengthMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected