Awali
Another Weighted Automata library
|
#include <reduce.hh>
Public Types | |
using | q_weight_t = sttc::q::value_t |
using | r_weight_t = sttc::r::value_t |
using | z_weight_t = sttc::z::value_t |
Specializations for Q and R. More... | |
Public Member Functions | |
reductioner (const automaton_t &input) | |
void | bottom_up_reduction (std::vector< vector_t > &basis, unsigned *permutation) |
Apply reduction to vectors of the basis to maximize the number of zeros. More... | |
unsigned | find_pivot (const vector_t &v, unsigned begin, unsigned *permutation) |
Return the first (w.r.t the column permutation) non zero element as pivot. More... | |
unsigned | find_pivot_by_norm (const vector_t &v, unsigned begin, unsigned *permutation) |
output_automaton_t | get_output () const |
void | left_reduce () |
Core algorithm This algorithm computes a basis of I.mu(w). More... | |
void | linear_representation () |
Create the linear representation of the input. More... | |
void | normalisation_vector (vector_t &v, unsigned pivot, unsigned *permutation) |
Normalize the basis vector such that its pivot is equal to 1. More... | |
void | product_vector_matrix (const vector_t &v, const matrix_t &m, vector_t &res) |
Computes the product of a row vector with a matrix. More... | |
weight_t | reduce_vector (vector_t &vbasis, vector_t ¤t, unsigned b, unsigned *permutation) |
Reduce a vector w.r.t. More... | |
weight_t | scalar_product (const vector_t &v, const vector_t &w) |
Computes the scalar product of two vectors. More... | |
void | vector_in_new_basis (std::vector< vector_t > &basis, vector_t ¤t, vector_t &new_vector, unsigned *permutation) |
Compute the coordinate of a vector in the new basis. More... | |
void | z_reduce_vector (vector_t &vbasis, vector_t ¤t, unsigned nb, unsigned *permutation) |
void | z_vector_in_new_basis (std::vector< vector_t > &basis, vector_t ¤t, vector_t &new_vector, unsigned *permutation) |
Static Public Member Functions | |
static z_weight_t | gcd (z_weight_t x, z_weight_t y, z_weight_t &a, z_weight_t &b) |
static unsigned | norm (const q_weight_t &w) |
static double | norm (const r_weight_t &w) |
Norm for real numbers; a "stable" pivot should minimize this norm. More... | |
static unsigned | norm (const z_weight_t &w) |
Norm for integers. More... | |
using awali::sttc::internal::reductioner< Aut, AutOutput >::q_weight_t = sttc::q::value_t |
using awali::sttc::internal::reductioner< Aut, AutOutput >::r_weight_t = sttc::r::value_t |
using awali::sttc::internal::reductioner< Aut, AutOutput >::z_weight_t = sttc::z::value_t |
Specializations for Q and R.
awali::sttc::internal::reductioner< Aut, AutOutput >::reductioner | ( | const automaton_t & | input | ) |
void awali::sttc::internal::reductioner< Aut, AutOutput >::bottom_up_reduction | ( | std::vector< vector_t > & | basis, |
unsigned * | permutation | ||
) |
Apply reduction to vectors of the basis to maximize the number of zeros.
unsigned awali::sttc::internal::reductioner< Aut, AutOutput >::find_pivot | ( | const vector_t & | v, |
unsigned | begin, | ||
unsigned * | permutation | ||
) |
Return the first (w.r.t the column permutation) non zero element as pivot.
unsigned awali::sttc::internal::reductioner< Aut, AutOutput >::find_pivot_by_norm | ( | const vector_t & | v, |
unsigned | begin, | ||
unsigned * | permutation | ||
) |
|
static |
output_automaton_t awali::sttc::internal::reductioner< Aut, AutOutput >::get_output | ( | ) | const |
void awali::sttc::internal::reductioner< Aut, AutOutput >::left_reduce | ( | ) |
Core algorithm This algorithm computes a basis of I.mu(w).
The basis is scaled. An automaton where states correspond to the vectors of this basis is built
void awali::sttc::internal::reductioner< Aut, AutOutput >::linear_representation | ( | ) |
Create the linear representation of the input.
|
static |
|
static |
Norm for real numbers; a "stable" pivot should minimize this norm.
|
static |
Norm for integers.
void awali::sttc::internal::reductioner< Aut, AutOutput >::normalisation_vector | ( | vector_t & | v, |
unsigned | pivot, | ||
unsigned * | permutation | ||
) |
Normalize the basis vector such that its pivot is equal to 1.
void awali::sttc::internal::reductioner< Aut, AutOutput >::product_vector_matrix | ( | const vector_t & | v, |
const matrix_t & | m, | ||
vector_t & | res | ||
) |
Computes the product of a row vector with a matrix.
weight_t awali::sttc::internal::reductioner< Aut, AutOutput >::reduce_vector | ( | vector_t & | vbasis, |
vector_t & | current, | ||
unsigned | b, | ||
unsigned * | permutation | ||
) |
Reduce a vector w.r.t.
a vector of the basis.
When this method is called, in vbasis and current, all the entries that come before (w.r.t the permutation) the pivot are zero. Moreover, vbasis[pivot]=1 This method computes current := current - current[pivot].vbasis
weight_t awali::sttc::internal::reductioner< Aut, AutOutput >::scalar_product | ( | const vector_t & | v, |
const vector_t & | w | ||
) |
Computes the scalar product of two vectors.
void awali::sttc::internal::reductioner< Aut, AutOutput >::vector_in_new_basis | ( | std::vector< vector_t > & | basis, |
vector_t & | current, | ||
vector_t & | new_vector, | ||
unsigned * | permutation | ||
) |
Compute the coordinate of a vector in the new basis.
void awali::sttc::internal::reductioner< Aut, AutOutput >::z_reduce_vector | ( | vector_t & | vbasis, |
vector_t & | current, | ||
unsigned | nb, | ||
unsigned * | permutation | ||
) |
void awali::sttc::internal::reductioner< Aut, AutOutput >::z_vector_in_new_basis | ( | std::vector< vector_t > & | basis, |
vector_t & | current, | ||
vector_t & | new_vector, | ||
unsigned * | permutation | ||
) |