本文整理汇总了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;
}
示例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);
}
示例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();
}
}
示例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();
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例10: RVector
public RVector(IVector source)
{
if (source != null)
{
Position = source.Position;
Direction = source.Direction;
}
}
示例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);
}
示例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));
}
示例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);
}
示例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;
}
示例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);
}