Changeset 1438
- Timestamp:
- 03/27/09 12:51:32 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/ArrayDecomposer.cs
r1434 r1438 14 14 15 15 public IEnumerable<Tag> DeCompose(object array) { 16 Array a = (Array)array; 16 Array a = (Array)array; 17 17 yield return new Tag("rank", a.Rank); 18 18 for (int i = 0; i < a.Rank; i++) { 19 19 yield return new Tag("length_" + i, a.GetLength(i)); 20 } 21 for (int i = 0; i < a.Rank; i++) { 22 yield return new Tag("lowerBound_" + i, a.GetLowerBound(i)); 20 23 } 21 24 foreach (object o in (Array)array) { … … 37 40 lengths[i] = (int)e.Current.Value; 38 41 } 39 Array a = Array.CreateInstance(t.GetElementType(), lengths); 42 int[] lowerBounds = new int[rank]; 43 for (int i = 0; i < rank; i++) { 44 e.MoveNext(); 45 lowerBounds[i] = (int)e.Current.Value; 46 } 47 Array a = Array.CreateInstance(t.GetElementType(), lengths, lowerBounds); 40 48 int[] positions = new int[rank]; 41 49 while (e.MoveNext()) {
Note: See TracChangeset
for help on using the changeset viewer.