当前位置: 首页>>代码示例>>C#>>正文


C# cExtendedTable类代码示例

本文整理汇总了C#中cExtendedTable的典型用法代码示例。如果您正苦于以下问题:C# cExtendedTable类的具体用法?C# cExtendedTable怎么用?C# cExtendedTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


cExtendedTable类属于命名空间,在下文中一共展示了cExtendedTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run

        public cFeedBackMessage Run()
        {
            ToReturn = new cExtendedTable(this.Widht,this.Height,0);

            RND = new Random(this.Seed);

            if (this.DistributionType == eRandDistributionType.UNIFORM)
            {

                foreach (cExtendedList item in ToReturn)
                    for (int i = 0; i < item.Count; i++)
                        item[i] = RND.NextDouble() * (Max - Min) + Min;
            }
            else if (this.DistributionType == eRandDistributionType.GAUSSIAN)
            {
                foreach (cExtendedList item in ToReturn)
                    for (int i = 0; i < item.Count; i++)
                    {
                        double u1 = RND.NextDouble();
                        double u2 = RND.NextDouble();
                        double randStdNormal = Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2);
                        item[i] = this.Mean + this.Stdev * randStdNormal;
                    }
            }
            else
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "Distribution Type not implemented";
            }

            return FeedBackMessage;
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:32,代码来源:cRandomGenerator.cs

