Changeset 238 for trunk/SRC/ToBeReviewed/MATRICE
- Timestamp:
- 03/27/07 15:43:18 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/MATRICE/colle.pro
r163 r238 1 1 ;+ 2 ; @file_comments 3 ; This concatenation function exist in IDL so long 4 ; as we do not try to stick with a dimension superior or equal at 4. 2 ; @file_comments 3 ; This concatenation function exist in IDL so long 4 ; as we do not try to stick with a dimension superior or equal at 4. 5 5 ; 6 ; @categories 6 ; @categories 7 7 ; Utilities 8 8 ; … … 52 52 ; force to save the pointer array and arrays to be stuck 53 53 ; 54 ; @returns res=matrice resultat 54 ; @returns 55 ; matrice resultat 55 56 ; 56 ; @examples IDL> print, colle(replicate(1,2,2,2),indgen(2,2,2),2) 57 ; @examples 58 ; IDL> print, colle(replicate(1,2,2,2),indgen(2,2,2),2) 57 59 ; 1 1 58 60 ; 1 1 … … 65 67 ; 6 7 66 68 ; 67 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 69 ; @history 70 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 68 71 ; 13/1/98 69 72 ; 70 ; @version $Id$ 73 ; @version 74 ; $Id$ 71 75 ; 72 76 ;- 77 ; 73 78 FUNCTION colle, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, SAUVE = sauve 74 79 ; … … 111 116 res = [temporary(res), *ptrtab[n]] 112 117 if NOT keyword_set(sauve) then ptr_free, ptrtab[n] 113 ENDFOR 114 END 118 ENDFOR 119 END 115 120 2:BEGIN ; we paste following the dimension 2 116 121 res = *ptrtab[0] … … 119 124 res = [[temporary(res)], [*ptrtab[n]]] 120 125 if NOT keyword_set(sauve) then ptr_free, ptrtab[n] 121 ENDFOR 122 END 126 ENDFOR 127 END 123 128 3:BEGIN ; we paste following the dimension 3 124 129 res = *ptrtab[0] … … 127 132 res = [[[temporary(res)]], [[*ptrtab[n]]]] 128 133 if NOT keyword_set(sauve) then ptr_free, ptrtab[n] 129 ENDFOR 134 ENDFOR 130 135 END 131 ELSE:BEGIN 136 ELSE:BEGIN 132 137 ; We transpose res in order to put the dimension to be pasted number 1 133 ; To this, we contain the permuter vector which give the place that dimension 138 ; To this, we contain the permuter vector which give the place that dimension 134 139 ; in the transposed matrix must take. 135 140 siz = (size(*ptrtab[0]))[0] … … 143 148 FOR n = 1,nbretab-1 DO BEGIN ; we paste following the dimension 1on colle suivant la dimension 1 144 149 if (size(*ptrtab[n]))[0] LT direc then $ 145 *ptrtab[n] = reform(*ptrtab[n], [(size(*ptrtab[n]))[1:siz], replicate(1, direc-siz)]) 150 *ptrtab[n] = reform(*ptrtab[n], [(size(*ptrtab[n]))[1:siz], replicate(1, direc-siz)]) 146 151 res = [temporary(res), transpose(*ptrtab[n], permute)] 147 152 if NOT keyword_set(sauve) then ptr_free, ptrtab[n] … … 149 154 res = transpose(temporary(res), permute) 150 155 END 151 ENDCASE 156 ENDCASE 152 157 ;------------------------------------------------------------ 153 158 if NOT keyword_set(sauve) then undefine, ptrtab 154 159 sortie: 155 160 return, res 156 157 158 END 159 160 ;------------------------------------------------------------ 161 END
Note: See TracChangeset
for help on using the changeset viewer.