1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- 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<double> nv = Vector512<double>.One * double.NegativeInfinity;
- Vector512<double> pv = Vector512<double>.One * double.PositiveInfinity;
- DataPoint[] maxtempresult = Enumerable.Repeat(new DataPoint(double.MinValue, double.MaxValue), (int)(8 >> 1)).ToArray();
- ref var maxresunlt = ref Unsafe.As<DataPoint, Vector512<double>>(ref maxtempresult[0]);
- DataPoint[] mintempresult = Enumerable.Repeat(new DataPoint(double.MaxValue, double.MaxValue), (int)(8 >> 1)).ToArray();
- ref var minresunlt = ref Unsafe.As<DataPoint, Vector512<double>>(ref maxtempresult[0]);
- var first = Vector512.Create<double>(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<double>.One);
- errv *= (Vector512.Equals(tempv,nv).AsInt64()+Vector512<long>.One);
- errv *= (Vector512.Equals(tempv, pv).AsInt64() + Vector512<long>.One);
- var tempmax = Vector512<double>.One * double.MaxValue;
- var v = Vector512.ConditionalSelect<double>(errv.AsDouble(), tempv, tempmax);
- var tempmin = Vector512<double>.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();
- }
- }
|