public TO_FundingModel GetTransportObject() => new TO_FundingModel { BuildDate = BuildDate, VolSurfaces = VolSurfaces.ToDictionary(x => x.Key, x => x.Value.GetTransportObject()), Curves = Curves.ToDictionary(x => x.Key, x => x.Value.GetTransportObject()), FxMatrix = ((FxMatrix)FxMatrix).GetTransportObject() };
public bool TryGetVolSurface(string name, out IVolSurface volSurface) { if (VolSurfaces.TryGetValue(name, out volSurface)) { return(true); } if (TryGetInverseSurface(name, out volSurface)) { return(true); } volSurface = null; return(false); }
public IVolSurface GetVolSurface(string name) => VolSurfaces.TryGetValue(name, out var curve) ? curve : throw new Exception($"Surface named {name} not found");
private bool TryGetInverseSurface(string name, out IVolSurface volSurface) { var inverseName = name.Substring(name.Length - 3, 3) + "/" + name.Substring(0, 3); return(VolSurfaces.TryGetValue(inverseName, out volSurface)); }