private void ConvertToGU(float[] drLossVector, IRITEindexMapper mapper) { int NumGuLoss = drLossVector.Length; float[] TIVarray = mapper.GetOrderedTIVArray(); for (int i = 0; i < NumGuLoss; i++) { drLossVector[i] = drLossVector[i] * TIVarray[i]; } }
private void ConvertToGU(Dictionary <string, Dictionary <int, Dictionary <long, Tuple <double, uint, List <float> > > > > drLossDict, IRITEindexMapper mapper) { int[] orderedNumOfBldgsList = mapper.GetOrderedNumBldgs(); float[] TIVarray = mapper.GetOrderedTIVArray(); foreach (string subperil in drLossDict.Keys) { Dictionary <long, Tuple <double, uint, List <float> > > LossesByRITE = drLossDict[subperil][0]; foreach (KeyValuePair <long, Tuple <double, uint, List <float> > > pair in LossesByRITE) { int indexOfRITE = mapper.GetMappedIndex(pair.Key); int NumBldgs = orderedNumOfBldgsList[indexOfRITE]; List <float> losses = pair.Value.Item3; for (int bldgID = 0; bldgID < NumBldgs; bldgID++) { float bldgTIV = TIVarray[mapper.GetMappedIndex(pair.Key, bldgID, subperil)]; losses[bldgID] = losses[bldgID] * bldgTIV; //TODO: raintest //losses[bldgID] = 100; } } } }