public static void WriteVectorWithoutZero(double[] vector) { using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\Users\Patryk\Desktop\Data\VectorWithoutZeros.txt", true)) { for (int i = 0; i < vector.Length; i++) { if (!MyMatrix.CheckIsDoubleZero(vector[i])) { file.WriteLine(String.Format("{0} {1:N16}", i, vector[i])); } } } }
private static void WriteMatixWithoutZerosToFile(double[,] test) { using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\Users\Patryk\Desktop\Data\DataRangeNew.txt", true)) { for (int i = 0; i < test.GetLength(0); i++) { if (!MyMatrix.CheckIsDoubleZero(test[i, 2])) { file.Write(String.Format("{0} {1} {2:N16}", test[i, 0], test[i, 1], test[i, 2])); file.Write("\n"); } } } }