linbox
test-local-smith-form-sparseelim.C File Reference
#include <linbox/linbox-config.h>
#include <linbox/util/contracts.h>
#include <linbox/matrix/sparse-matrix.h>
#include <givaro/modular.h>
#include <givaro/modular-ruint.h>
#include <linbox/algorithms/smith-form-sparseelim-local.h>
#include <linbox/algorithms/smith-form-sparseelim-poweroftwo.h>
#include <linbox/solutions/rank.h>
#include <linbox/solutions/smith-form.h>
#include <recint/rint.h>
#include <recint/ruint.h>
#include <linbox/util/commentator.h>
#include <iostream>
#include <linbox/algorithms/matrix-hom.h>
#include <linbox/util/timer.h>

Functions

template<typename Base>
bool check_ranks (const std::vector< std::pair< Base, size_t > > &local, const std::map< int, size_t > &map_values, const Base &p)
 Test 1: Invariant factors of random sparse matrices.
 
template<typename Base, typename SparseMat>
bool sparse_local_smith (SparseMat &B, size_t R, size_t M, size_t N, const Base &p, int exp, const std::map< int, size_t > &map_values)
 
template<typename Base, typename SparseMat>
bool sparse_local_smith_poweroftwo (SparseMat &B, size_t R, size_t M, size_t N, const Base &p, int exp, const std::map< int, size_t > &map_values)
 
template<typename Base, typename Compute = Base>
bool test_sparse_local_smith (size_t seed, size_t R, size_t M, size_t N, const Base &p, int exp, double density)
 
template<size_t K>
bool ruint_test (size_t seed, size_t R, size_t M, size_t N, const Integer &q, int exp, double density)
 
int main (int argc, char **argv)
 

Function Documentation

◆ check_ranks()

template<typename Base>
bool check_ranks ( const std::vector< std::pair< Base, size_t > > & local,
const std::map< int, size_t > & map_values,
const Base & p )

Test 1: Invariant factors of random sparse matrices.

Construct a random matrix with random RPM and random local Smith form. Then uses sparse elimination modulo power of prime.

Return true on success and false on failure

◆ sparse_local_smith()

template<typename Base, typename SparseMat>
bool sparse_local_smith ( SparseMat & B,
size_t R,
size_t M,
size_t N,
const Base & p,
int exp,
const std::map< int, size_t > & map_values )

◆ sparse_local_smith_poweroftwo()

template<typename Base, typename SparseMat>
bool sparse_local_smith_poweroftwo ( SparseMat & B,
size_t R,
size_t M,
size_t N,
const Base & p,
int exp,
const std::map< int, size_t > & map_values )

◆ test_sparse_local_smith()

template<typename Base, typename Compute = Base>
bool test_sparse_local_smith ( size_t seed,
size_t R,
size_t M,
size_t N,
const Base & p,
int exp,
double density )

◆ ruint_test()

template<size_t K>
bool ruint_test ( size_t seed,
size_t R,
size_t M,
size_t N,
const Integer & q,
int exp,
double density )

◆ main()

int main ( int argc,
char ** argv )