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


C# LinearAlgebra.ComplexFloatVector类代码示例

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


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

示例1: InternalCompute

    /// <summary>Performs the QR factorization.</summary>
    protected override void InternalCompute() 
    {
      int m = matrix.Rows;
      int n = matrix.Columns;
      
#if MANAGED
      int minmn = m < n ? m : n;
      r_ = new ComplexFloatMatrix(matrix); // create a copy
      ComplexFloatVector[] u = new ComplexFloatVector[minmn];
      for (int i = 0; i < minmn; i++) 
      {
        u[i] = Householder.GenerateColumn(r_, i, m - 1, i);
        Householder.UA(u[i], r_, i, m - 1, i + 1, n - 1);
      }
      q_ = ComplexFloatMatrix.CreateIdentity(m);
      for (int i = minmn - 1; i >= 0; i--) 
      {
        Householder.UA(u[i], q_, i, m - 1, i, m - 1);
      }
#else
      qr = ComplexFloatMatrix.ToLinearComplexArray(matrix);
      jpvt = new int[n];
      jpvt[0] = 1;
      Lapack.Geqp3.Compute(m, n, qr, m, jpvt, out tau);
      r_ = new ComplexFloatMatrix(m, n);
      // Populate R

      for (int i = 0; i < m; i++) {
        for (int j = 0; j < n; j++) {
          if (i <= j) {
            r_.data[j * m + i] = qr[(jpvt[j]-1) * m + i];
          }
          else {
            r_.data[j * m + i] = ComplexFloat.Zero;
          }
        }
      }

      q_ = new ComplexFloatMatrix(m, m);
      for (int i = 0; i < m; i++) {
        for (int j = 0; j < m; j++) {
          if (j < n)
            q_.data[j * m + i] = qr[j * m + i];
          else
            q_.data[j * m + i] = ComplexFloat.Zero;
        }
      }
      if( m < n ){
        Lapack.Ungqr.Compute(m, m, m, q_.data, m, tau);
      } else{
        Lapack.Ungqr.Compute(m, m, n, q_.data, m, tau);
      }
#endif
      for (int i = 0; i < m; i++) 
      {
        if (q_[i, i] == 0)
          isFullRank = false;
      }
    }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:60,代码来源:ComplexFloatQRDecomp.cs

