Commit daed4acb by Laurent Belcour

### Breaking the recursion earlier in the indices2degree function to speed-up...

`Breaking the recursion earlier in the indices2degree function to speed-up calculation of the constraints matrices`
parent 92313844
 ... ... @@ -58,27 +58,6 @@ vec rational_function::value(const vec& x) const return res ; } bool compare(std::vector > a, std::vector b) { bool current = false; for(int i=0; i& vec, int N, int M, int j) { #ifdef OLD vec[0] = M ; if(j == 0) return ; int tj = j ; while(tj != 0) { // First non null index int nn_index = 0; while(vec[nn_index] == 0) { nn_index = (nn_index+1) % N ; } // Index of the place where to append int ap_index = (nn_index + 1) % N ; while(vec[ap_index] == M) { ap_index = (ap_index+1) % N ; } vec[nn_index] -= 1; vec[ap_index] += 1; --tj; } #else // For each dimension, estimate the current level // based on the number of configurations in the // other dimensions ... ... @@ -146,7 +109,6 @@ void populate(std::vector& vec, int N, int M, int j) current_M -= k ; } vec[0] = current_M; #endif } std::vector rational_function::index2degree(int i) const ... ... @@ -207,7 +169,7 @@ double legendre(double x, int i) } } //#define POLYNOMIALS #define POLYNOMIALS // Get the p_i and q_j function double rational_function::p(const vec& x, int i) const ... ...
 ... ... @@ -50,7 +50,7 @@ class rational_function : public QObject, public function void save_rational_function(const std::string& filename) const ; void save_gnuplot(const std::string& filename, const data* d, const arguments& args) const ; // protected: // functions protected: // functions // Convert an index in N to a vector of degree for a // multinomial coeffcient. The resulting vector v should ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!