Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sparse2 #686

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
3df6e6f
Another lost function
kartikv Mar 29, 2020
320ed32
Initial code for sparse matrices mod limb size integers, just constru…
kartikv Mar 26, 2020
002ed93
Basic lanczos, assumes non-symmetric matrix, returns any pseudosoluti…
kartikv Mar 27, 2020
31cbf65
Added sparse vector class to nmod, changed sparse matrix class to use…
kartikv Mar 29, 2020
07b61f2
change #cmakedefine to #cmakedefine01 for HAVE_CPU_SET_T
mahrud Mar 24, 2020
05b52a8
Rebased and merged
kartikv Mar 29, 2020
8f02984
Added sparse vector class to nmod, changed sparse matrix class to use…
kartikv Mar 29, 2020
6de1379
Spacing and cuddling fixed
kartikv Mar 29, 2020
18f39a0
Lost a function in the last commit, fixed
kartikv Mar 29, 2020
693533b
Another lost function
kartikv Mar 29, 2020
070ec4d
Working LU code (with test) and direct solving
kartikv Mar 31, 2020
8111815
Added code to construct reduced row echelon form and associated solve…
kartikv Apr 1, 2020
502acdf
Now with additional utilities, more correct basic functions, and null…
kartikv Apr 2, 2020
ed47162
Added nullvector functions for Lanzcos, everything for basic Wiedemann
kartikv Apr 2, 2020
2cb2ea8
Created sparse vector and matrix utilities for all the fq variants
kartikv Apr 8, 2020
69a9be7
Fixed spacing
kartikv Apr 8, 2020
23d2c4e
Fixed bug in multiply, block Lanczos now works for solving (but not f…
kartikv Apr 9, 2020
51b5584
Now with working block Wiedemann (and nullspace for both block methods)
kartikv Apr 9, 2020
cd80b7a
Added rst documentation for sparse vectors and matrices
kartikv Apr 10, 2020
2e35dec
Most of the desired code for sparse integer linear algebra, except fo…
kartikv Apr 29, 2020
7323a4b
Fixed spacing issues
kartikv Apr 29, 2020
8c07eec
Cleaned up some tests
kartikv Apr 29, 2020
f8f4b76
Changed mods -> smod, need to change function name later
kartikv Apr 30, 2020
e0448b7
Initial code for sparse matrices mod limb size integers, just constru…
kartikv Mar 26, 2020
c451471
Added sparse vector class to nmod, changed sparse matrix class to use…
kartikv Mar 29, 2020
3907bdc
Rebased and merged
kartikv Mar 29, 2020
d618a89
Added sparse vector class to nmod, changed sparse matrix class to use…
kartikv Mar 29, 2020
5780424
Spacing and cuddling fixed
kartikv Mar 29, 2020
70ae8c1
Lost a function in the last commit, fixed
kartikv Mar 29, 2020
83d12cf
Added code to construct reduced row echelon form and associated solve…
kartikv Apr 1, 2020
f7e1519
Now with additional utilities, more correct basic functions, and null…
kartikv Apr 2, 2020
36cef5f
Added nullvector functions for Lanzcos, everything for basic Wiedemann
kartikv Apr 2, 2020
e2bc114
Created sparse vector and matrix utilities for all the fq variants
kartikv Apr 8, 2020
559f691
Fixed spacing
kartikv Apr 8, 2020
ff58185
Fixed bug in multiply, block Lanczos now works for solving (but not f…
kartikv Apr 9, 2020
7638bff
Now with working block Wiedemann (and nullspace for both block methods)
kartikv Apr 9, 2020
58cee49
Added rst documentation for sparse vectors and matrices
kartikv Apr 10, 2020
aae4174
Most of the desired code for sparse integer linear algebra, except fo…
kartikv Apr 29, 2020
fd54b32
Fixed spacing issues
kartikv Apr 29, 2020
8c6b44a
Added copyrights, resizing, and some asserts
May 24, 2021
af5c2b5
Removed some duplicate functions, re-added templates to cmake list
May 24, 2021
6175549
Added fmpz_mod_mat to cmakelists
May 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 10 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,15 @@ endif()
# Find sources

set(BUILD_DIRS
aprcl ulong_extras long_extras perm fmpz fmpz_vec fmpz_poly
fmpq_poly fmpz_mat fmpz_lll mpfr_vec mpfr_mat mpf_vec mpf_mat nmod_vec nmod_poly
nmod_poly_factor arith mpn_extras nmod_mat fmpq fmpq_vec fmpq_mat padic
fmpz_poly_q fmpz_poly_mat nmod_poly_mat fmpz_mod_poly fmpz_mod_mat
aprcl ulong_extras long_extras perm fmpz fmpz_vec fmpz_sparse_vec fmpz_poly
fmpq_poly fmpz_mat fmpz_sparse_mat fmpz_mod_mat fmpz_lll mpfr_vec mpfr_mat mpf_vec mpf_mat nmod_vec nmod_sparse_vec nmod_poly
nmod_poly_factor arith mpn_extras nmod_mat nmod_sparse_mat fmpq fmpq_vec fmpq_mat padic
fmpz_poly_q fmpz_poly_mat nmod_poly_mat fmpz_mod_poly
fmpz_mod_poly_factor fmpz_factor fmpz_poly_factor fft qsieve
double_extras d_vec d_mat padic_poly padic_mat qadic
fq fq_vec fq_mat fq_poly fq_poly_factor
fq_nmod fq_nmod_vec fq_nmod_mat fq_nmod_poly fq_nmod_poly_factor
fq_zech fq_zech_vec fq_zech_mat fq_zech_poly fq_zech_poly_factor
fq_default fq_default_mat fq_default_poly fq_default_poly_factor
fq fq_vec fq_sparse_vec fq_mat fq_sparse_mat fq_poly fq_poly_factor
fq_nmod fq_nmod_vec fq_nmod_sparse_vec fq_nmod_mat fq_nmod_sparse_mat fq_nmod_poly fq_nmod_poly_factor
fq_zech fq_zech_vec fq_zech_sparse_vec fq_zech_mat fq_zech_sparse_mat fq_zech_poly fq_zech_poly_factor
thread_pool fmpz_mod fmpz_mod_vec n_poly
mpoly fmpz_mpoly fmpq_mpoly nmod_mpoly fq_nmod_mpoly fmpz_mod_mpoly
fmpz_mpoly_factor fmpq_mpoly_factor nmod_mpoly_factor fmpz_mod_mpoly_factor
Expand All @@ -77,14 +76,14 @@ set(BUILD_DIRS
)

set(TEMPLATE_DIRS
fq_vec_templates fq_mat_templates fq_poly_templates
fq_vec_templates fq_sparse_vec_templates fq_mat_templates fq_sparse_mat_templates fq_poly_templates
fq_poly_factor_templates fq_templates
)

set(SOURCES
printf.c fprintf.c sprintf.c scanf.c fscanf.c sscanf.c clz_tab.c
memory_manager.c version.c profiler.c thread_support.c exception.c
hashmap.c inlines.c fmpz/fmpz.c
heap.c hashmap.c inlines.c fmpz/fmpz.c
)

if (MSVC)
Expand All @@ -97,7 +96,7 @@ endif()

set(HEADERS
NTL-interface.h flint.h longlong.h flint-config.h gmpcompat.h fft_tuning.h
fmpz-conversions.h profiler.h templates.h exception.h hashmap.h
fmpz-conversions.h profiler.h templates.h exception.h heap.h hashmap.h
)

foreach (build_dir IN LISTS BUILD_DIRS TEMPLATE_DIRS)
Expand Down
16 changes: 8 additions & 8 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ QUIET_AR = @echo ' ' AR ' ' $@;

AT=@

BUILD_DIRS = aprcl ulong_extras long_extras perm fmpz fmpz_vec fmpz_poly \
fmpq_poly fmpz_mat fmpz_lll mpfr_vec mpfr_mat mpf_vec mpf_mat nmod_vec nmod_poly \
nmod_poly_factor arith mpn_extras nmod_mat fmpq fmpq_vec fmpq_mat padic \
BUILD_DIRS = aprcl ulong_extras long_extras perm fmpz fmpz_vec fmpz_sparse_vec fmpz_poly \
fmpq_poly fmpz_mat fmpz_sparse_mat fmpz_lll mpfr_vec mpfr_mat mpf_vec mpf_mat nmod_vec nmod_sparse_vec nmod_poly \
nmod_poly_factor arith mpn_extras nmod_mat nmod_sparse_mat fmpq fmpq_vec fmpq_mat padic \
fmpz_poly_q fmpz_poly_mat nmod_poly_mat fmpz_mod_poly \
fmpz_mod_poly_factor fmpz_factor fmpz_poly_factor fft qsieve \
double_extras d_vec d_mat padic_poly padic_mat qadic \
fq fq_vec fq_mat fq_poly fq_poly_factor fq_embed \
fq_nmod fq_nmod_vec fq_nmod_mat fq_nmod_poly fq_nmod_poly_factor fq_nmod_embed \
fq_zech fq_zech_vec fq_zech_mat fq_zech_poly fq_zech_poly_factor fq_zech_embed \
fq fq_vec fq_sparse_vec fq_mat fq_sparse_mat fq_poly fq_poly_factor fq_embed \
fq_nmod fq_nmod_vec fq_nmod_sparse_vec fq_nmod_mat fq_nmod_sparse_mat fq_nmod_poly fq_nmod_poly_factor fq_nmod_embed \
fq_zech fq_zech_vec fq_zech_sparse_vec fq_zech_mat fq_zech_sparse_mat fq_zech_poly fq_zech_poly_factor fq_zech_embed \
fmpz_mod_mat mpoly fmpz_mpoly fmpq_mpoly nmod_mpoly fq_nmod_mpoly \
thread_pool fmpz_mod fmpz_mod_vec fmpz_mod_mpoly fmpz_mod_mpoly_factor \
n_poly fmpz_mpoly_factor fmpq_mpoly_factor nmod_mpoly_factor \
Expand All @@ -27,10 +27,10 @@ TEMPLATE_DIRS = fq_vec_templates fq_mat_templates fq_poly_templates \

export

SOURCES = printf.c fprintf.c sprintf.c scanf.c fscanf.c sscanf.c clz_tab.c memory_manager.c version.c profiler.c thread_support.c exception.c hashmap.c inlines.c
SOURCES = printf.c fprintf.c sprintf.c scanf.c fscanf.c sscanf.c clz_tab.c memory_manager.c version.c profiler.c thread_support.c exception.c heap.c hashmap.c inlines.c
LIB_SOURCES = $(wildcard $(patsubst %, %/*.c, $(BUILD_DIRS))) $(patsubst %, %/*.c, $(TEMPLATE_DIRS))

HEADERS = $(patsubst %, %.h, $(BUILD_DIRS)) NTL-interface.h flint.h longlong.h flint-config.h gmpcompat.h fft_tuning.h fmpz-conversions.h profiler.h templates.h exception.h hashmap.h thread_support.h $(patsubst %, %.h, $(TEMPLATE_DIRS))
HEADERS = $(patsubst %, %.h, $(BUILD_DIRS)) NTL-interface.h flint.h longlong.h flint-config.h gmpcompat.h fft_tuning.h fmpz-conversions.h profiler.h templates.h exception.h heap.h hashmap.h thread_support.h $(patsubst %, %.h, $(TEMPLATE_DIRS))

OBJS = $(patsubst %.c, build/%.o, $(SOURCES))
LIB_OBJS = $(patsubst %, build/%/*.o, $(BUILD_DIRS))
Expand Down
2 changes: 1 addition & 1 deletion config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#cmakedefine01 FLINT_WANT_ASSERT

/* Define if you cpu_set_t in sched.h */
#cmakedefine01 FLINT_USES_CPUSET
#cmakedefine01 HAVE_CPU_SET_T

#cmakedefine01 FLINT_USES_PTHREAD

Expand Down
295 changes: 295 additions & 0 deletions doc/source/fq_nmod_sparse_mat.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,295 @@
.. _fq-nmod-sparse-mat:

**fq_nmod_sparse_mat.h** -- sparse matrixs over finite fields (word-size characteristic)
===============================================================================

Description.

Types, macros and constants
-------------------------------------------------------------------------------

.. type:: fq_nmod_sparse_mat_t

Holds an array of (possibly empty) sparse vectors corresponding to rows in
the matrix

Memory management
--------------------------------------------------------------------------------

.. function:: void fq_nmod_sparse_mat_init(fq_nmod_sparse_mat_t M, slong rows, slong cols, const fq_nmod_ctx_t ctx)

Initializes an empty sparse matrix ``M`` with given number of rows and columns

.. function:: void fq_nmod_sparse_mat_clear(fq_nmod_sparse_mat_t M, const fq_nmod_ctx_t ctx)

Clears the entries of the matrix ``M`` and frees the space allocated for it

.. function:: void fq_nmod_sparse_mat_swap(fq_nmod_sparse_mat_t M1, fq_nmod_sparse_mat_t M2, const fq_nmod_ctx_t ctx)

Swaps two matrices ``M1`` and ``M2`` (no reallocaton)


Instantiation
--------------------------------------------------------------------------------

.. function:: void fq_nmod_sparse_mat_zero(fq_nmod_sparse_mat_t M, const fq_nmod_ctx_t ctx)

Sets matrix ``M`` to zero (the empty sparse matrix)

.. function:: void fq_nmod_sparse_mat_one(fq_nmod_sparse_mat_t M, const fq_nmod_ctx_t ctx)

Sets matrix ``M`` to identity matrix (based on its number of rows)

.. function:: void fq_nmod_sparse_mat_set(fq_nmod_sparse_mat_t N, const fq_nmod_sparse_mat_t M, const fq_nmod_ctx_t ctx)

Makes ``N`` a (deep) copy of ``M``

.. function:: void fq_nmod_sparse_mat_from_entries(fq_nmod_sparse_mat_t M, slong *rows, slong *inds, fq_nmod_struct *vals, slong nnz, const fq_nmod_ctx_t ctx)

Constructs matrix ``M`` from a given sequence of ``rows``, ``cols``, and
corresponding ``vals``, all of length ``nnz``, assumes sorted by rows
with no duplicate (row, col) indices

.. function:: void fq_nmod_sparse_mat_append_col(fq_nmod_sparse_mat_t M, const fq_nmod_struct *v, const fq_nmod_ctx_t ctx)

Add a dense column to the right of the matrix

.. function:: void fq_nmod_sparse_mat_append_row(fq_nmod_sparse_mat_t M, const fq_nmod_sparse_vec_t v, const fq_nmod_ctx_t ctx)

Add a sparse row to the bottom of the matrix


Conversion to/from dense matrix
--------------------------------------------------------------------------------

.. function:: void fq_nmod_sparse_mat_from_dense(fq_nmod_sparse_mat_t M, const fq_nmod_mat_t dM, const fq_nmod_ctx_t ctx)

Converts the dense matrix ``dM`` to a sparse matrix ``M``

.. function:: void fq_nmod_sparse_mat_to_dense(fq_nmod_mat_t dM, const fq_nmod_sparse_mat_t M, const fq_nmod_ctx_t ctx)

Converts the sparse matrix ``M`` to a dense matrix ``dM``

Windows, concatenation, and splitting
--------------------------------------------------------------------------------

.. function:: void fq_nmod_sparse_mat_window_init(fq_nmod_sparse_mat_t window, const fq_nmod_sparse_mat_t M, slong r1, slong c1, slong r2, slong c2, const fq_nmod_ctx_t ctx)

Constructs a window on the sparse matrix ``M`` between rows ``r1`` and ``r2``
and cols ``c1`` and ``c2`` (valid as long as original matrix remains unmodified)

.. function:: void fq_nmod_sparse_mat_window_clear(fq_nmod_sparse_mat_t window, const fq_nmod_ctx_t ctx)

Clears a window

.. function:: void fq_nmod_sparse_mat_concat_horizontal(fq_nmod_sparse_mat_t B, const fq_nmod_sparse_mat_t M1, const fq_nmod_sparse_mat_t M2, const fq_nmod_ctx_t ctx)

Horizontally concatenates two matrices ``M1`` and ``M2`` into block matrix ``B``

.. function:: void fq_nmod_sparse_mat_concat_vertical(fq_nmod_sparse_mat_t B, const fq_nmod_sparse_mat_t M1, const fq_nmod_sparse_mat_t M2, const fq_nmod_ctx_t ctx)

Vertically concatenates two matrices ``M1`` and ``M2`` into block matrix ``B``

.. function:: void fq_nmod_sparse_mat_split_horizontal(fq_nmod_sparse_mat_t M1, fq_nmod_sparse_mat_t M2, const fq_nmod_sparse_mat_t B, slong c, const fq_nmod_ctx_t ctx)

Splits ``B`` horizontally into two submatrices ``M1`` and ``M2``, dividing at column ``c``

.. function:: void fq_nmod_sparse_mat_split_vertical(fq_nmod_sparse_mat_t M1, fq_nmod_sparse_mat_t M2, const fq_nmod_sparse_mat_t B, slong r, const fq_nmod_ctx_t ctx)

Splits ``B`` vertically into two submatrices ``M1`` and ``M2``, dividing at row ``r``


Permutation
--------------------------------------------------------------------------------

.. function:: void fq_nmod_sparse_mat_permute_cols(fq_nmod_sparse_mat_t M, slong *Q, const fq_nmod_ctx_t ctx)

Permutes the columns indices of ``M`` according to ``Q``, and re-sorts each row

.. function:: void fq_nmod_sparse_mat_permute_rows(fq_nmod_sparse_mat_t M, slong *P, const fq_nmod_ctx_t ctx)

Permutes the rows of ``M`` according to ``P``


Randomization
--------------------------------------------------------------------------------


.. function:: void fq_nmod_sparse_mat_randtest(fq_nmod_sparse_mat_t M, flint_rand_t state, slong min_nnz, slong max_nnz, const fq_nmod_ctx_t ctx)

Makes ``M`` a sparse matrix with between ``min_nnz`` and ``max_nnz`` nonzero
entries per row, with individual entries generated by fq_nmod_randtest


Output
--------------------------------------------------------------------------------

.. function:: void fq_nmod_sparse_mat_print_pretty(const fq_nmod_sparse_mat_t M, const fq_nmod_ctx_t ctx)

Prints the matrix ``M`` to ``stdout`` in a human-readable format


Comparison
--------------------------------------------------------------------------------

.. function:: void fq_nmod_sparse_is_zero(fq_nmod_sparse_mat_t M, const fq_nmod_ctx_t ctx)

Checks if the given matrix ``M`` is trivial (empty), returning `1` if so and `0`
otherwise

.. function:: void fq_nmod_sparse_mat_equal(const fq_nmod_sparse_mat_t M1, const fq_nmod_sparse_mat_t M2, slong ioff, const fq_nmod_ctx_t ctx)

Checks if ``M1`` equals ``M2``, returning `1` if so and `0` otherwise


Transpose
--------------------------------------------------------------------------------

.. function:: void fq_sparse_mat_transpose(fq_nmod_sparse_mat_t N, const fq_nmod_sparse_mat_t M, const fq_nmod_ctx_t ctx)

Transposes ``M`` into the matrix ``N`` (must have swapped rows and columns)


Arithmetic
--------------------------------------------------------------------------------

.. function:: void fq_nmod_sparse_mat_neg(fq_nmod_sparse_mat_t N, const fq_nmod_sparse_mat_t M, const fq_nmod_ctx_t ctx)

Sets ``N`` to the negation of ``M``

.. function:: void fq_nmod_sparse_mat_scalar_mul_fq_nmod(fq_nmod_sparse_mat_t N, const fq_nmod_sparse_mat_t M, const fq_nmod_t c, const fq_nmod_ctx_t ctx)

Sets ``N`` to the scalar multiple of ``M`` by ``c``

.. function:: void fq_nmod_sparse_mat_add(fq_nmod_sparse_mat_t O, const fq_nmod_sparse_mat_t M, const fq_nmod_sparse_mat_t N, const fq_nmod_ctx_t ctx)

Sets ``O`` to the sum of ``M`` and ``N``

.. function:: void fq_nmod_sparse_mat_sub(fq_nmod_sparse_mat_t O, const fq_nmod_sparse_mat_t M, const fq_nmod_sparse_mat_t N, const fq_nmod_ctx_t ctx)

Sets ``O`` to the difference of ``M`` and ``N``

.. function:: void fq_nmod_sparse_mat_scalar_addmul_fq_nmod(fq_nmod_sparse_mat_t O, const fq_nmod_sparse_mat_t M, const fq_nmod_sparse_mat_t N, const fq_nmod_t c, const fq_nmod_ctx_t ctx)

Sets ``O`` to the sum of ``M`` and ``c` times ``N``

.. function:: void fq_nmod_sparse_mat_scalar_submul_fq_nmod(fq_nmod_sparse_mat_t O, const fq_nmod_sparse_mat_t M, const fq_nmod_sparse_mat_t N, const fq_nmod_t c, const fq_nmod_ctx_t ctx)

Sets ``O`` to the difference of ``M`` and ``N` times ``v``

.. function:: void fq_nmod_sparse_mat_mul_vec(fq_nmod_struct *y, const fq_nmod_sparse_mat_t M, const fq_nmod_struct *x, const fq_nmod_ctx_t ctx)

Sets ``y`` to the product of ``M`` and ``x``

.. function:: void fq_nmod_sparse_mat_mul_mat(fq_nmod_mat_t Y, const fq_nmod_sparse_mat_t M, const fq_nmod_mat_t X, const fq_nmod_ctx_t ctx)

Sets ``Y`` to the product of ``M`` and ``X``

.. function:: slong fq_nmod_sparse_mat_inv(fq_nmod_sparse_mat_t N, const fq_nmod_sparse_mat_t M, const fq_nmod_ctx_t ctx)

Sets ``N`` to the "inverse" of ``M``, i.e., the matrix such that NM is
in reduced row-echelon form


Decomposition/reduction
--------------------------------------------------------------------------------

.. function:: slong fq_nmod_sparse_mat_lu(slong *P, slong *Q, fq_nmod_sparse_mat_t L, fq_nmod_sparse_mat_t U, const fq_nmod_sparse_mat_t M, const fq_nmod_ctx_t ctx)

Computes the decomposition PMQ = LU for a given sparse matrix ``M``, where
``P`` is a row permutation, ``Q`` is a column permutation, ``L``is a lower
triangular matrix, and ``U`` is an upper triangular matrix

.. function:: void fq_nmod_sparse_mat_rref(fq_nmod_sparse_mat_t M, const fq_nmod_ctx_t ctx)

Applies row reduction to put ``M`` in reduced row echelon form (in place)

Solving
--------------------------------------------------------------------------------

.. function:: int fq_nmod_sparse_mat_solve_lu(fq_nmod_struct *x, const fq_nmod_sparse_mat_t M, const fq_nmod_struct *b, const fq_nmod_ctx_t ctx)

Given a matrix ``M`` and target vector ``b``, use LU decomposition to find
a vector ``x`` such that Mx = b, returns `1` if successful and `0` if not

.. function:: int fq_nmod_sparse_mat_solve_rref(fq_nmod_struct *x, const fq_nmod_sparse_mat_t M, const fq_nmod_struct *b, const fq_nmod_ctx_t ctx)

Given a matrix ``M`` and target vector ``b``, use the reduced row-echelon
form to find a vector ``x`` such that Mx = b, returns `1` if successful and
`0` if not

.. function:: int fq_nmod_sparse_mat_solve_lanczos(fq_nmod_struct *x, const fq_nmod_sparse_mat_t M, const fq_nmod_struct *b, flint_rand_t state, const fq_nmod_ctx_t ctx)

Given a matrix ``M`` and target vector ``b``, use the Lanczos algorithm to
find a vector ``x`` such that Mx = b, returns `1` if successful and `0` if not

.. function:: int fq_nmod_sparse_mat_solve_wiedemann(fq_nmod_struct *x, const fq_nmod_sparse_mat_t M, const fq_nmod_struct *b, const fq_nmod_ctx_t ctx)

Given a matrix ``M`` and target vector ``b``, use the Wiedemann algorithm to
find a vector ``x`` such that Mx = b, returns `1` if successful and `0` if not

.. function:: int fq_nmod_sparse_mat_solve_block_lanczos(fq_nmod_struct *x, const fq_nmod_sparse_mat_t M, const fq_nmod_struct *b, slong block_size, flint_rand_t state, const fq_nmod_ctx_t ctx)

Given a matrix ``M`` and target vector ``b``, use Coppersmith's block Lanczos
algorithm (with specified block size) to find a vector ``x`` such that Mx = b,
returns `1` if successful and `0` if not

.. function:: int fq_nmod_sparse_mat_solve_block_wiedemann(fq_nmod_struct *x, const fq_nmod_sparse_mat_t M, const fq_nmod_struct *b, slong block_size, flint_rand_t state, const fq_nmod_ctx_t ctx)

Given a matrix ``M`` and target vector ``b``, use Coppersmith's block Wiedemann
algorithm (with specified block size) to find a vector ``x`` such that Mx = b,
returns `1` if successful and `0` if not

Nullvector and nullspace computation
--------------------------------------------------------------------------------

.. function:: int fq_nmod_sparse_mat_nullvector_lanczos(fq_nmod_struct *x, const fq_nmod_sparse_mat_t M, flint_rand_t state, const fq_nmod_ctx_t ctx)

Given a matrix ``M``, use the Lanczos algorithm to find a nullvector ``x``
s.t. Mx = 0, returns `1` if successful and `0` if not

.. function:: int fq_nmod_sparse_mat_nullvector_wiedemann(fq_nmod_struct *x, const fq_nmod_sparse_mat_t M, flint_rand_t state, const fq_nmod_ctx_t ctx)

Given a matrix ``M``, use the Wiedemann algorithm to find a nullvector ``x``
s.t. Mx = 0, returns `1` if successful and `0` if not

.. function:: int fq_nmod_sparse_mat_nullvector_block_lanczos(fq_nmod_struct *x, const fq_nmod_sparse_mat_t M, slong block_size, flint_rand_t state, const fq_nmod_ctx_t ctx)

Given a matrix ``M``, use Coppersmith's block Lanczos algorithm to find a
nullvector ``x`` s.t. Mx = 0, returns `1` if successful and `0` if not

.. function:: int fq_nmod_sparse_mat_nullvector_block_wiedemann(fq_nmod_struct *x, const fq_nmod_sparse_mat_t M, slong block_size, flint_rand_t state, const fq_nmod_ctx_t ctx)

Given a matrix ``M``, use Coppersmith's block Wiedemann algorithm to find a
nullvector ``x`` s.t. Mx = 0, returns `1` if successful and `0` if not

.. function:: int fq_nmod_sparse_mat_nullspace_rref(fq_nmod_mat_t X, const fq_nmod_sparse_mat_t M, const fq_nmod_ctx_t ctx)

Given a matrix ``M``, use the reduced row echelon form to construct the
nullspace ``X`` of M (initialized by this function), returns the nullity

.. function:: int fq_nmod_sparse_mat_nullspace_lu(fq_nmod_mat_t X, const fq_nmod_sparse_mat_t M, const fq_nmod_ctx_t ctx)

Given a matrix ``M``, use the LU decomposition to construct the nullspace ``X``
of M (initialized by this function), returns the nullity

.. function:: int fq_nmod_sparse_mat_nullspace_lanczos(fq_nmod_mat_t X, const fq_nmod_sparse_mat_t M, flint_rand_t state, const fq_nmod_ctx_t ctx)

Given a matrix ``M``, use the Lanczos algorithm to find a nullspace ``X``
of M (initialized by this function), returns the found nullity

.. function:: int fq_nmod_sparse_mat_nullspace_wiedemann(fq_nmod_mat_t X, const fq_nmod_sparse_mat_t M, flint_rand_t state, const fq_nmod_ctx_t ctx)

Given a matrix ``M``, use the Wiedemann algorithm to find a nullspace ``X``
of M (initialized by this function), returns the found nullity

.. function:: int fq_nmod_sparse_mat_nullspace_block_lanczos(fq_nmod_mat_t X, const fq_nmod_sparse_mat_t M, slong block_size, flint_rand_t state, const fq_nmod_ctx_t ctx)

Given a matrix ``M``, use Coppersmith's block Lanczos algorithm to find a
nullspace ``X`` of M (initialized by this function), returns the found nullity

.. function:: int fq_nmod_sparse_mat_nullspace_block_wiedemann(fq_nmod_mat_t X, const fq_nmod_sparse_mat_t M, slong block_size, flint_rand_t state, const fq_nmod_ctx_t ctx)

Given a matrix ``M``, use Coppersmith's block Wiedemann algorithm to find a
nullspace ``X`` of M (initialized by this function), returns the found nullity

Loading