示例2: CtorDimensions

		public void CtorDimensions()
		{
			ComplexFloatVector test = new ComplexFloatVector(2);

			Assert.AreEqual(test.Length, 2);
			Assert.AreEqual(test[0], (ComplexFloat)0);
			Assert.AreEqual(test[1], (ComplexFloat)0);
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:8,代码来源:ComplexFloatVectorTest.cs

示例3: CtorInitialValues

		public void CtorInitialValues()
		{
			ComplexFloatVector test = new ComplexFloatVector(2, (ComplexFloat)1);

			Assert.AreEqual(test.Length, 2);
			Assert.AreEqual(test[0], (ComplexFloat)1);
			Assert.AreEqual(test[1], (ComplexFloat)1);
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:8,代码来源:ComplexFloatVectorTest.cs

示例4: CurrentException2

 public void CurrentException2() 
 {
   ComplexFloatVector test = new ComplexFloatVector(new ComplexFloat[2]{1f,2f});
   IEnumerator enumerator = test.GetEnumerator();
   enumerator.MoveNext();
   enumerator.MoveNext();
   enumerator.MoveNext();
   object value=enumerator.Current;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:9,代码来源:ComplexFloatVectorEnumeratorTest.cs

示例5: CtorArray

		public void CtorArray()
		{
			float[] testvector = new float[2] { 0, 1 };

			ComplexFloatVector test = new ComplexFloatVector(testvector);
			Assert.AreEqual(test.Length, testvector.Length);
			Assert.AreEqual(test[0], (ComplexFloat)testvector[0]);
			Assert.AreEqual(test[1], (ComplexFloat)testvector[1]);
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:9,代码来源:ComplexFloatVectorTest.cs

示例6: Current

 public void Current()
 {
   ComplexFloatVector test = new ComplexFloatVector(new ComplexFloat[2]{1f,2f});
   IEnumerator enumerator = test.GetEnumerator();
   bool movenextresult;
   
   movenextresult=enumerator.MoveNext();
   Assert.IsTrue(movenextresult);
   Assert.AreEqual(enumerator.Current,test[0]);
   
   movenextresult=enumerator.MoveNext();
   Assert.IsTrue(movenextresult);
   Assert.AreEqual(enumerator.Current,test[1]);
   
   movenextresult=enumerator.MoveNext();
   Assert.IsFalse(movenextresult);
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:17,代码来源:ComplexFloatVectorEnumeratorTest.cs

示例7: ZeroLengthVectorTestsforConstructor1

 public void ZeroLengthVectorTestsforConstructor1()
 {
   ComplexFloatVector cfv = new ComplexFloatVector(1);
   cfv.RemoveAt(0);
   ComplexFloatLevinson cfl = new ComplexFloatLevinson(cfv, cfv);
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:6,代码来源:ComplexFloatLevinsonTest.cs

示例8: FirstElementTestforStaticInverse

 public void FirstElementTestforStaticInverse()
 {
   ComplexFloatVector cfv = new ComplexFloatVector(3, 1.0f);
   ComplexFloatMatrix X = ComplexFloatLevinson.Inverse(cfv, TR3);
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:5,代码来源:ComplexFloatLevinsonTest.cs

示例9: SingularTestforStaticSolveMatrix

 public void SingularTestforStaticSolveMatrix()
 {
   ComplexFloatVector cfv = new ComplexFloatVector(3, 1.0f);
   ComplexFloatMatrix X = ComplexFloatLevinson.Solve(cfv, cfv, ComplexFloatMatrix.CreateIdentity(3));
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:5,代码来源:ComplexFloatLevinsonTest.cs

示例10: ZeroVectorLengthTestforStaticSolveMatrix

 public void ZeroVectorLengthTestforStaticSolveMatrix()
 {
   ComplexFloatVector LC = new ComplexFloatVector(1);
   LC.RemoveAt(0);
   ComplexFloatMatrix X = ComplexFloatLevinson.Solve(LC, TR10, ComplexFloatMatrix.CreateIdentity(10));
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:6,代码来源:ComplexFloatLevinsonTest.cs

示例11: FirstElementTestforStaticSolveVector

 public void FirstElementTestforStaticSolveVector()
 {
   ComplexFloatVector cfv = new ComplexFloatVector(3, 1.0f);
   ComplexFloatVector X = ComplexFloatLevinson.Solve(cfv, TR3, Y3);
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:5,代码来源:ComplexFloatLevinsonTest.cs

示例12: SetupTestCases

    public void SetupTestCases()
    {
      // unit testing values - order 1

      LC1 = new ComplexFloatVector(1);
      LC1[0] = new ComplexFloat(+1.0000000E+000f, +1.0000000E+000f);

      TR1 = new ComplexFloatVector(1);
      TR1[0] = new ComplexFloat(+1.0000000E+000f, +1.0000000E+000f);

      L1 = new ComplexFloatMatrix(1);
      L1[0, 0] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);

      D1 = new ComplexFloatVector(1);
      D1[0] = new ComplexFloat(+5.0000000E-001f, -5.0000000E-001f);

      U1 = new ComplexFloatMatrix(1);
      U1[0, 0] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);

      Det1 = new ComplexFloat(+1.0000000E+000f, +1.0000000E+000f);

      I1 = new ComplexFloatMatrix(1);
      I1[0, 0] = new ComplexFloat(+5.0000000E-001f, -5.0000000E-001f);

      X1 = new ComplexFloatVector(1);
      X1[0] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);

      Y1 = new ComplexFloatVector(1);
      Y1[0] = new ComplexFloat(+1.0000000E+000f, +1.0000000E+000f);

      // unit testing values - order 2

      LC2 = new ComplexFloatVector(2);
      LC2[0] = new ComplexFloat(+3.0000000E+000f, +3.0000000E+000f);
      LC2[1] = new ComplexFloat(+2.0000000E+000f, +0.0000000E+000f);

      TR2 = new ComplexFloatVector(2);
      TR2[0] = new ComplexFloat(+3.0000000E+000f, +3.0000000E+000f);
      TR2[1] = new ComplexFloat(+2.0000000E+000f, +0.0000000E+000f);

      L2 = new ComplexFloatMatrix(2);
      L2[0, 0] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);
      L2[1, 0] = new ComplexFloat(-3.3333333E-001f, +3.3333333E-001f);
      L2[1, 1] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);

      D2 = new ComplexFloatVector(2);
      D2[0] = new ComplexFloat(+1.6666667E-001f, -1.6666667E-001f);
      D2[1] = new ComplexFloat(+1.2352941E-001f, -1.9411765E-001f);

      U2 = new ComplexFloatMatrix(2);
      U2[0, 0] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);
      U2[0, 1] = new ComplexFloat(-3.3333333E-001f, +3.3333333E-001f);
      U2[1, 1] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);

      Det2 = new ComplexFloat(-4.0000000E+000f, +1.8000000E+001f);

      I2 = new ComplexFloatMatrix(2);
      I2[0, 0] = new ComplexFloat(+1.2352941E-001f, -1.9411765E-001f);
      I2[0, 1] = new ComplexFloat(+2.3529412E-002f, +1.0588235E-001f);
      I2[1, 0] = new ComplexFloat(+2.3529412E-002f, +1.0588235E-001f);
      I2[1, 1] = new ComplexFloat(+1.2352941E-001f, -1.9411765E-001f);

      X2 = new ComplexFloatVector(2);
      X2[0] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);
      X2[1] = new ComplexFloat(+2.0000000E+000f, +0.0000000E+000f);

      Y2 = new ComplexFloatVector(2);
      Y2[0] = new ComplexFloat(+7.0000000E+000f, +3.0000000E+000f);
      Y2[1] = new ComplexFloat(+8.0000000E+000f, +6.0000000E+000f);

      // unit testing values - order 3

      LC3 = new ComplexFloatVector(3);
      LC3[0] = new ComplexFloat(+3.0000000E+000f, +3.0000000E+000f);
      LC3[1] = new ComplexFloat(+2.0000000E+000f, +0.0000000E+000f);
      LC3[2] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);

      TR3 = new ComplexFloatVector(3);
      TR3[0] = new ComplexFloat(+3.0000000E+000f, +3.0000000E+000f);
      TR3[1] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);
      TR3[2] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);

      L3 = new ComplexFloatMatrix(3);
      L3[0, 0] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);
      L3[1, 0] = new ComplexFloat(-3.3333333E-001f, +3.3333333E-001f);
      L3[1, 1] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);
      L3[2, 0] = new ComplexFloat(-1.7073171E-001f, -3.6585366E-002f);
      L3[2, 1] = new ComplexFloat(-2.9878049E-001f, +3.1097561E-001f);
      L3[2, 2] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);

      D3 = new ComplexFloatVector(3);
      D3[0] = new ComplexFloat(+1.6666667E-001f, -1.6666667E-001f);
      D3[1] = new ComplexFloat(+1.4634146E-001f, -1.8292683E-001f);
      D3[2] = new ComplexFloat(+1.4776571E-001f, -1.9120527E-001f);

      U3 = new ComplexFloatMatrix(3);
      U3[0, 0] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);
      U3[0, 1] = new ComplexFloat(-1.6666667E-001f, +1.6666667E-001f);
      U3[1, 1] = new ComplexFloat(+1.0000000E+000f, +0.0000000E+000f);
      U3[0, 2] = new ComplexFloat(-1.5243902E-001f, +1.2804878E-001f);
