/test/language/unclassified/aux_jmj3ts.e

http://github.com/tybor/Liberty · Specman e · 92 lines · 55 code · 9 blank · 28 comment · 0 complexity · 22a878c84e96f89a8d95f3ef4fbd3525 MD5 · raw file

  1. -- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries.
  2. -- See the Copyright notice at the end of this file.
  3. --
  4. class AUX_JMJ3TS[T]
  5. inherit
  6. AUX_JMJ3A2D[T]
  7. rename make as array2d_make
  8. redefine dimension
  9. end
  10. create {ANY}
  11. array2d_make, dimension
  12. feature {ANY}
  13. dimension (first_dim, second_dim, tile_width: INTEGER)
  14. do
  15. tile := tile_width
  16. array2d_make(0, first_dim - 1 + 2 * tile_width, 0, second_dim - 1 + 2 * tile_width)
  17. create column_buffer.make(lower1, upper1)
  18. end
  19. feature {ANY}
  20. tile: INTEGER
  21. feature {ANY}
  22. row (i: INTEGER): T
  23. do
  24. Result := storage.item(i)
  25. end
  26. column (j: INTEGER): ARRAY[T]
  27. local
  28. i: INTEGER
  29. do
  30. from
  31. i := lower1
  32. until
  33. i > upper1
  34. loop
  35. column_buffer.put(item(i, j), i)
  36. i := i + 1
  37. end
  38. Result := column_buffer
  39. end
  40. feature {ANY}
  41. --PH: this function is wrong and unused, so I commented it out.
  42. -- set_row(new_row: like row; i: INTEGER)
  43. -- require
  44. -- same_width: new_row.count = dim2
  45. -- do
  46. -- storage.put(new_row,i)
  47. -- end
  48. set_column (new_col: like column; j: INTEGER)
  49. require
  50. same_width: new_col.count = dim1
  51. local
  52. i: INTEGER
  53. do
  54. from
  55. i := lower1
  56. until
  57. i > upper1
  58. loop
  59. put(new_col.item(i), i, j)
  60. i := i + 1
  61. end
  62. end
  63. feature {ANY}
  64. column_buffer: like column
  65. end -- class AUX_JMJ3TS
  66. --
  67. -- ------------------------------------------------------------------------------------------------------------------------------
  68. -- Copyright notice below. Please read.
  69. --
  70. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  71. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  72. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  73. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  74. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  75. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  76. --
  77. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  78. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  79. --
  80. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  81. --
  82. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  83. -- ------------------------------------------------------------------------------------------------------------------------------