示例#1
0
 public void LoadData()
 {
     BinaryHelpers.ExecuteReader(this, (reader) =>
     {
         var matrix = new EmmeMatrix(reader);
         if (matrix.Dimensions != 2)
         {
             throw new XTMFRuntimeException(this, "In '" + Name + "' the matrix loaded in from '" + MatrixFile + "' was not an OD binary matrix!");
         }
         Data   = SparseTwinIndex <float> .CreateSquareTwinIndex(matrix.Indexes[0], matrix.Indexes[1], matrix.FloatData);
         Loaded = true;
     }, MatrixFile);
 }
示例#2
0
        public void LoadData()
        {
            var zoneSystem = LoadZoneSystem(ZoneSystem);
            var data       = SparseTwinIndex <float> .CreateSquareTwinIndex(zoneSystem, zoneSystem);

            if (ThirdNormalized)
            {
                LoadThirdNormalized(data);
            }
            else
            {
                LoadSquareCSV(data);
            }
            _data  = data;
            Loaded = true;
        }
示例#3
0
        public void LoadData()
        {
            var zoneSystem = LoadZoneSystem(ZoneSystem);
            var data       = SparseTwinIndex <float> .CreateSquareTwinIndex(zoneSystem, zoneSystem);

            TMG.Functions.BinaryHelpers.ExecuteReader(this, (reader) =>
            {
                var matrix   = new Emme.EmmeMatrix(reader);
                var flatData = data.GetFlatData();
                int srcIndex = 0;
                for (int i = 0; i < flatData.Length; i++)
                {
                    Array.Copy(matrix.FloatData, srcIndex, flatData[i], 0, flatData.Length);
                    srcIndex += flatData.Length;
                }
            }, LoadFrom);
            _data  = data;
            Loaded = true;
        }
        public void LoadData()
        {
            var originalZones  = LoadZoneSystem(OriginalZoneSystem);
            var convertToZones = LoadZoneSystem(ConvertToZoneSystem);
            var ret            = SparseTwinIndex <float> .CreateSquareTwinIndex(convertToZones, convertToZones);

            var original = GetData(Original);
            var flat     = ret.GetFlatData();
            var map      = ColumnNormalize(BuildMapping(originalZones, convertToZones), originalZones.Length);

            switch (Aggregation)
            {
            case Aggregations.Sum:
                ApplySum(map, flat, original);
                break;

            case Aggregations.Average:
                ApplyAverage(map, flat, original);
                break;
            }
            _data  = ret;
            Loaded = true;
        }