Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1438


Ignore:
Timestamp:
03/27/09 12:51:32 (16 years ago)
Author:
epitzer
Message:

Include lower bounds in serialized arrays. (#506)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/ArrayDecomposer.cs

    r1434 r1438  
    1414
    1515    public IEnumerable<Tag> DeCompose(object array) {
    16       Array a = (Array)array;
     16      Array a = (Array)array;     
    1717      yield return new Tag("rank", a.Rank);
    1818      for (int i = 0; i < a.Rank; i++) {
    1919        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));
    2023      }
    2124      foreach (object o in (Array)array) {
     
    3740        lengths[i] = (int)e.Current.Value;
    3841      }
    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);     
    4048      int[] positions = new int[rank];
    4149      while (e.MoveNext()) {
Note: See TracChangeset for help on using the changeset viewer.