Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Comments
Originally the signature for
vmp_prepare_dblptr
had the comments/** @brief prepares a vmp matrix (mat[row*ncols+col] points to the item) */
I'm not sure if this indexing was intentional or not, as it would mean the matrix has
row*col
rows and each column is of sizeN
. After using spqlios for things such as circuit bootstrapping, it is much more convenient to have the indexing done asmat[row]+col*N
, or equivalently, each row is avec_znx
and each column a limb of thevec_znx
indexed by the row. This allow to prepare a matrix (e.g.RGSW
) from a set ofvec_znx
(a e.g. set ofRLWE
) by simply constructing an array pointing to each of their data.Changes
vmp_prepare_row
which enables to prepare the i-th row of avmp_pmat
forvec_znx
,vec_rnx
,vec_zn32
. This enables to prepare avmp_pmat
with a buffer as small as one row (avec_znx
).vmp_prepare_dblptr
forvec_znx
,vec_rnx
,vec_zn32
.vmp_prepare_dblptr
sequentially callsvmp_prepare_row
.vmp_prepare_dblptr
forvec_znx
,vec_rnx
,vec_zn32
(which also directly testsvmp_prepare_row
).vmp_prepare_contiguous_tmp_bytes
tovmp_preapre_tmp_bytes
.Related Issues
#46, #47