public AlgebraFiniteFieldByte(
            byte prime,
            int power)
        {
            if (!ToolsMathInteger.IsPrime(prime))
            {
                throw new Exception("Number " + prime + " is not prime");
            }

            size = ToolsMathInteger.Pow(prime, power);
        }
Beispiel #2
0
        public double[] evaluate_multi_scale(IFunction <double, double> function, double lower_bound, double upper_bound, int evaluation_levels)
        {
            int    total_interval_count = ToolsMathInteger.Pow(refinenment_scale, evaluation_levels - 1);
            double interval_width       = (upper_bound - lower_bound) / total_interval_count;

            double[] values = new double[total_interval_count + 1];
            for (int value_index = 0; value_index < (total_interval_count + 1); value_index++)
            {
                values[value_index] = function.Compute(lower_bound + (interval_width * value_index));
            }

            double[] results         = new double[evaluation_levels];
            int      sparcety_factor = 1;

            for (int evaluation_level = 0; evaluation_level < evaluation_levels; evaluation_level++)
            {
                results[results.Length - evaluation_level - 1] = evaluate_sparce(lower_bound, upper_bound, values, sparcety_factor);
                sparcety_factor *= refinenment_scale;
            }
            return(results);
        }