public TimeHelper(DispatcherTimer timer) { Timer = timer; Timer.Tick += UpdateTimeToDisplay; Shared = new Shared.Shared(); SetUpTimeVariables(); }
public void VisitShared(IShared shared, Tensor <float> data) { var other = data as Tensor <float> .Shared; if (other == null) { Arent(); } else { Eq(((Tensor <float> .Shared)shared).Value, other.Value); } }
public Application(IHolidayType holidayType, IShared shared, IPartyNumberPage partyNumberPage, IBudgetPage budgetPage, IDestinationFilter destinationFilter, IResultsPage resultsPage) { _holidayType = holidayType; _shared = shared; _partyNumberPage = partyNumberPage; _budgetPage = budgetPage; _destinationFilter = destinationFilter; _resultsPage = resultsPage; }
public virtual void VisitShared(IShared shared, Compiler compiler) { compiler.Scope.Declare(shared, compiler); var comment = GetComment(shared, compiler); if (shared is ITensor tensor) { var buff = compiler.GetBuffer(tensor); if (buff != null && (!buff.IsShared || buff.Name != shared.Name)) { compiler.EmitAssign(shared, $"Copy({Compiler.GetShared(shared)}, result: {compiler.GetBufferName(buff)})" + compiler.OfShape(@shared, this), comment); return; } } compiler.EmitAssign(shared, Compiler.GetShared(shared) + compiler.OfShape(@shared, this), comment); }
public static string GetSharedProperty(IShared shared) { // TODO: weak..., shall we add the underlying type of the shared as one of its member ? // shall we distinguih between int/Array<int>/float/Array<float> ? or just float/int (enough in combination with ITensor/IScalar) var type = shared.GetType().BaseType.BaseType; string name = type.GetName(); switch (name) { case "Scalar<int>": return("Int"); case "Scalar<float>": return("Float"); case "Tensor<int>": return("IntArray"); case "Tensor<float>": return("FloatArray"); } return(name); }
/// <summary> /// Indicates if the instance is NOT shared with other instances. /// </summary> /// <param name="shared"></param> /// <returns></returns> public static bool IsOwned(this IShared shared) { return(object.ReferenceEquals(shared, null).Equals(false) && shared.IsShared.Equals(false)); }
public static BufferInfo UseShared <T>(IShared <T> shared) => new BufferInfo(shared.Name, (shared as ITensor).Shape, typeof(T), shared: true);
public BudgetPage(IShared shared) { _shared = shared; }
public Parent(IChild child, IShared shared) { Child = child; Shared = shared; }
public Child(IShared shared) { Shared = shared; }
public static string GetShared(IShared shared) => $"{GetSharedProperty(shared)}[\"{shared.Name}\"]";
public PartyNumberPage(IShared shared) { _shared = shared; }
public HolidayTypePage(IDestinationRepository destinationRepository, IShared shared) { _destinationRepository = destinationRepository; _shared = shared; }
public ResultsPage(IShared shared) { _shared = shared; }