本文整理汇总了C#中SparseMatrix.First方法的典型用法代码示例。如果您正苦于以下问题:C# SparseMatrix.First方法的具体用法?C# SparseMatrix.First怎么用?C# SparseMatrix.First使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SparseMatrix
的用法示例。
在下文中一共展示了SparseMatrix.First方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Transfer_Matrix_Explicit_Alpha
//.........这里部分代码省略.........
{
//Biot Porous absorbers
I[i] = Explicit_TMM.Interfacepf_Fluid(LayerList[i + 1].porosity) as SparseMatrix;
J[i] = Explicit_TMM.Interfacepf_Porous(LayerList[i + 1].porosity);
}
else
{
//Solid Layer
I[i] = SparseMatrix.CreateIdentity(4);
J[i] = SparseMatrix.CreateIdentity(4);
}
}
else if ((int)LayerList[i].T == 15 || (int)LayerList[i + 1].T == 16)
{
//Biot Porous absorbers
if ((int)LayerList[i + 1].T <= 10)
{
//Fluid Layer
I[i] = Explicit_TMM.Interfacepf_Porous(LayerList[i].porosity);
J[i] = Explicit_TMM.Interfacepf_Fluid(LayerList[i].porosity);
}
else if ((int)LayerList[i + 1].T == 15 || (int)LayerList[i + 1].T == 16)
{
//Biot Porous absorbers
I[i] = Explicit_TMM.InterfacePP(LayerList[i].porosity, LayerList[i + 1].porosity);//TODO: Check that we have the right porosities in the right places...
J[i] = SparseMatrix.CreateIdentity(6);
}
else
{
//Solid Layer
I[i] = Explicit_TMM.Interfacesp_Porous();
J[i] = Explicit_TMM.Interfacesp_Solid();
}
}
else
{
//Solid Layer
if ((int)LayerList[i + 1].T <= 10)
{
//Fluid Layer
I[i] = Explicit_TMM.InterfaceSF_Solid();
J[i] = Explicit_TMM.InterfaceSF_Fluid();
}
else if ((int)LayerList[i + 1].T == 15 || (int)LayerList[i + 1].T == 16)
{
//Biot Porous absorbers
I[i] = Explicit_TMM.Interfacesp_Solid();
J[i] = Explicit_TMM.Interfacesp_Porous();
}
else
{
//Solid Layer
I[i] = Explicit_TMM.InterfaceSF_Fluid() as SparseMatrix;
J[i] = Explicit_TMM.InterfaceSF_Solid();
}
}
}
//List<SparseMatrix[][]> T = Layer(LayerList.Count - 1, LayerList, K_Air, sintheta_inc, K_Air, c_sound, frequency);
Complex[][] Z = new Complex[sintheta_inc.Length][];
for (int a = 0; a < sintheta_inc.Length; a++)
{
Z[a] = new Complex[sintheta_inc[a].Length];
for(int f = 0; f < sintheta_inc[a].Length; f++)
{
SparseMatrix V;
if (T.First()[a][f].RowCount == 2)
{
V = new SparseMatrix(2, 1);
V[0, 0] = 1;
}
else if (T.First()[a][f].RowCount == 4)
{
V = new SparseMatrix(4, 1);
V[0, 0] = 1;
V[1, 0] = 1;
}
else
{
V = new SparseMatrix(6, 1);
V[0, 0] = 1;
V[1, 0] = 1;
V[2, 0] = 1;
}
for (int i = 0; i < T.Length; i++)
{
V = -((J[i] * T[i][a][f]) * I[i].Inverse() as SparseMatrix) * V;
//V = T[i][a][f] * V;
}
V = -(J.Last() * I.Last().Inverse() as SparseMatrix) * V;
Z[a][f] = V[0, 0] * 100000 / V[1, 0];
}
}
return Z;
}