MCPcopy Create free account
hub / github.com/data61/MP-SPDZ / SNF

Function SNF

FHE/Matrix.cpp:212–237  ·  view source on GitHub ↗

S = U*A*V

Source from the content-addressed store, hash-verified

210
211// S = U*A*V
212void SNF(matrix& S,const matrix& A,matrix& V)
213{
214 int m=A.size(),n=A[0].size();
215
216#ifdef VERBOSE
217 cerr << "SNF m=" << m << ", n=" << n << endl;
218#endif
219
220 S=A;
221 ident(V,n);
222
223 /* First get a diagonal matrix using the HNF */
224 matrix U2,V2;
225 SNF_Step(S,V);
226
227 /* Now get the divisibility condition */
228 int i,r;
229 r=min(m,n);
230 for (i=0; i<r-1; i++)
231 { if ((S[i+1][i+1]%S[i][i])!=0)
232 { // Add row i+1 to row i
233 S[i][i+1]=S[i+1][i+1];
234 SNF_Step(S,V);
235 }
236 }
237}
238
239
240

Callers 1

assignMethod · 0.85

Calls 4

identFunction · 0.85
SNF_StepFunction · 0.85
minFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected