mirror of
https://github.com/rumata-ap/MatrixExtension_SMathStudio.git
synced 2026-01-11 11:29:47 +03:00
refactoring
This commit is contained in:
@@ -231,8 +231,8 @@ namespace MatrixExtensions
|
|||||||
TNumber tmp = Computation.NumericCalculation(arg1, context);
|
TNumber tmp = Computation.NumericCalculation(arg1, context);
|
||||||
|
|
||||||
List<string> vector = new List<string>(Utilites.EntryMatrix2ArrStr(tmp.obj));
|
List<string> vector = new List<string>(Utilites.EntryMatrix2ArrStr(tmp.obj));
|
||||||
vector.RemoveAt(vector.Count - 1);
|
//vector.RemoveAt(vector.Count - 1);
|
||||||
vector.RemoveAt(vector.Count - 1);
|
//vector.RemoveAt(vector.Count - 1);
|
||||||
List<string> distinct = vector.Distinct().ToList();
|
List<string> distinct = vector.Distinct().ToList();
|
||||||
|
|
||||||
List<Term> answer = new List<Term>();
|
List<Term> answer = new List<Term>();
|
||||||
|
|||||||
15
Utilites.cs
15
Utilites.cs
@@ -16,9 +16,18 @@ namespace MatrixExtensions
|
|||||||
|
|
||||||
internal static string[] EntryMatrix2ArrStr(BaseEntry matrix)
|
internal static string[] EntryMatrix2ArrStr(BaseEntry matrix)
|
||||||
{
|
{
|
||||||
string source = matrix.ToString();
|
TMatrix mt = matrix as TMatrix;
|
||||||
source = source.Trim(new char[] { 'm', 'a', 't', '(', ')' });
|
//int n = mt.unit.GetLength(0);
|
||||||
return source.Split(',');
|
//int m = mt.unit.GetLength(0);
|
||||||
|
List<string> mts = new List<string>(mt.Length());
|
||||||
|
foreach (var item in mt.unit)
|
||||||
|
{
|
||||||
|
mts.Add(item.obj.ToString());
|
||||||
|
}
|
||||||
|
//string source = matrix.ToString();
|
||||||
|
//source = source.Trim(new char[] { 'm', 'a', 't', '(', ')' });
|
||||||
|
//return source.Split(',','\n');
|
||||||
|
return mts.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static double[] EntryVec2Arr(Entry vector)
|
internal static double[] EntryVec2Arr(Entry vector)
|
||||||
|
|||||||
Reference in New Issue
Block a user