/*public VilenkinTransform(List<int> p, int blockSize) { * this.expansionBase = new ExpansionBase(p); * this.blockSize = blockSize; * this.K = CountK(); * xs = ConstIntervalsUtils.Intervals(expansionBase, K); * this.P = expansionBase.Pk(K); * ParyX[] subXs; * this.N = new Complex(1d / p.ElementAt(K), 0); * rademacherMatrixes = new List<RademaxerMatrix>(); * for (int i = 0; i < expansionBase.Mk(K); i++) { * subXs = ArrayUtils.SubArray(xs, i * P, P); * rademacherMatrixes.Add(new RademaxerMatrix(expansionBase, subXs, K, N)); * } * vilenkinXs = ConstIntervalsUtils.Intervals(expansionBase, K - 1); * conjugatedWMatrix = MatrixUtils<Complex>.Conjugate(MatrixUtils<Complex>.BuildVilenkin(expansionBase, vilenkinXs)); * MatrixUtils<Complex>.Multiply(conjugatedWMatrix, new Complex(1d / expansionBase.Mk(K), 0)); * vilenkinFunctions = new Dictionary<int, VilenkinFunction>(); * for (int i = 0; i < expansionBase.Mk(K + 1); i++) { * vilenkinFunctions.Add(i, new VilenkinFunction(expansionBase, new ParyN(expansionBase, i))); * } * }*/ public VilenkinTransform(List <int> p, int K) { this.expansionBase = new ExpansionBase(p); this.K = K; xs = ConstIntervalsUtils.Intervals(expansionBase, K); this.blockSize = expansionBase.Mk(K + 1); this.P = expansionBase.Pk(K); ParyX[] subXs; this.N = new Complex(1d / p.ElementAt(K), 0); rademacherMatrixes = new List <RademaxerMatrix>(); for (int i = 0; i < expansionBase.Mk(K); i++) { subXs = ArrayUtils.SubArray(xs, i * P, P); rademacherMatrixes.Add(new RademaxerMatrix(expansionBase, subXs, K, N)); } vilenkinXs = ConstIntervalsUtils.Intervals(expansionBase, K - 1); conjugatedWMatrix = MatrixUtils <Complex> .Conjugate(MatrixUtils <Complex> .BuildVilenkin(expansionBase, vilenkinXs)); MatrixUtils <Complex> .Multiply(conjugatedWMatrix, new Complex(1d / expansionBase.Mk(K), 0)); vilenkinFunctions = new Dictionary <int, VilenkinFunction>(); for (int i = 0; i < expansionBase.Mk(K + 1); i++) { vilenkinFunctions.Add(i, new VilenkinFunction(expansionBase, new ParyN(expansionBase, i))); } }
private int CountK() { for (int i = 1; i < expansionBase.getMSize(); i++) { if (expansionBase.Mk(i) >= blockSize) { return(i - 1); } } throw new ArgumentException("Размер блока не соотносится ни с одним разбиением, размер блока = " + blockSize + " максимальный размер разбиения = " + expansionBase.Mk(expansionBase.getMSize() - 1)); }