void CB::init(AS *ptrMain) { #ifdef CB_DBG // only if ee debug is set dbgStart(); // serial setup dbg << F("CB.\n"); // ...and some information #endif pHM = ptrMain; }
void SN::init(AS *ptrMain) { #ifdef SN_DBG // only if ee debug is set dbgStart(); // serial setup dbg << F("SN.\n"); // ...and some information #endif pHM = ptrMain; buf = (uint8_t*)&mBdy; }
/** * Given a matrix that defines a full-dimensional affine lattice, returns the * affine sub-lattice spanned in the k first dimensions. * Useful for instance when you only look for the parameters' validity lattice. * @param lat the original full-dimensional lattice * @param subLat the sublattice */ void Lattice_extractSubLattice(Matrix * lat, unsigned int k, Matrix ** subLat) { Matrix * H, *Q, *U, *linLat = NULL; unsigned int i; dbgStart(Lattice_extractSubLattice); /* if the dimension is already good, just copy the initial lattice */ if (k==lat->NbRows-1) { if (*subLat==NULL) { (*subLat) = Matrix_Copy(lat); } else { Matrix_copySubMatrix(lat, 0, 0, lat->NbRows, lat->NbColumns, (*subLat), 0, 0); } return; } assert(k<lat->NbRows-1); /* 1- Make the linear part of the lattice triangular to eliminate terms from other dimensions */ Matrix_subMatrix(lat, 0, 0, lat->NbRows, lat->NbColumns-1, &linLat); /* OPT: any integer column-vector elimination is ok indeed. */ /* OPT: could test if the lattice is already in triangular form. */ left_hermite(linLat, &H, &Q, &U); if (dbgCompParmMore) { show_matrix(H); } Matrix_Free(Q); Matrix_Free(U); Matrix_Free(linLat); /* if not allocated yet, allocate it */ if (*subLat==NULL) { (*subLat) = Matrix_Alloc(k+1, k+1); } Matrix_copySubMatrix(H, 0, 0, k, k, (*subLat), 0, 0); Matrix_Free(H); Matrix_copySubMatrix(lat, 0, lat->NbColumns-1, k, 1, (*subLat), 0, k); for (i=0; i<k; i++) { value_set_si((*subLat)->p[k][i], 0); } value_set_si((*subLat)->p[k][k], 1); dbgEnd(Lattice_extractSubLattice); } /* Lattice_extractSubLattice */