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