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


C# IVector类代码示例

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


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

示例1: Test

        /// <summary>
        /// �����U���̌����s���D
        /// </summary>
        /// <param name="set1">����ΏۂƂȂ鐔�l�Q</param>
        /// <param name="set2">����ΏۂƂȂ鐔�l�Q</param>
        /// <param name="level">�L�Ӑ���</param>
        /// <param name="p">p�l���i�[�����iout�j</param>
        /// <param name="f">���蓝�v�ʁi��Βl�j���i�[�����iout�j</param>
        /// <returns>true�̏ꍇ�́u�L�Ӎ�����v�Cfalse�̏ꍇ�́u�L�Ӎ������v��Ӗ�����</returns>
        public static bool Test(IVector set1, IVector set2, double level, out double p, out double f)
        {
            int size1 = set1.Size;
            int size2 = set2.Size;
            if (size1 < 2 || size2 < 2)
            {
                throw new Exception.IllegalArgumentException();
            }

            // ���v��
            double u1 = set1.Variance;
            double u2 = set2.Variance;

            int dof1, dof2;

            if (u1 > u2)
            {
                f = u1 / u2;
                dof1 = size1 - 1;
                dof2 = size2 - 1;
            }
            else
            {
                f = u2 / u1;
                dof1 = size2 - 1;
                dof2 = size1 - 1;
            }

            p = GSL.Functions.cdf_fdist_Q(f, dof1, dof2);

            return p <= level;
        }
开发者ID:ryujimiya,项目名称:HPlaneWGSimulator,代码行数:41,代码来源:VarTest.cs

示例2: ArcByCenterPointStartPointSweepAngle

 public IArcEntity ArcByCenterPointStartPointSweepAngle(IPointEntity centerPoint, IPointEntity startPoint, double sweepAngle, IVector normal)
 {
     DSGeometryApplication.Check();
     double radius = startPoint.DistanceTo(centerPoint);
     double startAngle = 30;
     return new ArcEntity(centerPoint, normal, radius, startAngle, sweepAngle);
 }
开发者ID:samuto,项目名称:designscript,代码行数:7,代码来源:GeometryFactory.cs

示例3: MismatchSize

 /// <summary>
 /// �����Ɏw�肳�ꂽ�x�N�g���̃T�C�Y����v���邱�Ƃ𒲂ׂ�D
 /// </summary>
 /// <param name="v1"></param>
 /// <param name="v2"></param>
 /// <exception cref="Exception.MismatchSizeException">
 /// �x�N�g���̃T�C�Y����v���Ȃ��Ƃ���throw�����D
 /// </exception>
 public static void MismatchSize(IVector v1, IVector v2)
 {
     if (v1.Size != v2.Size)
     {
         throw new Exception.MismatchSizeException();
     }
 }
开发者ID:ryujimiya,项目名称:HPlaneWGSimulator,代码行数:15,代码来源:VectorUtils.cs

示例4: ZeroSize

 /// <summary>
 /// �����Ɏw�肳�ꂽ�x�N�g���̃T�C�Y��0�łȂ����Ƃ𒲂ׂ�D
 /// </summary>
 /// <param name="v"></param>
 /// <exception cref="Exception.ZeroSizeException">
 /// �x�N�g���T�C�Y��0�̏ꍇ��throw�����D
 /// </exception>
 public static void ZeroSize(IVector v)
 {
     if (v.Size == 0)
     {
         throw new Exception.ZeroSizeException();
     }
 }
开发者ID:ryujimiya,项目名称:HPlaneWGSimulator,代码行数:14,代码来源:VectorUtils.cs

示例5: Cross

 public static Vector Cross(IVector v1, IVector v2)
 {
     return new Vector(
         v1.Y * v2.Z - v1.Z * v2.Y,
         v1.Z * v2.X - v1.X * v2.Z,
         v1.X * v2.Y - v1.Y * v2.X);
 }
开发者ID:tomswedlund,项目名称:Renderer,代码行数:7,代码来源:Vector.cs

示例6: LinearlyIndependentOf

 public static bool LinearlyIndependentOf(this IVector v, params IVector[] vecs)
 {
     IVector[] temp = new IVector[vecs.Length + 1];
     Array.Copy(vecs, temp, vecs.Length);
     temp[vecs.Length] = v;
     return VecOps.LinearlyIndependent(temp);
 }
