コード例 #1
0
            public double[] GetEnveloppe(int nbEchant)
            {
                int repetCourant = Math.Max(0, (nbEchant - (attaque.GetNbEchants() + fin.GetNbEchants())) / courant.GetNbEchants());
                int echanttotal  = attaque.GetNbEchants() + fin.GetNbEchants() + repetCourant * courant.GetNbEchants();

                double[] retour = new double[echanttotal];
                int      k      = 0;

                for (int i = 0; i < attaque.GetNbEchants(); i++)
                {
                    retour[k] = attaque.GetIntensite(i);
                    k++;
                }
                for (int n = 0; n < repetCourant; n++)
                {
                    for (int i = 0; i < courant.GetNbEchants(); i++)
                    {
                        retour[k] = courant.GetIntensite(i);
                        k++;
                    }
                }
                for (int i = 0; i < fin.GetNbEchants(); i++)
                {
                    retour[k] = fin.GetIntensite(i);
                    k++;
                }
                return(retour);
            }
コード例 #2
0
            public ProfilEnveloppe(List <ProfilEnveloppe> profils)
            {
                nbEchant   = profils.Sum(e => e.nbEchant);
                intensites = new double[nbEchant];
                int k = 0;

                for (int i = 0; i < profils.Count; i++)
                {
                    ProfilEnveloppe pr = profils.ElementAt(i);
                    for (int j = 0; j < pr.nbEchant; j++)
                    {
                        intensites[k] = pr.GetIntensite(j);
                        k++;
                    }
                }
            }