示例2: Run

        public cFeedBackMessage Run()
        {
            base.Start();

            // Here is the right way for accessing the parameters...
            // a little laborious, but that's the price to pay for a complete interface
            object _firstValue = base.ListProperties.FindByName("First Paramater");
            double firstValue = 0;
            if (_firstValue == null)
            {
                base.GenerateError("First Paramater not found !");
                return base.FeedBackMessage;
            }
            try
            {
                cProperty TmpProp = (cProperty)_firstValue;
                firstValue = (double)TmpProp.GetValue();
            }
            catch (Exception)
            {
                base.GenerateError("First Paramater cast didn't work");
                return base.FeedBackMessage;
            }

            ToReturn = new cExtendedTable((int)firstValue, (int)firstValue, 0);

            base.End();
            return FeedBackMessage;
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:29,代码来源:cBetaComponent.cs

示例3: Run

        public cFeedBackMessage Run()
        {
            if (this.Input == null)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "No input data defined.";
                return FeedBackMessage;
            }

            this.OutPut = new cExtendedTable(this.Input);
            cRandomGenerator RG = new cRandomGenerator(this.Input.Count, this.Input[0].Count);
            RG.Seed = (int)System.DateTime.Now.Ticks;
            RG.Min = this.Min;
            RG.Max = this.Max;
            RG.Mean = this.Mean;
            RG.Stdev = this.Stdv;
            RG.DistributionType = this.DistributionType;

            FeedBackMessage = RG.Run();
            if (FeedBackMessage.IsSucceed == false)
            {
                return FeedBackMessage;
            }

            cArithmetic_DualOperator DO = new cArithmetic_DualOperator();
            DO.SetInputData(this.Input, RG.GetOutPut());
            DO.OperationType = eBinaryOperationType.ADD;
            DO.Run();

            this.OutPut = DO.GetOutPut();
            this.OutPut.Name = "Add Noise(" + this.Input.Name + ")";

            return FeedBackMessage;
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:34,代码来源:cAddNoise.cs

示例4: Run

        public cFeedBackMessage Run()
        {
            if(this.Input==null)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "No input data";
            }

            this.OutPut = new cExtendedTable(this.Input);
            this.OutPut[0].Name = "X";
            this.OutPut.Add(new cExtendedList());
            this.OutPut[1].Name = "Sigmoid(X)";

            foreach (var item in this.Input)
            {
                //double Value = Bottom +
                //    ( (Top - Bottom) / (1 + Math.Pow(10, (Math.Log10(EC50) - item) * Slope) ) );

                double Value = Bottom + (Top - Bottom) / (1 + Math.Pow((EC50 / item),Slope));

                this.OutPut[1].Add(Value);
                        /// (1 + Math.Pow((Math.Pow(10, EC50) / Math.Pow(10, /*ResultFit.GetLogConcentrations()*/item)), Slope)));
            }

            //for (int IdxConc = 0; IdxConc < this.Input[0].Count; IdxConc++)
            // {
            //    Y_Estimated.Add(c[0] + (c[1] - c[0]) / (1 + Math.Pow((Math.Pow(10, c[2]) / Math.Pow(10, /*ResultFit.GetLogConcentrations()*/this.Input[0][IdxConc])), c[3])));
            //    //   ResultFit.Y_Estimated.Add(c[0] + (c[1] - c[0]) / (1 + Math.Pow(((c[2]) /  ResultFit.GetLogConcentrations()[IdxConc]), c[3])));
            // }

            return FeedBackMessage;
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:32,代码来源:cDataGeneratorSigmoid.cs

示例5: Run

        public cFeedBackMessage Run()
        {
            this.Output = new cExtendedTable();
            this.Output.Tag = this.ListObjects.Tag;
            this.Output.Name = "3D View Associated Data Table";
                if(this.ListObjects.Name!=null)
                    this.Output.Name += this.ListObjects.Name;
            this.Output.ListTags = new List<object>();
            this.Output.ListRowNames = new List<string>();

            this.Output.Add(new cExtendedList("X"));
            this.Output.Add(new cExtendedList("Y"));
            this.Output.Add(new cExtendedList("Z"));

            foreach (var item in this.ListObjects)
            {
                this.Output[0].Add(item.GetPosition().X);
                this.Output[1].Add(item.GetPosition().Y);
                this.Output[2].Add(item.GetPosition().Z);
                this.Output.ListTags.Add(item.Tag);
                this.Output.ListRowNames.Add(item.GetName());
            }

            return FeedBackMessage;
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:25,代码来源:cTableFrom3DObjects.cs

示例6: Process

        private cFeedBackMessage Process()
        {
            this.Output = new cExtendedTable(this.Input);

            //int IDxCOl = 0;
               // foreach (cExtendedList item in this.Output)
            for (int IDxCOl = 0; IDxCOl < this.Output.Count; IDxCOl++)
            {
                this.Output[IDxCOl] = Input[IDxCOl].Normalize(this.NormalizationType);
            }

            switch (this.NormalizationType)
            {
                case eNormalizationType.STANDARDIZE :
                    this.Output.Name = "Standardize(" + this.Input.Name + ")";
                    break;
                case eNormalizationType.MIN_MAX:
                    this.Output.Name = "MinMax(" + this.Input.Name + ")";
                    break;
                case eNormalizationType.SHIFT_TO_MEAN:
                    this.Output.Name = "Shift To Mean(" + this.Input.Name + ")";
                    break;
                case eNormalizationType.SHIFT_TO_MEDIAN:
                    this.Output.Name = "Shift To Median(" + this.Input.Name + ")";
                    break;
                case eNormalizationType.SHIFT_TO_MIN:
                    this.Output.Name = "Shift To Min(" + this.Input.Name + ")";
                    break;
                default:
                    break;
            }

            return base.FeedBackMessage;
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:34,代码来源:cNormalize.cs

示例7: Run

        public cFeedBackMessage Run()
        {
            if (this.Input == null)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "No input data defined.";
                return FeedBackMessage;
            }

            OutPutList = new cExtendedList();
            OutPutList.ListTags = new List<object>();
            for (int i = 0; i < this.Input.Count; i++)
            {
                for (int j = 0; j < this.Input[0].Count; j++)
                {
                    OutPutList.Add(this.Input[i][j]);
                }
                if (this.Input[i].ListTags != null)
                {

                    for (int j = 0; j < this.Input[i].Count; j++)
                        OutPutList.ListTags.Add(this.Input[i].ListTags[j]);
                }
            }

            this.OutPut = new cExtendedTable(OutPutList);
            this.OutPut.Name = "Linearize(" + this.Input.Name + ")";

            return FeedBackMessage;
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:30,代码来源:cLinearize.cs

示例8: Process

        private void Process()
        {
            this.OutPut = new cExtendedTable();
            double Value = double.NaN;
            this.OutPut.ListRowNames = new List<string>();

            this.OutPut.Name = "Z-Factor(s)";

            for (int IdxCol = 0; IdxCol < this.Input.Count; IdxCol++)
            {
                this.OutPut.ListRowNames.Add(this.Input[IdxCol].Name);
                cExtendedList NewResult = new cExtendedList();
                NewResult.Name = this.Input[IdxCol].Name;
                for (int IdxColBis = 0; IdxColBis < this.Input.Count; IdxColBis++)
                {
                    if (IdxCol != IdxColBis)
                        Value = this.Input[IdxCol].ZFactor(this.Input[IdxColBis], this.IsRobust);
                    else
                        Value = double.NaN;

                    //if (double.IsInfinity(Value)) Value = 1;

                    NewResult.Add(Value);
                }
                this.OutPut.Add(NewResult);
            }

            base.Info = "Z-Factor (";
            if (IsRobust) base.Info +=  "Robust) - ";
            else
                base.Info += "Regular) - ";

            base.Info += this.Input[0].Count + " vs. " + this.Input[1].Count + " values.";
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:34,代码来源:cZFactor.cs

示例9: Run

        public cFeedBackMessage Run()
        {
            if(this.Input == null)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "No input data defined.";
                return FeedBackMessage;
            }

            OutPut = new cExtendedTable(this.Input);
            this.OutPut.ListRowNames = null;

            int NumberOfColumnsRemoved = 0;
            int RealIdx = 0;
            for (int i = 0; i < this.Input.Count; i++)
            {
                if ((this.Input[i].Count <= this.MinNumberOfData) || (this.Input[i].Count >= this.MaxNumberOfData))
                {
                    this.OutPut.RemoveAt(RealIdx);
                    NumberOfColumnsRemoved++;
                    RealIdx--;
                }
                RealIdx++;
            }

            this.OutPut.Name = "Clean(" + this.Input.Name + ")";

            FeedBackMessage.Message = NumberOfColumnsRemoved + " columns removed";
            return FeedBackMessage;
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:30,代码来源:cClean.cs

示例10: Run

        public cFeedBackMessage Run()
        {
            if (this.Input == null)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "No input data defined.";
                return FeedBackMessage;
            }
            // ------------- now proceed -------------

            this.OutPut = new cExtendedTable();
            this.OutPut.ListRowNames = new List<string>();

            this.OutPut.Name = "Student's t-Test";

            if (FTestTails == eFTestTails.BOTH)
                this.OutPut.Name += " (both tails)";
            else if (FTestTails == eFTestTails.LEFT)
                this.OutPut.Name += " (left tail)";
            else if (FTestTails == eFTestTails.RIGHT)
                this.OutPut.Name += " (right tail)";

            for (int IdxCol = 0; IdxCol < this.Input.Count; IdxCol++)
            {
                this.OutPut.ListRowNames.Add(this.Input[IdxCol].Name);
                cExtendedList NewResult = new cExtendedList();
                NewResult.Name = this.Input[IdxCol].Name;
                for (int IdxColBis = 0; IdxColBis < this.Input.Count; IdxColBis++)
                {
                    double bothtails;
                    double lefttail;
                    double righttail;

                    if(this.IsUnequalVariance)
                        alglib.unequalvariancettest(this.Input[IdxCol].ToArray(), this.Input[IdxCol].Count, this.Input[IdxColBis].ToArray(), this.Input[IdxColBis].Count, out bothtails, out lefttail, out righttail);
                    else
                        alglib.studentttest2(this.Input[IdxCol].ToArray(), this.Input[IdxCol].Count, this.Input[IdxColBis].ToArray(), this.Input[IdxColBis].Count, out bothtails, out lefttail, out righttail);

                    //alglib.mannwhitneyutest(

                    if (FTestTails == eFTestTails.BOTH)
                        NewResult.Add(bothtails);
                    else if (FTestTails == eFTestTails.LEFT)
                        NewResult.Add(lefttail);
                    else if (FTestTails == eFTestTails.RIGHT)
                        NewResult.Add(righttail);

                }
                this.OutPut.Add(NewResult);
            }

               return FeedBackMessage;
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:53,代码来源:cStudent_tTest.cs

示例11: Run

        public cFeedBackMessage Run()
        {
            if (this.Input == null)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "No input defined.";
                return FeedBackMessage;
            }

            if (this.ColumnIndexForSorting >= this.Input.Count)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "Sorting column index exceed table size.";
                return FeedBackMessage;
            }
            Process();

            this.Output = new cExtendedTable(this.Input);
            this.Output.Name = "Sorted "+this.Input.Name;

            int IdxCol = 0;
            foreach (var item in this.Input)
            {
                this.Output[IdxCol].Tag = item.Tag;
                IdxCol++;
            }

            for (IdxCol = 0; IdxCol < this.Input.Count; IdxCol++)
            {
                for (int IdxRow = 0; IdxRow < RefList.Count; IdxRow++)
                    this.Output[IdxCol][IdxRow] = this.Input[IdxCol][RefList[IdxRow].Index];

                if ((this.Input[IdxCol].ListTags != null) && (this.Input[IdxCol].ListTags.Count>0))
                {
                    for (int IdxRow = 0; IdxRow < RefList.Count; IdxRow++)
                        this.Output[IdxCol].ListTags[IdxRow] = this.Input[IdxCol].ListTags[RefList[IdxRow].Index];
                }
            }

            for (int IdxRow = 0; IdxRow < this.Input.ListRowNames.Count; IdxRow++)
                this.Output.ListRowNames[IdxRow] = this.Input.ListRowNames[RefList[IdxRow].Index];

            if (this.Input.ListTags != null)
            {
                for (int IdxRow = 0; IdxRow < this.Input.ListTags.Count; IdxRow++)
                    this.Output.ListTags[IdxRow] = this.Input.ListTags[RefList[IdxRow].Index];
            }

            return FeedBackMessage;
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:50,代码来源:cSort.cs

示例12: Project

        private void Project()
        {
            Matrix NewPt = new Matrix(this.DataToProject[0].Count, this.DataToProject.Count);
            NewPt = DataToProject.CopyToWEKAMatrix().multiply(this.Basis.CopyToWEKAMatrix());
            ProjectedData = new cExtendedTable(NewPt);

            int Idx=0;
            foreach (var item in DataToProject)
            {
                ProjectedData[Idx].Name = Basis.ListRowNames[Idx];
                Idx++;
            }

            ProjectedData.ListRowNames.AddRange(DataToProject.ListRowNames);
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:15,代码来源:cLinearProjector.cs

示例13: Run

        public cFeedBackMessage Run()
        {
            if (this.Input == null)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "No input data defined.";
                return FeedBackMessage;
            }

            //if (Info != 1)
            //{
            //    FeedBackMessage.IsSucceed = false;
            //    FeedBackMessage.Message = "Error while inversing the matrix";
            //    return FeedBackMessage;
            //}

            this.OutPut = new cExtendedTable(this.Input[0].Count, this.Input.Count, 0);

            if (Input[0].ListTags != null)
            {
                foreach (var item in this.OutPut)
                {
                    item.ListTags = new List<object>();
                }
            }

            this.OutPut.ListRowNames = new List<string>();

            for (int i = 0; i < this.Input.Count; i++)
            {
                this.OutPut.ListRowNames.Add(this.Input[i].Name);
                for (int j = 0; j < this.Input[i].Count; j++)
                {
                    this.OutPut[j][i] = this.Input[i][j];
                    if (this.Input[i].ListTags != null) this.OutPut[j].ListTags.Add(this.Input[i].ListTags[j]);
                }
            }

            if (this.Input.ListRowNames != null)
            {
                for (int i = 0; i < this.Input.ListRowNames.Count; i++)
                    this.OutPut[i].Name = this.Input.ListRowNames[i];
            }

            this.OutPut.Name = "Transpose(" + this.Input.Name + ")";

            return FeedBackMessage;
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:48,代码来源:cTranspose.cs

示例14: GetPropertyTable

        public cExtendedTable GetPropertyTable()
        {
            cExtendedTable ToReturn = new cExtendedTable();
            ToReturn.Name = this.Name + " - Properties";

            cExtendedList Properties = new cExtendedList("Properties");

            ToReturn.Add(Properties);
            ToReturn.ListRowNames = new List<string>();


            ToReturn.ListRowNames.Add("Dimension X");
            Properties.Add(this.Width);
            ToReturn.ListRowNames.Add("Dimension Y");
            Properties.Add(this.Height);
            ToReturn.ListRowNames.Add("Dimension Z");
            Properties.Add(this.Depth);

            ToReturn.ListRowNames.Add("Voxel Size X");
            Properties.Add(this.Resolution.X);
            ToReturn.ListRowNames.Add("Voxel Size Y");
            Properties.Add(this.Resolution.Y);
            ToReturn.ListRowNames.Add("Voxel Size Z");
            Properties.Add(this.Resolution.Z);

            ToReturn.ListRowNames.Add("Position X");
            Properties.Add(this.Position.X);
            ToReturn.ListRowNames.Add("Position Y");
            Properties.Add(this.Position.Y);
            ToReturn.ListRowNames.Add("Position Z");
            Properties.Add(this.Position.Z);


            ToReturn.ListRowNames.Add("Channel Numbers");
            Properties.Add(this.GetNumChannels());

            for (int i = 0; i < this.GetNumChannels(); i++)
            {
                ToReturn.ListRowNames.Add(this.SingleChannelImage[i].Name + " - Wavelenght");
                Properties.Add(i);
            }



            return ToReturn;

        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:47,代码来源:cImage.cs

示例15: Run

        public cFeedBackMessage Run()
        {
            if (this.Input == null)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "No input data defined.";
                return FeedBackMessage;
            }
            if (this.Input.Count != this.Input[0].Count)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "A square matrix is required for this operation";
                return FeedBackMessage;
            }

            // ------------- now proceed -------------
            int Info;

            double[,] Mat = this.Input.CopyToArray();
            alglib.rmatrixinverse(ref Mat, out Info, out Report);

            if (Info != 1)
            {
                FeedBackMessage.IsSucceed = false;
                FeedBackMessage.Message = "Error while inversing the matrix";
                return FeedBackMessage;
            }

            this.OutPut = new cExtendedTable(Mat);

            if (this.Input.ListRowNames != null)
            {
                this.OutPut.ListRowNames = new List<string>();
                this.OutPut.ListRowNames.AddRange(this.Input.ListRowNames.ToArray());
            }

            int IdxCOl=0;
            foreach (var item in this.Input)
            {
                this.OutPut[IdxCOl++].Name = item.Name;
            }

            this.OutPut.Name = "Inverse(" + this.Input.Name + ")";

            return FeedBackMessage;
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:46,代码来源:cInverse.cs


注:本文中的cExtendedTable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。