开发者ID:SSheldon,项目名称:veccalc,代码行数:7,代码来源:VecOps.cs

示例7: InternalCompute

		protected override void InternalCompute(IVector array, bool periodic)
		{
			int len = array.Length;
			int N = periodic ? len : len - 1;
			for (int i = 0; i < len; ++i)
				array[i] = 1 - RMath.Pow2((2 * i - N) / (double)N);
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:7,代码来源:WelchWindow.cs

示例8: ArcEntity

 internal ArcEntity(IPointEntity center, IVector normal, double radius, double startAngle, double sweepAngle)
 {
     this.CenterPoint = center;
     this.Normal = normal;
     this.Radius = radius;
     this.StartAngle = startAngle;
     this.SweepAngle = sweepAngle;
 }
开发者ID:samuto,项目名称:designscript,代码行数:8,代码来源:ArcHost.cs

示例9: Test

        /// <summary>
        /// �ꕽ�ςɑ΂��镽�ϒl�̌����s���D
        /// </summary>
        /// <param name="set">����ΏۂƂȂ鐔�l�Q</param>
        /// <param name="population">�ꕽ��</param>
        /// <param name="level">�L�Ӑ���</param>
        /// <param name="p">p�l���i�[�����iout�j</param>
        /// <param name="t">t�l���i�[�����iout�j</param>
        /// <returns>true�̏ꍇ�́u�L�Ӎ�����v�Cfalse�̏ꍇ�́u�L�Ӎ������v��Ӗ�����</returns>
        public static bool Test(IVector set, double population, double level, out double p, out double t)
        {
            VectorChecker.ZeroSize(set);

            t = (set.Average - population) / Math.Sqrt(set.Variance);
            p = GSL.Functions.cdf_tdist_Q(Math.Abs(t), set.Size - 1);
            return p <= level;
        }
开发者ID:ryujimiya,项目名称:HPlaneWGSimulator,代码行数:17,代码来源:TTest.cs

示例10: RVector

		public RVector(IVector source)
		{
			if (source != null)
			{
				Position = source.Position;
				Direction = source.Direction;
			}
		}
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:8,代码来源:IVector.cs

示例11: InternalCompute

		protected override void InternalCompute(IVector array, bool periodic)
		{
			int len = array.Length;
			int N = periodic ? len : len - 1;
			double scale = 2 * Math.PI / N;
			for (int i = 0; i < len; ++i)
				array[i] = 0.54 - 0.46 * Math.Cos(i * scale);
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:8,代码来源:HammingWindow.cs

示例12: InternalCompute

		protected override void InternalCompute(IVector array, bool periodic)
		{
			int len = array.Length;
			int N = periodic ? len : len - 1;
			double scale = 2 * Math.PI / N;
			double N2 = N / 2.0;
			for (int i = 0; i < len; ++i)
				array[i] = 0.5 * (1 + Math.Cos((i - N2) * scale));
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:9,代码来源:VonHannWindow.cs

示例13: Multiply

 public static Vector Multiply(IVector v, double c)
 {
     double[] components = new double[v.Count];
     for (int i = 0; i < components.Length; i++)
     {
         components[i] = v[i] * c;
     }
     return new Vector(components);
 }
开发者ID:SSheldon,项目名称:veccalc,代码行数:9,代码来源:Vector.cs

示例14: Mul

 public IFuzzyNumber Mul(IVector x)
 {
     var res = this[0].Mul(x[0]);
     for (int i = 1; i < _values.Length; i++)
     {
         res.Set(res.Sum(this[i].Mul(x[i])));
     }
     return res;
 }
开发者ID:Diover,项目名称:nets,代码行数:9,代码来源:Vector.cs

示例15: Subtract

 public static Vector Subtract(IVector a, IVector b)
 {
     if (a.Count != b.Count) throw new ArgumentException();
     double[] components = new double[a.Count];
     for (int i = 0; i < components.Length; i++)
     {
         components[i] = a[i] - b[i];
     }
     return new Vector(components);
 }
开发者ID:SSheldon,项目名称:veccalc,代码行数:10,代码来源:Vector.cs


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