using Avalonia; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Data.Core.Plugins; using Avalonia.Markup.Xaml; using FxpConvert.Common; #if DEBUG using HotAvalonia; using OxyPlot; #endif using ShakerApp.ViewModels; using ShakerApp.Views; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; namespace ShakerApp; public partial class App : Application { public unsafe override void Initialize() { #if DEBUG if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { this.EnableHotReload(); } #endif AvaloniaXamlLoader.Load(this); } public override void OnFrameworkInitializationCompleted() { Vector512 nv = Vector512.One * double.NegativeInfinity; Vector512 pv = Vector512.One * double.PositiveInfinity; DataPoint[] maxtempresult = Enumerable.Repeat(new DataPoint(double.MinValue, double.MaxValue), (int)(8 >> 1)).ToArray(); ref var maxresunlt = ref Unsafe.As>(ref maxtempresult[0]); DataPoint[] mintempresult = Enumerable.Repeat(new DataPoint(double.MaxValue, double.MaxValue), (int)(8 >> 1)).ToArray(); ref var minresunlt = ref Unsafe.As>(ref maxtempresult[0]); var first = Vector512.Create(new double[] { 1, 2, 3, 6, double.NaN, double.NegativeInfinity, double.PositiveInfinity, 2 }); ref var tempv = ref Unsafe.Add(ref first, 0); var errv = Vector512.Equals(tempv, tempv).AsInt64(); //errv = Vector512.AndNot(errv, Vector512.One); errv *= (Vector512.Equals(tempv,nv).AsInt64()+Vector512.One); errv *= (Vector512.Equals(tempv, pv).AsInt64() + Vector512.One); var tempmax = Vector512.One * double.MaxValue; var v = Vector512.ConditionalSelect(errv.AsDouble(), tempv, tempmax); var tempmin = Vector512.One * double.MinValue; maxresunlt = Vector512.Max(tempv, maxresunlt); minresunlt = Vector512.Min(tempv, minresunlt); BindingPlugins.DataValidators.RemoveAt(0); ShakerSettingViewModel.Instance.Init(); if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { if (desktop.Args!.Contains("-debug")) { ViewModels.MainViewModel.Default.CanDebug = true; } desktop.MainWindow = new MainWindow(); } base.OnFrameworkInitializationCompleted(); //Window1 window = new Window1(); //window.Show(); } }