• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Data.DataColumn类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: DetermineXIncrement

		public static string DetermineXIncrement(DataColumn yColumnToTransform, out double xIncrement)
		{
			xIncrement = 1;
			var coll = DataColumnCollection.GetParentDataColumnCollectionOf(yColumnToTransform);

			if (null == coll)
				return "Can't find parent collection of provided data column to transform";

			var xColD = coll.FindXColumnOf(yColumnToTransform);
			if (null == xColD)
				return "Can't find x-column of provided data column to transform";

			var xCol = xColD as DoubleColumn;
			if (null == xCol)
				return "X-column of provided data column to transform is not a numeric column";

			var spacing = new Calc.LinearAlgebra.VectorSpacingEvaluator(xCol.ToROVector());
			if (!spacing.IsStrictlyMonotonicIncreasing)
				return "X-column of provided column to transform is not monotonically increasing";

			xIncrement = spacing.SpaceMeanValue;

			if (!spacing.IsStrictlyEquallySpaced)
				return "X-Column is not strictly equally spaced, the relative deviation is " + spacing.RelativeSpaceDeviation.ToString();
			else
				return null;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:27,代码来源:AnalysisRealFourierTransformCommands.cs


示例2: MergeTable

		/// <summary>
		/// Merges two tables by corresponding x-columns.
		/// </summary>
		/// <param name="masterTable">Master table. Values from the slave table will be recalculated to fit the x-values of the master table.</param>
		/// <param name="masterXColumn">The master x-column of the master table.</param>
		/// <param name="slaveTable">The table providing the data for merging into the master table.</param>
		/// <param name="slaveXColumn">The x column of the slave table.</param>
		/// <param name="columnsToMerge">Indices of that columns of the slave table that should be merged into the master table.</param>
		/// <param name="createNewTable">If true, a new table is created as a clone of the master table. The data from the slave table are then merged into that clone. If false,
		/// the data are directly merged into the master table.</param>
		/// <returns>If <c>createNewTable</c> is true, then the newly created table. If false, then the provided master table where the data are merge to.</returns>
		public static DataTable MergeTable(
			this DataTable masterTable, DataColumn masterXColumn,
			DataTable slaveTable, DataColumn slaveXColumn,
			Altaxo.Collections.IAscendingIntegerCollection columnsToMerge,
			bool createNewTable)
		{
			DataTable destinationTable;
			if (createNewTable)
				destinationTable = (DataTable)masterTable.Clone();
			else
				destinationTable = masterTable;

			// create a fractional index column with the same length than the master table
			// that points into the slave table

			DoubleColumn fractIndex = GetFractionalIndex(masterXColumn, slaveXColumn);

			MergeTable(masterTable, fractIndex, slaveTable, columnsToMerge);

			return destinationTable;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:32,代码来源:MergeTables.cs


示例3: TenEmptyColumns

    public void TenEmptyColumns()
    {
      DataColumnCollection d = new DataColumnCollection();

      DataColumn[] cols = new DataColumn[10];
      for(int i=0;i<10;i++)
      {
        cols[i] = new DoubleColumn();
        d.Add(cols[i]);
      }

      Assert.AreEqual(10, d.ColumnCount);
      Assert.AreEqual(0, d.RowCount);
      Assert.AreEqual(false, d.IsDirty);
      Assert.AreEqual(false, d.IsSuspended);

      Assert.AreEqual("A", d.GetColumnName(0));
      Assert.AreEqual("A", d[0].Name);

      Assert.AreEqual("J", d.GetColumnName(9));
      Assert.AreEqual("J", d[9].Name);


      // Test index to column resolution
      for(int i=0;i<10;i++)
        Assert.AreEqual(cols[i], d[i]);

      // test name to column resolution

      for(int i=0;i<10;i++)
      {
        char name = (char)('A'+i);
        Assert.AreEqual(cols[i], d[name.ToString()],"Column to name resolution of col " + name.ToString());
      }
      // test column to number resolution
      for(int i=0;i<10;i++)
        Assert.AreEqual(i, d.GetColumnNumber(cols[i]));

    }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:39,代码来源:DataColumnCollection_Test.cs


示例4: FindColumnNode

		private NGTreeNode FindColumnNode(NGTreeNode tableNode, DataColumn column)
		{
			NGTreeNode result = null;
			foreach (NGTreeNode node in tableNode.Nodes)
			{
				if (object.ReferenceEquals(node.Tag, column))
				{
					return node;
				}
				else if (node.HasChilds)
				{
					result = FindColumnNode(node, column);
					if (null != result)
						return result;
				}
			}

			return null;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:19,代码来源:SingleColumnChoiceController.cs


示例5: ShowRealFourierTransformDialog

		public static void ShowRealFourierTransformDialog(DataColumn ycolumnToTransform)
		{
			var options = new RealFourierTransformOptions() { ColumnToTransform = ycolumnToTransform };

			double xIncrementValue;
			options.XIncrementMessage = DetermineXIncrement(ycolumnToTransform, out xIncrementValue);
			options.XIncrementValue = xIncrementValue;

			if (Current.Gui.ShowDialog(ref options, "Choose fourier transform options", false))
			{
				RealFourierTransform(options);
			}
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:13,代码来源:AnalysisRealFourierTransformCommands.cs


示例6: vop_Division_Rev

		public override bool vop_Division_Rev(DataColumn c2, out DataColumn c3)
		{
			if (c2 is Altaxo.Data.DoubleColumn)
			{
				c3 = (Altaxo.Data.DoubleColumn)c2 / this;
				return true;
			}
			c3 = null;
			return false;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:10,代码来源:DoubleColumn.cs


示例7: vop_Multiplication

		public override bool vop_Multiplication(AltaxoVariant c2, out DataColumn c3)
		{
			if (((AltaxoVariant)c2).IsType(AltaxoVariant.Content.VDouble))
			{
				double c22 = (double)c2;
				c3 = this * c22;
				return true;
			}
			c3 = null;
			return false;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:11,代码来源:DoubleColumn.cs


示例8: vop_Decrement

		public override bool vop_Decrement(out DataColumn c3)
		{
			int len = this._count;
			Altaxo.Data.DoubleColumn c33 = new Altaxo.Data.DoubleColumn(len);
			for (int i = 0; i < len; i++)
			{
				c33._data[i] = this._data[i] - 1;
			}
			c33._count = len;
			c3 = c33;
			return true;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:12,代码来源:DoubleColumn.cs


示例9: vop_ShiftRight_Rev

		public override bool vop_ShiftRight_Rev(DataColumn c2, out DataColumn c3)
		{
			if (c2 is Altaxo.Data.DoubleColumn)
			{
				Altaxo.Data.DoubleColumn c1 = this;
				DoubleColumn c22 = (DoubleColumn)c2;
				int len = c1.Count < c2.Count ? c1.Count : c2.Count;
				Altaxo.Data.DoubleColumn c33 = new Altaxo.Data.DoubleColumn(len);
				for (int i = 0; i < len; i++)
				{
					c33._data[i] = ((long)c22._data[i]) >> ((int)c1._data[i]);
				}
				c33._count = len;
				c3 = c33;
				return true;
			}
			c3 = null;
			return false;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:19,代码来源:DoubleColumn.cs


示例10: vop_ShiftLeft

		public override bool vop_ShiftLeft(AltaxoVariant c2, out DataColumn c3)
		{
			if (((AltaxoVariant)c2).IsType(AltaxoVariant.Content.VDouble))
			{
				int c22 = (int)(double)c2;
				c3 = this << c22;
				return true;
			}
			c3 = null;
			return false;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:11,代码来源:DoubleColumn.cs


示例11: vop_Increment

 public override bool vop_Increment(out DataColumn c3)
 {
   int len = this.m_Count;
   Altaxo.Data.DoubleColumn c33 = new Altaxo.Data.DoubleColumn(len);
   for(int i=0;i<len;i++)
   {
     c33.m_Array[i] = this.m_Array[i]+1;
   }
   c33.m_Count = len;
   c3=c33;
   return true;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:12,代码来源:DoubleColumn.cs


示例12: vop_ShiftRight

 public override bool vop_ShiftRight(AltaxoVariant c2, out DataColumn c3)
 {
   if(((AltaxoVariant)c2).IsType(AltaxoVariant.Content.VDouble))
   {
     DoubleColumn c1=this;
     int len = c1.m_Count;
     Altaxo.Data.DoubleColumn c33 = new Altaxo.Data.DoubleColumn(len);
     int c22 = (int)(double)c2;
     for(int i=0;i<len;i++)
       c33.m_Array[i] = ((long)c1.m_Array[i]) >> c22;
     c33.m_Count = len;
     c3=c33;
     return true;
   }
   c3=null;
   return false;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:17,代码来源:DoubleColumn.cs


示例13: vop_ShiftLeft

 public override bool vop_ShiftLeft(DataColumn c2, out DataColumn c3)
 {
   if(c2 is Altaxo.Data.DoubleColumn)
   {
     Altaxo.Data.DoubleColumn c1=this;
     Altaxo.Data.DoubleColumn c22 = (DoubleColumn)c2;
     int len = c1.Count<c2.Count ? c1.Count : c2.Count;
     Altaxo.Data.DoubleColumn c33 = new Altaxo.Data.DoubleColumn(len);
     for(int i=0;i<len;i++)
     {
       c33.m_Array[i] = ((long)c1.m_Array[i]) << ((int)c22.m_Array[i]);
     }
     c33.m_Count=len;
     c3=c33;
     return true;
   }
   c3=null;
   return false;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:19,代码来源:DoubleColumn.cs


示例14: Decompose

		/// <summary>
		/// Decomposes a column into repeat units by analysing the values of the column with increasing index.
		/// If a column value is repeated, the current range is finalized and a new range is started. At the end,
		/// a list of index ranges is returned. Inside each range the column values are guaranteed to be unique.
		/// </summary>
		/// <param name="col">Column to decompose.</param>
		/// <returns>List of integer ranges. Inside a single range the column values are ensured to be unique.</returns>
		public static List<AltaxoVariant> Decompose(DataColumn col)
		{
			var result = new List<AltaxoVariant>();
			var alreadyIn = new HashSet<AltaxoVariant>();
			for (int i = 0; i < col.Count; i++)
			{
				var item = col[i];
				if (!alreadyIn.Contains(item))
				{
					result.Add(item);
					alreadyIn.Add(item);
				}
			}
			return result;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:22,代码来源:DecomposeByColumnContent.cs


示例15: vop_Not

		public override bool vop_Not(out DataColumn c3)
		{
			c3 = !this;
			return true;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:5,代码来源:DoubleColumn.cs


示例16: vop_Complement

		public override bool vop_Complement(out DataColumn c3)
		{
			c3 = ~this;
			return true;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:5,代码来源:DoubleColumn.cs


示例17: vop_Addition_Rev

		public override bool vop_Addition_Rev(DataColumn c2, out DataColumn c3)
		{
			return vop_Addition(c2, out c3);
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:4,代码来源:DoubleColumn.cs


示例18: vop_Greater

		public override bool vop_Greater(DataColumn c2, out DataColumn c3)
		{
			if (c2 is Altaxo.Data.DoubleColumn)
			{
				c3 = this > (Altaxo.Data.DoubleColumn)c2;
				return true;
			}
			c3 = null;
			return false;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:10,代码来源:DoubleColumn.cs


示例19: vop_Multiplication_Rev

		public override bool vop_Multiplication_Rev(DataColumn c2, out DataColumn c3)
		{
			return vop_Multiplication(c2, out c3);
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:4,代码来源:DoubleColumn.cs


示例20: vop_LesserOrEqual

		public override bool vop_LesserOrEqual(DataColumn c2, out DataColumn c3)
		{
			if (c2 is Altaxo.Data.DoubleColumn)
			{
				c3 = this <= (Altaxo.Data.DoubleColumn)c2;
				return true;
			}
			c3 = null;
			return false;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:10,代码来源:DoubleColumn.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Data.DataTable类代码示例发布时间:2022-05-24
下一篇:
C# Data.AltaxoVariant类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap