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

Method refine

factory/DegreePattern.cc:105–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105void DegreePattern::refine ()
106{
107 if (getLength() <= 1)
108 return;
109 int count= 0;
110 int* buf= new int [getLength()];
111 int d= (*this) [0];
112 int pos;
113 for (int i= 0; i < getLength(); i++)
114 buf[i]= -1;
115 for (int i= 1; i < getLength(); i++)
116 {
117 pos= (*this).find (d - (*this)[i]);
118 if (pos)
119 {
120 buf[i]= (*this)[i];
121 count++;
122 }
123 }
124 buf[0]= d;
125 count++;
126 if (count == getLength())
127 {
128 delete [] buf;
129 return;
130 }
131 int length= getLength();
132
133 ASSERT ( count > 0, "count > 0 expected" );
134 init (count);
135 count= 0;
136 for (int i= 0; i < length; i++)
137 {
138 if (buf[i] != -1)
139 {
140 (*this)[count]= buf[i];
141 count++;
142 }
143 }
144
145 delete[] buf;
146 return;
147}
148

Callers 6

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

Calls 2

initFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected