public void RunFloat(GaussType gausstype) { MyMatrix <float> matrix = new MyMatrix <float>(dimensions); Random r = new Random(1234); float num; for (int y = 0; y < dimensions; y++) { matrix.SetVectorB(y, 0); num = (float)(short)r.Next() / 32768; matrix.SetVectorX(y, num); for (int x = 0; x < dimensions; x++) { num = (float)(short)r.Next() / 32768; matrix.SetMatrixA(x, y, num); } } matrix.Multiplication(); Stopwatch sw = new Stopwatch(); switch (gausstype) { case GaussType.Basic: //Console.WriteLine(" bez wyboru elementu podstawowego"); sw.Start(); matrix.CalculateG(); sw.Stop(); time[0] = sw.Elapsed.TotalMilliseconds; diff[0] = matrix.CalculateDiff(); break; case GaussType.Part: //Console.WriteLine(" z czesciowym wyborem elementu podstawowego"); sw.Start(); matrix.CalculateGP(); sw.Stop(); time[1] = sw.Elapsed.TotalMilliseconds; diff[1] = matrix.CalculateDiff(); break; case GaussType.Full: //Console.WriteLine(" z pelnym wyborem elementu podstawowego"); sw.Start(); matrix.CalculateGF(); sw.Stop(); time[2] = sw.Elapsed.TotalMilliseconds; diff[2] = matrix.CalculateDiff(); break; } sw.Stop(); //Console.WriteLine(" Czas: {0}", sw.Elapsed.TotalMilliseconds); //Console.WriteLine(" błąd: " + matrix.CalculateDiff()); }
public void Multiplication() { matrixfloat.Multiplication(); matrixdouble.Multiplication(); matrixfraction.Multiplication(); }