//.........这里部分代码省略.........
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:101,代码来源:ComplexFloatLevinsonTest.cs

示例13: StaticMultiplyMatrixNonConformVector

 public void StaticMultiplyMatrixNonConformVector()
 {
   ComplexFloatMatrix a = new ComplexFloatMatrix(2);
   ComplexFloatVector b = new ComplexFloatVector(3, 2.0f);
   ComplexFloatVector c = a * b;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:6,代码来源:ComplexFloatMatrixTest.cs

示例14: StaticMultiplyMatrixVector

 public void StaticMultiplyMatrixVector()
 {
   ComplexFloatMatrix a = new ComplexFloatMatrix(2);
   a[0,0] = new ComplexFloat(1);
   a[0,1] = new ComplexFloat(2);
   a[1,0] = new ComplexFloat(3);
   a[1,1] = new ComplexFloat(4);
   ComplexFloatVector b = new ComplexFloatVector(2, 2.0f);
   ComplexFloatVector c = ComplexFloatMatrix.Multiply(a,b);
   Assert.AreEqual(c[0],new ComplexFloat(6));
   Assert.AreEqual(c[1],new ComplexFloat(14));
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:12,代码来源:ComplexFloatMatrixTest.cs

示例15: OperatorMultiplyNullMatrixVector

 public void OperatorMultiplyNullMatrixVector()
 {
   ComplexFloatMatrix a = null;
   ComplexFloatVector b = new ComplexFloatVector(2, 2.0f);
   ComplexFloatVector c = a * b;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:6,代码来源:ComplexFloatMatrixTest.cs


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