Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Matrix_Algebra
  4. {
  5. public struct S_Matrix_size
  6. {
  7. public int size_R, size_C;
  8. public S_Matrix_size(int r, int c)
  9. {
  10. this.size_R = r;
  11. this.size_C = c;
  12. }
  13. }
  14.  
  15. public class C_Matrix_entries
  16. {
  17.  
  18. public C_Matrix_entries()
  19. {
  20. int r, c;
  21. Console.WriteLine("Enter number of rows and columns ");
  22.  
  23. r = Convert.ToInt32(Console.ReadLine());
  24. c = Convert.ToInt32(Console.ReadLine());
  25.  
  26. S_Matrix_size size = new S_Matrix_size(r,c);
  27.  
  28. double[,] entry = new double [size.size_R,size.size_C];
  29.  
  30. Console.WriteLine("Enter the entries from first row [left to right] to the last row ");
  31. for (int i = 0; i<size.size_R; i++)
  32. {
  33. Console.WriteLine("Enter the {0} row", i + 1);
  34. for (int j = 0; j<size.size_C;j++)
  35. {
  36. entry[i, j] = Convert.ToDouble(Console.ReadLine());
  37. }
  38. }
  39. }
  40.  
  41.  
  42. }
  43. }
  44.  
  45. namespace Row_Reduce_Algebra
  46. {
  47. using Matrix_Algebra;
  48. public class TEST
  49. {
  50. static void Main()
  51. {
  52. C_Matrix_entries matrix_no1 = new C_Matrix_entries();
  53. for (int i = 0; i < **matrix_no1.size**; i++)
  54. {
  55.  
  56. }
  57. }
  58. }
  59. }
  60.  
  61. using System;
  62.  
  63. namespace Matrix_Algebra
  64. {
  65. public struct S_Matrix_size
  66. {
  67. public int size_R, size_C;
  68. public S_Matrix_size(int r, int c)
  69. {
  70. this.size_R = r;
  71. this.size_C = c;
  72. }
  73. }
  74.  
  75. public class C_Matrix_entries
  76. {
  77. private S_Matrix_size _size;
  78.  
  79. public C_Matrix_entries()
  80. {
  81. int r, c;
  82. Console.WriteLine("Enter number of rows and columns ");
  83.  
  84. r = Convert.ToInt32(Console.ReadLine());
  85. c = Convert.ToInt32(Console.ReadLine());
  86. _size = new S_Matrix_size(r,c);
  87.  
  88. double[,] entry = new double [_size.size_R,_size.size_C];
  89.  
  90. Console.WriteLine("Enter the entries from first row [left to right] to the last row ");
  91. for (int i = 0; i<_size.size_R; i++)
  92. {
  93. Console.WriteLine("Enter the {0} row", i + 1);
  94. for (int j = 0; j<_size.size_C;j++)
  95. {
  96. entry[i, j] = Convert.ToDouble(Console.ReadLine());
  97. }
  98. }
  99. }
  100.  
  101. public S_Matrix_size Size { get { return _size; } }
  102. }
  103. }
  104.  
  105. namespace Row_Reduce_Algebra
  106. {
  107. using Matrix_Algebra;
  108. public class TEST
  109. {
  110. static void Main()
  111. {
  112. C_Matrix_entries matrix_no1 = new C_Matrix_entries();
  113. for (int i = 0; i < matrix_no1.Size.size_R * matrix_no1.Size.size_C; i++)
  114. {
  115. // TODO: something useful
  116. Console.WriteLine(i); // FORNOW
  117. }
  118. }
  119. }
  120. }
  121.  
  122. public class C_Matrix_entries
  123. {
  124. public S_Matrix_size size { get; private set; }
  125.  
  126. public C_Matrix_entries()
  127. {
  128. ...
  129.  
  130. size = new S_Matrix_size(r,c);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement