2 instantiations of Vector4
Microsoft.Gen.Logging.Generated.Tests (1)
LogPropertiesTests.cs (1)
108
P18 = new
Vector4
(1, 2, 3, 4),
System.Drawing.Primitives (1)
System\Drawing\RectangleF.cs (1)
66
public Vector4 ToVector4() => new
Vector4
(x, y, width, height);
936 references to Vector4
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\LogPropertiesSpecialTypesExtensions.cs (1)
35
public
Vector4
P18 { get; set; }
Microsoft.Maui.Graphics (4)
Color.cs (2)
77
public Color(
Vector4
color)
1042
public static implicit operator Color(
Vector4
color) => new Color(color);
Converters\ColorTypeConverter.cs (2)
13
if (fromValue is
Vector4
vec)
189
=> sourceType == typeof(string) || sourceType == typeof(
Vector4
);
netstandard (1)
netstandard.cs (1)
1341
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.
Vector4
))]
System.Drawing.Primitives (7)
System\Drawing\RectangleF.cs (7)
53
/// <see cref="System.Numerics.
Vector4
"/>.
55
public RectangleF(
Vector4
vector)
64
/// Creates a new <see cref="System.Numerics.
Vector4
"/> from this <see cref="System.Drawing.RectangleF"/>.
66
public
Vector4
ToVector4() => new Vector4(x, y, width, height);
69
/// Converts the specified <see cref="System.Drawing.RectangleF"/> to a <see cref="System.Numerics.
Vector4
"/>.
71
public static explicit operator
Vector4
(RectangleF rectangle) => rectangle.ToVector4();
76
public static explicit operator RectangleF(
Vector4
vector) => new RectangleF(vector);
System.Numerics (1)
System.Numerics.cs (1)
12
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.
Vector4
))]
System.Numerics.Vectors (1)
src\runtime\artifacts\obj\System.Numerics.Vectors\Release\net11.0\System.Numerics.Vectors.Forwards.cs (1)
15
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.
Vector4
))]
System.Private.CoreLib (921)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Matrix4x4.cs (19)
155
/// <remarks>The last two elements of <see cref="X" />, <see cref="Y" />, and <see cref="W" /> are initialized to zero; while <see cref="Z" /> is initialized to <see cref="
Vector4
.UnitZ" />.</remarks>
212
public
Vector4
X
223
public
Vector4
Y
234
public
Vector4
Z
245
public
Vector4
W
258
public
Vector4
this[int row]
545
result.X =
Vector4
.Transform(left.X, in right);
546
result.Y =
Vector4
.Transform(left.Y, in right);
547
result.Z =
Vector4
.Transform(left.Z, in right);
548
result.W =
Vector4
.Transform(left.W, in right);
640
/// <remarks>The last two elements of <see cref="X" />, <see cref="Y" />, and <see cref="W" /> are initialized to zero; while <see cref="Z" /> is initialized to <see cref="
Vector4
.UnitZ" />.</remarks>
660
public static Matrix4x4 Create(
Vector4
value)
681
public static Matrix4x4 Create(
Vector4
x,
Vector4
y,
Vector4
z,
Vector4
w)
2200
float det =
Vector4
.Dot(C0.AsVector4(), row1.AsVector4());
2496
public readonly
Vector4
GetRow(int index) => this[index];
2536
public readonly Matrix4x4 WithRow(int index,
Vector4
value)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Plane.cs (8)
46
/// <param name="value">A vector whose first three elements describe the normal vector, and whose <see cref="
Vector4
.W" /> defines the distance along that normal from the origin.</param>
49
public Plane(
Vector4
value)
55
/// <param name="value">A vector whose first three elements describe the normal vector, and whose <see cref="
Vector4
.W" /> defines the distance along that normal from the origin.</param>
59
public static Plane Create(
Vector4
value) => value.AsPlane();
67
public static Plane Create(Vector3 normal, float d) =>
Vector4
.Create(normal, d).AsPlane();
103
public static float Dot(Plane plane,
Vector4
value) => Vector128.Dot(plane.AsVector128(), value.AsVector128());
160
return
Vector4
.Transform(plane.AsVector128(), Matrix4x4.Transpose(inverseMatrix)).AsPlane();
169
public static Plane Transform(Plane plane, Quaternion rotation) =>
Vector4
.Transform(plane.AsVector128(), rotation.AsVector128()).AsPlane();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Plane.Extensions.cs (4)
10
/// <summary>Reinterprets a <see cref="Plane" /> as a new <see cref="
Vector4
" />.</summary>
12
/// <returns><paramref name="value" /> reinterpreted as a new <see cref="
Vector4
" />.</returns>
14
public static
Vector4
AsVector4(this Plane value) => Unsafe.BitCast<Plane,
Vector4
>(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Quaternion.cs (1)
226
public static Quaternion Create(Vector3 vectorPart, float scalarPart) =>
Vector4
.Create(vectorPart, scalarPart).AsQuaternion();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Quaternion.Extensions.cs (3)
10
/// <summary>Reinterprets a <see cref="Quaternion" /> as a new <see cref="
Vector4
" />.</summary>
14
public static
Vector4
AsVector4(this Quaternion value) => Unsafe.BitCast<Quaternion,
Vector4
>(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.cs (225)
74
/// <inheritdoc cref="
Vector4
.AllBitsSet" />
82
/// <inheritdoc cref="
Vector4
.E" />
90
/// <inheritdoc cref="
Vector4
.Epsilon" />
98
/// <inheritdoc cref="
Vector4
.NaN" />
106
/// <inheritdoc cref="
Vector4
.NegativeInfinity" />
114
/// <inheritdoc cref="
Vector4
.NegativeZero" />
122
/// <inheritdoc cref="
Vector4
.One" />
130
/// <inheritdoc cref="
Vector4
.Pi" />
138
/// <inheritdoc cref="
Vector4
.PositiveInfinity" />
146
/// <inheritdoc cref="
Vector4
.Tau" />
172
/// <inheritdoc cref="
Vector4
.Zero" />
286
/// <inheritdoc cref="
Vector4
.op_BitwiseAnd(
Vector4
,
Vector4
)" />
291
/// <inheritdoc cref="
Vector4
.op_BitwiseOr(
Vector4
,
Vector4
)" />
296
/// <inheritdoc cref="
Vector4
.op_ExclusiveOr(
Vector4
,
Vector4
)" />
301
/// <inheritdoc cref="
Vector4
.op_LeftShift(
Vector4
, int)" />
306
/// <inheritdoc cref="
Vector4
.op_OnesComplement(
Vector4
)" />
311
/// <inheritdoc cref="
Vector4
.op_RightShift(
Vector4
, int)" />
316
/// <inheritdoc cref="
Vector4
.op_UnaryPlus(
Vector4
)" />
321
/// <inheritdoc cref="
Vector4
.op_UnsignedRightShift(
Vector4
, int)" />
341
/// <inheritdoc cref="
Vector4
.All(
Vector4
, float)" />
346
/// <inheritdoc cref="
Vector4
.AllWhereAllBitsSet(
Vector4
)" />
351
/// <inheritdoc cref="
Vector4
.AndNot(
Vector4
,
Vector4
)" />
356
/// <inheritdoc cref="
Vector4
.Any(
Vector4
, float)" />
361
/// <inheritdoc cref="
Vector4
.AnyWhereAllBitsSet(
Vector4
)" />
366
/// <inheritdoc cref="
Vector4
.BitwiseAnd(
Vector4
,
Vector4
)" />
371
/// <inheritdoc cref="
Vector4
.BitwiseOr(
Vector4
,
Vector4
)" />
376
/// <inheritdoc cref="
Vector4
.Clamp(
Vector4
,
Vector4
,
Vector4
)" />
381
/// <inheritdoc cref="
Vector4
.ClampNative(
Vector4
,
Vector4
,
Vector4
)" />
386
/// <inheritdoc cref="
Vector4
.ConditionalSelect(
Vector4
,
Vector4
,
Vector4
)" />
391
/// <inheritdoc cref="
Vector4
.CopySign(
Vector4
,
Vector4
)" />
396
/// <inheritdoc cref="
Vector4
.Cos(
Vector4
)" />
400
/// <inheritdoc cref="
Vector4
.Count(
Vector4
, float)" />
405
/// <inheritdoc cref="
Vector4
.CountWhereAllBitsSet(
Vector4
)" />
473
/// <inheritdoc cref="
Vector4
.DegreesToRadians(
Vector4
)" />
518
/// <inheritdoc cref="
Vector4
.Exp(
Vector4
)" />
522
/// <inheritdoc cref="
Vector4
.Equals(
Vector4
,
Vector4
)" />
527
/// <inheritdoc cref="
Vector4
.EqualsAll(
Vector4
,
Vector4
)" />
532
/// <inheritdoc cref="
Vector4
.EqualsAny(
Vector4
,
Vector4
)" />
542
/// <inheritdoc cref="
Vector4
.GreaterThan(
Vector4
,
Vector4
)" />
547
/// <inheritdoc cref="
Vector4
.GreaterThanAll(
Vector4
,
Vector4
)" />
552
/// <inheritdoc cref="
Vector4
.GreaterThanAny(
Vector4
,
Vector4
)" />
557
/// <inheritdoc cref="
Vector4
.GreaterThanOrEqual(
Vector4
,
Vector4
)" />
562
/// <inheritdoc cref="
Vector4
.GreaterThanOrEqualAll(
Vector4
,
Vector4
)" />
567
/// <inheritdoc cref="
Vector4
.GreaterThanOrEqualAny(
Vector4
,
Vector4
)" />
572
/// <inheritdoc cref="
Vector4
.Hypot(
Vector4
,
Vector4
)" />
577
/// <inheritdoc cref="
Vector4
.IndexOf(
Vector4
, float)" />
582
/// <inheritdoc cref="
Vector4
.IndexOfWhereAllBitsSet(
Vector4
)" />
587
/// <inheritdoc cref="
Vector4
.IsEvenInteger(
Vector4
)" />
592
/// <inheritdoc cref="
Vector4
.IsFinite(
Vector4
)" />
597
/// <inheritdoc cref="
Vector4
.IsInfinity(
Vector4
)" />
602
/// <inheritdoc cref="
Vector4
.IsInteger(
Vector4
)" />
607
/// <inheritdoc cref="
Vector4
.IsNaN(
Vector4
)" />
612
/// <inheritdoc cref="
Vector4
.IsNegative(
Vector4
)" />
617
/// <inheritdoc cref="
Vector4
.IsNegativeInfinity(
Vector4
)" />
622
/// <inheritdoc cref="
Vector4
.IsNormal(
Vector4
)" />
627
/// <inheritdoc cref="
Vector4
.IsOddInteger(
Vector4
)" />
632
/// <inheritdoc cref="
Vector4
.IsPositive(
Vector4
)" />
637
/// <inheritdoc cref="
Vector4
.IsPositiveInfinity(
Vector4
)" />
642
/// <inheritdoc cref="
Vector4
.IsSubnormal(
Vector4
)" />
647
/// <inheritdoc cref="
Vector4
.IsZero(
Vector4
)" />
652
/// <inheritdoc cref="
Vector4
.LastIndexOf(
Vector4
, float)" />
657
/// <inheritdoc cref="
Vector4
.LastIndexOfWhereAllBitsSet(
Vector4
)" />
662
/// <inheritdoc cref="
Vector4
.Lerp(
Vector4
,
Vector4
, float)" />
667
/// <inheritdoc cref="
Vector4
.Lerp(
Vector4
,
Vector4
,
Vector4
)" />
672
/// <inheritdoc cref="
Vector4
.LessThan(
Vector4
,
Vector4
)" />
677
/// <inheritdoc cref="
Vector4
.LessThanAll(
Vector4
,
Vector4
)" />
682
/// <inheritdoc cref="
Vector4
.LessThanAny(
Vector4
,
Vector4
)" />
687
/// <inheritdoc cref="
Vector4
.LessThanOrEqual(
Vector4
,
Vector4
)" />
692
/// <inheritdoc cref="
Vector4
.LessThanOrEqualAll(
Vector4
,
Vector4
)" />
697
/// <inheritdoc cref="
Vector4
.LessThanOrEqualAny(
Vector4
,
Vector4
)" />
702
/// <inheritdoc cref="
Vector4
.Load(float*)" />
708
/// <inheritdoc cref="
Vector4
.LoadAligned(float*)" />
721
/// <inheritdoc cref="
Vector4
.LoadAlignedNonTemporal(float*)" />
732
/// <inheritdoc cref="
Vector4
.LoadUnsafe(ref readonly float, nuint)" />
738
/// <inheritdoc cref="
Vector4
.Log(
Vector4
)" />
740
public static Vector2 Log(Vector2 vector) => Vector128.Log(
Vector4
.Create(vector, 1.0f, 1.0f).AsVector128()).AsVector2();
742
/// <inheritdoc cref="
Vector4
.Log2(
Vector4
)" />
744
public static Vector2 Log2(Vector2 vector) => Vector128.Log2(
Vector4
.Create(vector, 1.0f, 1.0f).AsVector128()).AsVector2();
746
/// <inheritdoc cref="
Vector4
.Max(
Vector4
,
Vector4
)" />
751
/// <inheritdoc cref="
Vector4
.MaxMagnitude(
Vector4
,
Vector4
)" />
756
/// <inheritdoc cref="
Vector4
.MaxMagnitudeNumber(
Vector4
,
Vector4
)" />
761
/// <inheritdoc cref="
Vector4
.MaxNative(
Vector4
,
Vector4
)" />
766
/// <inheritdoc cref="
Vector4
.MaxNumber(
Vector4
,
Vector4
)" />
771
/// <inheritdoc cref="
Vector4
.Min(
Vector4
,
Vector4
)" />
776
/// <inheritdoc cref="
Vector4
.MinMagnitude(
Vector4
,
Vector4
)" />
781
/// <inheritdoc cref="
Vector4
.MinMagnitudeNumber(
Vector4
,
Vector4
)" />
786
/// <inheritdoc cref="
Vector4
.MinNative(
Vector4
,
Vector4
)" />
791
/// <inheritdoc cref="
Vector4
.MinNumber(
Vector4
,
Vector4
)" />
832
/// <inheritdoc cref="
Vector4
.None(
Vector4
, float)" />
837
/// <inheritdoc cref="
Vector4
.NoneWhereAllBitsSet(
Vector4
)" />
849
/// <inheritdoc cref="
Vector4
.OnesComplement(
Vector4
)" />
854
/// <inheritdoc cref="
Vector4
.RadiansToDegrees(
Vector4
)" />
876
/// <inheritdoc cref="
Vector4
.Round(
Vector4
)" />
881
/// <inheritdoc cref="
Vector4
.Round(
Vector4
, MidpointRounding)" />
899
/// <inheritdoc cref="
Vector4
.Sin(
Vector4
)" />
903
/// <inheritdoc cref="
Vector4
.SinCos(
Vector4
)" />
926
/// <inheritdoc cref="
Vector4
.Sum(
Vector4
)" />
969
public static Vector2 Transform(Vector2 value, Quaternion rotation) =>
Vector4
.Transform(value.AsVector128().WithElement(3, 1.0f), rotation.AsVector128()).AsVector2();
1001
/// <inheritdoc cref="
Vector4
.Truncate(
Vector4
)" />
1006
/// <inheritdoc cref="
Vector4
.Xor(
Vector4
,
Vector4
)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.Extensions.cs (10)
21
/// <summary>Reinterprets a <see cref="Vector2" /> to a new <see cref="
Vector4
" /> with the new elements zeroed.</summary>
23
/// <returns><paramref name="value" /> reinterpreted to a new <see cref="
Vector4
" /> with the new elements zeroed.</returns>
24
public static
Vector4
AsVector4(this Vector2 value) => value.AsVector128().AsVector4();
26
/// <summary>Reinterprets a <see cref="Vector2" /> to a new <see cref="
Vector4
" /> with the new elements undefined.</summary>
28
/// <returns><paramref name="value" /> reinterpreted to a new <see cref="
Vector4
" /> with the new elements undefined.</returns>
29
public static
Vector4
AsVector4Unsafe(this Vector2 value) => value.AsVector128Unsafe().AsVector4();
31
/// <inheritdoc cref="ExtractMostSignificantBits(
Vector4
)" />
36
/// <inheritdoc cref="GetElement(
Vector4
, int)" />
106
/// <inheritdoc cref="ToScalar(
Vector4
)" />
110
/// <inheritdoc cref="WithElement(
Vector4
, int, float)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.cs (225)
88
/// <inheritdoc cref="
Vector4
.AllBitsSet" />
96
/// <inheritdoc cref="
Vector4
.E" />
104
/// <inheritdoc cref="
Vector4
.Epsilon" />
112
/// <inheritdoc cref="
Vector4
.NaN" />
120
/// <inheritdoc cref="
Vector4
.NegativeInfinity" />
128
/// <inheritdoc cref="
Vector4
.NegativeZero" />
136
/// <inheritdoc cref="
Vector4
.One" />
144
/// <inheritdoc cref="
Vector4
.Pi" />
152
/// <inheritdoc cref="
Vector4
.PositiveInfinity" />
160
/// <inheritdoc cref="
Vector4
.Tau" />
195
/// <inheritdoc cref="
Vector4
.Zero" />
309
/// <inheritdoc cref="
Vector4
.op_BitwiseAnd(
Vector4
,
Vector4
)" />
314
/// <inheritdoc cref="
Vector4
.op_BitwiseOr(
Vector4
,
Vector4
)" />
319
/// <inheritdoc cref="
Vector4
.op_ExclusiveOr(
Vector4
,
Vector4
)" />
324
/// <inheritdoc cref="
Vector4
.op_LeftShift(
Vector4
, int)" />
329
/// <inheritdoc cref="
Vector4
.op_OnesComplement(
Vector4
)" />
334
/// <inheritdoc cref="
Vector4
.op_RightShift(
Vector4
, int)" />
339
/// <inheritdoc cref="
Vector4
.op_UnaryPlus(
Vector4
)" />
344
/// <inheritdoc cref="
Vector4
.op_UnsignedRightShift(
Vector4
, int)" />
364
/// <inheritdoc cref="
Vector4
.All(
Vector4
, float)" />
369
/// <inheritdoc cref="
Vector4
.AllWhereAllBitsSet(
Vector4
)" />
374
/// <inheritdoc cref="
Vector4
.AndNot(
Vector4
,
Vector4
)" />
379
/// <inheritdoc cref="
Vector4
.Any(
Vector4
, float)" />
384
/// <inheritdoc cref="
Vector4
.AnyWhereAllBitsSet(
Vector4
)" />
389
/// <inheritdoc cref="
Vector4
.BitwiseAnd(
Vector4
,
Vector4
)" />
394
/// <inheritdoc cref="
Vector4
.BitwiseOr(
Vector4
,
Vector4
)" />
399
/// <inheritdoc cref="
Vector4
.Clamp(
Vector4
,
Vector4
,
Vector4
)" />
404
/// <inheritdoc cref="
Vector4
.ClampNative(
Vector4
,
Vector4
,
Vector4
)" />
409
/// <inheritdoc cref="
Vector4
.ConditionalSelect(
Vector4
,
Vector4
,
Vector4
)" />
414
/// <inheritdoc cref="
Vector4
.CopySign(
Vector4
,
Vector4
)" />
419
/// <inheritdoc cref="
Vector4
.Cos(
Vector4
)" />
423
/// <inheritdoc cref="
Vector4
.Count(
Vector4
, float)" />
428
/// <inheritdoc cref="
Vector4
.CountWhereAllBitsSet(
Vector4
)" />
509
/// <inheritdoc cref="
Vector4
.DegreesToRadians(
Vector4
)" />
554
/// <inheritdoc cref="
Vector4
.Exp(
Vector4
)" />
558
/// <inheritdoc cref="
Vector4
.Equals(
Vector4
,
Vector4
)" />
563
/// <inheritdoc cref="
Vector4
.EqualsAll(
Vector4
,
Vector4
)" />
568
/// <inheritdoc cref="
Vector4
.EqualsAny(
Vector4
,
Vector4
)" />
578
/// <inheritdoc cref="
Vector4
.GreaterThan(
Vector4
,
Vector4
)" />
583
/// <inheritdoc cref="
Vector4
.GreaterThanAll(
Vector4
,
Vector4
)" />
588
/// <inheritdoc cref="
Vector4
.GreaterThanAny(
Vector4
,
Vector4
)" />
593
/// <inheritdoc cref="
Vector4
.GreaterThanOrEqual(
Vector4
,
Vector4
)" />
598
/// <inheritdoc cref="
Vector4
.GreaterThanOrEqualAll(
Vector4
,
Vector4
)" />
603
/// <inheritdoc cref="
Vector4
.GreaterThanOrEqualAny(
Vector4
,
Vector4
)" />
608
/// <inheritdoc cref="
Vector4
.Hypot(
Vector4
,
Vector4
)" />
613
/// <inheritdoc cref="
Vector4
.IndexOf(
Vector4
, float)" />
618
/// <inheritdoc cref="
Vector4
.IndexOfWhereAllBitsSet(
Vector4
)" />
623
/// <inheritdoc cref="
Vector4
.IsEvenInteger(
Vector4
)" />
628
/// <inheritdoc cref="
Vector4
.IsFinite(
Vector4
)" />
633
/// <inheritdoc cref="
Vector4
.IsInfinity(
Vector4
)" />
638
/// <inheritdoc cref="
Vector4
.IsInteger(
Vector4
)" />
643
/// <inheritdoc cref="
Vector4
.IsNaN(
Vector4
)" />
648
/// <inheritdoc cref="
Vector4
.IsNegative(
Vector4
)" />
653
/// <inheritdoc cref="
Vector4
.IsNegativeInfinity(
Vector4
)" />
658
/// <inheritdoc cref="
Vector4
.IsNormal(
Vector4
)" />
663
/// <inheritdoc cref="
Vector4
.IsOddInteger(
Vector4
)" />
668
/// <inheritdoc cref="
Vector4
.IsPositive(
Vector4
)" />
673
/// <inheritdoc cref="
Vector4
.IsPositiveInfinity(
Vector4
)" />
678
/// <inheritdoc cref="
Vector4
.IsSubnormal(
Vector4
)" />
683
/// <inheritdoc cref="
Vector4
.IsZero(
Vector4
)" />
688
/// <inheritdoc cref="
Vector4
.LastIndexOf(
Vector4
, float)" />
693
/// <inheritdoc cref="
Vector4
.LastIndexOfWhereAllBitsSet(
Vector4
)" />
699
/// <inheritdoc cref="
Vector4
.Lerp(
Vector4
,
Vector4
, float)" />
704
/// <inheritdoc cref="
Vector4
.Lerp(
Vector4
,
Vector4
,
Vector4
)" />
709
/// <inheritdoc cref="
Vector4
.LessThan(
Vector4
,
Vector4
)" />
714
/// <inheritdoc cref="
Vector4
.LessThanAll(
Vector4
,
Vector4
)" />
719
/// <inheritdoc cref="
Vector4
.LessThanAny(
Vector4
,
Vector4
)" />
724
/// <inheritdoc cref="
Vector4
.LessThanOrEqual(
Vector4
,
Vector4
)" />
729
/// <inheritdoc cref="
Vector4
.LessThanOrEqualAll(
Vector4
,
Vector4
)" />
734
/// <inheritdoc cref="
Vector4
.LessThanOrEqualAny(
Vector4
,
Vector4
)" />
739
/// <inheritdoc cref="
Vector4
.Load(float*)" />
745
/// <inheritdoc cref="
Vector4
.LoadAligned(float*)" />
758
/// <inheritdoc cref="
Vector4
.LoadAlignedNonTemporal(float*)" />
769
/// <inheritdoc cref="
Vector4
.LoadUnsafe(ref readonly float, nuint)" />
775
/// <inheritdoc cref="
Vector4
.Log(
Vector4
)" />
777
public static Vector3 Log(Vector3 vector) => Vector128.Log(
Vector4
.Create(vector, 1.0f).AsVector128()).AsVector3();
779
/// <inheritdoc cref="
Vector4
.Log2(
Vector4
)" />
781
public static Vector3 Log2(Vector3 vector) => Vector128.Log2(
Vector4
.Create(vector, 1.0f).AsVector128()).AsVector3();
783
/// <inheritdoc cref="
Vector4
.Max(
Vector4
,
Vector4
)" />
788
/// <inheritdoc cref="
Vector4
.MaxMagnitude(
Vector4
,
Vector4
)" />
793
/// <inheritdoc cref="
Vector4
.MaxMagnitudeNumber(
Vector4
,
Vector4
)" />
798
/// <inheritdoc cref="
Vector4
.MaxNative(
Vector4
,
Vector4
)" />
803
/// <inheritdoc cref="
Vector4
.MaxNumber(
Vector4
,
Vector4
)" />
808
/// <inheritdoc cref="
Vector4
.Min(
Vector4
,
Vector4
)" />
813
/// <inheritdoc cref="
Vector4
.MinMagnitude(
Vector4
,
Vector4
)" />
818
/// <inheritdoc cref="
Vector4
.MinMagnitudeNumber(
Vector4
,
Vector4
)" />
823
/// <inheritdoc cref="
Vector4
.MinNative(
Vector4
,
Vector4
)" />
828
/// <inheritdoc cref="
Vector4
.MinNumber(
Vector4
,
Vector4
)" />
869
/// <inheritdoc cref="
Vector4
.None(
Vector4
, float)" />
874
/// <inheritdoc cref="
Vector4
.NoneWhereAllBitsSet(
Vector4
)" />
886
/// <inheritdoc cref="
Vector4
.OnesComplement(
Vector4
)" />
891
/// <inheritdoc cref="
Vector4
.RadiansToDegrees(
Vector4
)" />
913
/// <inheritdoc cref="
Vector4
.Round(
Vector4
)" />
918
/// <inheritdoc cref="
Vector4
.Round(
Vector4
, MidpointRounding)" />
937
/// <inheritdoc cref="
Vector4
.Sin(
Vector4
)" />
941
/// <inheritdoc cref="
Vector4
.SinCos(
Vector4
)" />
964
/// <inheritdoc cref="
Vector4
.Sum(
Vector4
)" />
993
public static Vector3 Transform(Vector3 value, Quaternion rotation) =>
Vector4
.Transform(value.AsVector128Unsafe().WithElement(3, 1.0f), rotation.AsVector128()).AsVector3();
1011
/// <inheritdoc cref="
Vector4
.Truncate(
Vector4
)" />
1016
/// <inheritdoc cref="
Vector4
.Xor(
Vector4
,
Vector4
)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.Extensions.cs (10)
16
/// <summary>Converts a <see cref="Vector3" /> to a new <see cref="
Vector4
" /> with the new elements zeroed.</summary>
18
/// <returns><paramref name="value" /> converted to a new <see cref="
Vector4
" /> with the new elements zeroed.</returns>
19
public static
Vector4
AsVector4(this Vector3 value) => value.AsVector128().AsVector4();
21
/// <summary>Converts a <see cref="Vector3" /> to a new <see cref="
Vector4
" /> with the new elements undefined.</summary>
23
/// <returns><paramref name="value" /> converted to a new <see cref="
Vector4
" /> with the new elements undefined.</returns>
24
public static
Vector4
AsVector4Unsafe(this Vector3 value) => value.AsVector128Unsafe().AsVector4();
26
/// <inheritdoc cref="ExtractMostSignificantBits(
Vector4
)" />
31
/// <inheritdoc cref="GetElement(
Vector4
, int)" />
101
/// <inheritdoc cref="ToScalar(
Vector4
)" />
105
/// <inheritdoc cref="WithElement(
Vector4
, int, float)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.cs (330)
18
public partial struct Vector4 : IEquatable<
Vector4
>, IFormattable
20
/// <summary>Specifies the alignment of the vector as used by the <see cref="LoadAligned(float*)" /> and <see cref="Vector.StoreAligned(
Vector4
, float*)" /> APIs.</summary>
52
/// <summary>Creates a new <see cref="
Vector4
" /> object whose four elements have the same value.</summary>
61
/// <summary>Creates a new <see cref="
Vector4
" /> object from the specified <see cref="Vector2" /> object and a Z and a W component.</summary>
72
/// <summary>Constructs a new <see cref="
Vector4
" /> object from the specified <see cref="Vector3" /> object and a W component.</summary>
105
public static
Vector4
AllBitsSet
114
public static
Vector4
E
123
public static
Vector4
Epsilon
132
public static
Vector4
NaN
141
public static
Vector4
NegativeInfinity
150
public static
Vector4
NegativeZero
159
public static
Vector4
One
168
public static
Vector4
Pi
177
public static
Vector4
PositiveInfinity
186
public static
Vector4
Tau
195
public static
Vector4
UnitX
204
public static
Vector4
UnitY
213
public static
Vector4
UnitZ
222
public static
Vector4
UnitW
231
public static
Vector4
Zero
260
/// <remarks>The <see cref="op_Addition" /> method defines the addition operation for <see cref="
Vector4
" /> objects.</remarks>
263
public static
Vector4
operator +(
Vector4
left,
Vector4
right) => (left.AsVector128() + right.AsVector128()).AsVector4();
269
/// <remarks>The <see cref="
Vector4
.op_Division" /> method defines the division operation for <see cref="
Vector4
" /> objects.</remarks>
272
public static
Vector4
operator /(
Vector4
left,
Vector4
right) => (left.AsVector128() / right.AsVector128()).AsVector4();
278
/// <remarks>The <see cref="
Vector4
.op_Division" /> method defines the division operation for <see cref="
Vector4
" /> objects.</remarks>
281
public static
Vector4
operator /(
Vector4
value1, float value2) => (value1.AsVector128() / value2).AsVector4();
287
/// <remarks>Two <see cref="
Vector4
" /> objects are equal if each element in <paramref name="left" /> is equal to the corresponding element in <paramref name="right" />.</remarks>
290
public static bool operator ==(
Vector4
left,
Vector4
right) => left.AsVector128() == right.AsVector128();
298
public static bool operator !=(
Vector4
left,
Vector4
right) => left.AsVector128() != right.AsVector128();
304
/// <remarks>The <see cref="
Vector4
.op_Multiply" /> method defines the multiplication operation for <see cref="
Vector4
" /> objects.</remarks>
307
public static
Vector4
operator *(
Vector4
left,
Vector4
right) => (left.AsVector128() * right.AsVector128()).AsVector4();
313
/// <remarks>The <see cref="
Vector4
.op_Multiply" /> method defines the multiplication operation for <see cref="
Vector4
" /> objects.</remarks>
316
public static
Vector4
operator *(
Vector4
left, float right) => (left.AsVector128() * right).AsVector4();
322
/// <remarks>The <see cref="
Vector4
.op_Multiply" /> method defines the multiplication operation for <see cref="
Vector4
" /> objects.</remarks>
325
public static
Vector4
operator *(float left,
Vector4
right) => (right.AsVector128() * left).AsVector4();
331
/// <remarks>The <see cref="op_Subtraction" /> method defines the subtraction operation for <see cref="
Vector4
" /> objects.</remarks>
334
public static
Vector4
operator -(
Vector4
left,
Vector4
right) => (left.AsVector128() - right.AsVector128()).AsVector4();
339
/// <remarks>The <see cref="op_UnaryNegation" /> method defines the unary negation operation for <see cref="
Vector4
" /> objects.</remarks>
342
public static
Vector4
operator -(
Vector4
value) => (-value.AsVector128()).AsVector4();
347
public static
Vector4
operator &(
Vector4
left,
Vector4
right) => (left.AsVector128() & right.AsVector128()).AsVector4();
352
public static
Vector4
operator |(
Vector4
left,
Vector4
right) => (left.AsVector128() | right.AsVector128()).AsVector4();
357
public static
Vector4
operator ^(
Vector4
left,
Vector4
right) => (left.AsVector128() ^ right.AsVector128()).AsVector4();
362
public static
Vector4
operator <<(
Vector4
value, int shiftAmount) => (value.AsVector128() << shiftAmount).AsVector4();
367
public static
Vector4
operator ~(
Vector4
value) => (~value.AsVector128()).AsVector4();
372
public static
Vector4
operator >>(
Vector4
value, int shiftAmount) => (value.AsVector128() >> shiftAmount).AsVector4();
377
public static
Vector4
operator +(
Vector4
value) => value;
382
public static
Vector4
operator >>>(
Vector4
value, int shiftAmount) => (value.AsVector128() >>> shiftAmount).AsVector4();
389
public static
Vector4
Abs(
Vector4
value) => Vector128.Abs(value.AsVector128()).AsVector4();
397
public static
Vector4
Add(
Vector4
left,
Vector4
right) => (left.AsVector128() + right.AsVector128()).AsVector4();
402
public static bool All(
Vector4
vector, float value) => Vector128.All(vector.AsVector128(), value);
407
public static bool AllWhereAllBitsSet(
Vector4
vector) => Vector128.AllWhereAllBitsSet(vector.AsVector128());
412
public static
Vector4
AndNot(
Vector4
left,
Vector4
right) => Vector128.AndNot(left.AsVector128(), right.AsVector128()).AsVector4();
417
public static bool Any(
Vector4
vector, float value) => Vector128.Any(vector.AsVector128(), value);
422
public static bool AnyWhereAllBitsSet(
Vector4
vector) => Vector128.AnyWhereAllBitsSet(vector.AsVector128());
427
public static
Vector4
BitwiseAnd(
Vector4
left,
Vector4
right) => (left.AsVector128() & right.AsVector128()).AsVector4();
432
public static
Vector4
BitwiseOr(
Vector4
left,
Vector4
right) => (left.AsVector128() | right.AsVector128()).AsVector4();
437
public static
Vector4
Clamp(
Vector4
value1,
Vector4
min,
Vector4
max) => Vector128.Clamp(value1.AsVector128(), min.AsVector128(), max.AsVector128()).AsVector4();
442
public static
Vector4
ClampNative(
Vector4
value1,
Vector4
min,
Vector4
max) => Vector128.ClampNative(value1.AsVector128(), min.AsVector128(), max.AsVector128()).AsVector4();
447
public static
Vector4
ConditionalSelect(
Vector4
condition,
Vector4
left,
Vector4
right) => Vector128.ConditionalSelect(condition.AsVector128(), left.AsVector128(), right.AsVector128()).AsVector4();
452
public static
Vector4
CopySign(
Vector4
value,
Vector4
sign) => Vector128.CopySign(value.AsVector128(), sign.AsVector128()).AsVector4();
456
public static
Vector4
Cos(
Vector4
vector) => Vector128.Cos(vector.AsVector128()).AsVector4();
461
public static int Count(
Vector4
vector, float value) => Vector128.Count(vector.AsVector128(), value);
466
public static int CountWhereAllBitsSet(
Vector4
vector) => Vector128.CountWhereAllBitsSet(vector.AsVector128());
468
/// <summary>Creates a new <see cref="
Vector4
" /> object whose four elements have the same value.</summary>
470
/// <returns>A new <see cref="
Vector4
" /> whose four elements have the same value.</returns>
473
public static
Vector4
Create(float value) => Vector128.Create(value).AsVector4();
475
/// <summary>Creates a new <see cref="
Vector4
" /> object from the specified <see cref="Vector2" /> object and a Z and a W component.</summary>
479
/// <returns>A new <see cref="
Vector4
" /> from the specified <see cref="Vector2" /> object and a Z and a W component.</returns>
482
public static
Vector4
Create(Vector2 vector, float z, float w)
490
/// <summary>Constructs a new <see cref="
Vector4
" /> object from the specified <see cref="Vector3" /> object and a W component.</summary>
493
/// <returns>A new <see cref="
Vector4
" /> from the specified <see cref="Vector3" /> object and a W component.</returns>
496
public static
Vector4
Create(Vector3 vector, float w)
508
/// <returns>A new <see cref="
Vector4
" /> whose elements have the specified values.</returns>
511
public static
Vector4
Create(float x, float y, float z, float w) => Vector128.Create(x, y, z, w).AsVector4();
515
/// <returns>A new <see cref="
Vector4
" /> whose elements have the specified values.</returns>
518
public static
Vector4
Create(ReadOnlySpan<float> values)
524
return Unsafe.As<float,
Vector4
>(ref MemoryMarshal.GetReference(values));
529
/// <returns>A <see cref="
Vector4
" /> with <see cref="X" /> initialized <paramref name="x" /> and the remaining elements initialized to zero.</returns>
532
public static
Vector4
CreateScalar(float x) => Vector128.CreateScalar(x).AsVector4();
536
/// <returns>A <see cref="
Vector4
" /> with <see cref="X" /> initialized <paramref name="x" /> and the remaining elements left uninitialized.</returns>
539
public static
Vector4
CreateScalarUnsafe(float x) => Vector128.CreateScalarUnsafe(x).AsVector4();
549
/// The proposed Cross function for <see cref="
Vector4
"/> is nearly the same as that for
556
public static
Vector4
Cross(
Vector4
vector1,
Vector4
vector2)
583
public static
Vector4
DegreesToRadians(
Vector4
degrees) => Vector128.DegreesToRadians(degrees.AsVector128()).AsVector4();
591
public static float Distance(
Vector4
value1,
Vector4
value2) => Vector128.Distance(value1.AsVector128(), value2.AsVector128());
599
public static float DistanceSquared(
Vector4
value1,
Vector4
value2) => Vector128.DistanceSquared(value1.AsVector128(), value2.AsVector128());
607
public static
Vector4
Divide(
Vector4
left,
Vector4
right) => (left.AsVector128() / right.AsVector128()).AsVector4();
615
public static
Vector4
Divide(
Vector4
left, float divisor) => (left.AsVector128() / divisor).AsVector4();
623
public static float Dot(
Vector4
vector1,
Vector4
vector2) => Vector128.Dot(vector1.AsVector128(), vector2.AsVector128());
627
public static
Vector4
Exp(
Vector4
vector) => Vector128.Exp(vector.AsVector128()).AsVector4();
632
public static
Vector4
Equals(
Vector4
left,
Vector4
right) => Vector128.Equals(left.AsVector128(), right.AsVector128()).AsVector4();
637
public static bool EqualsAll(
Vector4
left,
Vector4
right) => Vector128.EqualsAll(left.AsVector128(), right.AsVector128());
642
public static bool EqualsAny(
Vector4
left,
Vector4
right) => Vector128.EqualsAny(left.AsVector128(), right.AsVector128());
647
public static
Vector4
FusedMultiplyAdd(
Vector4
left,
Vector4
right,
Vector4
addend) => Vector128.FusedMultiplyAdd(left.AsVector128(), right.AsVector128(), addend.AsVector128()).AsVector4();
652
public static
Vector4
GreaterThan(
Vector4
left,
Vector4
right) => Vector128.GreaterThan(left.AsVector128(), right.AsVector128()).AsVector4();
657
public static bool GreaterThanAll(
Vector4
left,
Vector4
right) => Vector128.GreaterThanAll(left.AsVector128(), right.AsVector128());
662
public static bool GreaterThanAny(
Vector4
left,
Vector4
right) => Vector128.GreaterThanAny(left.AsVector128(), right.AsVector128());
667
public static
Vector4
GreaterThanOrEqual(
Vector4
left,
Vector4
right) => Vector128.GreaterThanOrEqual(left.AsVector128(), right.AsVector128()).AsVector4();
672
public static bool GreaterThanOrEqualAll(
Vector4
left,
Vector4
right) => Vector128.GreaterThanOrEqualAll(left.AsVector128(), right.AsVector128());
677
public static bool GreaterThanOrEqualAny(
Vector4
left,
Vector4
right) => Vector128.GreaterThanOrEqualAny(left.AsVector128(), right.AsVector128());
682
public static
Vector4
Hypot(
Vector4
x,
Vector4
y) => Vector128.Hypot(x.AsVector128(), y.AsVector128()).AsVector4();
687
public static int IndexOf(
Vector4
vector, float value) => Vector128.IndexOf(vector.AsVector128(), value);
692
public static int IndexOfWhereAllBitsSet(
Vector4
vector) => Vector128.IndexOfWhereAllBitsSet(vector.AsVector128());
697
public static
Vector4
IsEvenInteger(
Vector4
vector) => Vector128.IsEvenInteger(vector.AsVector128()).AsVector4();
702
public static
Vector4
IsFinite(
Vector4
vector) => Vector128.IsFinite(vector.AsVector128()).AsVector4();
707
public static
Vector4
IsInfinity(
Vector4
vector) => Vector128.IsInfinity(vector.AsVector128()).AsVector4();
712
public static
Vector4
IsInteger(
Vector4
vector) => Vector128.IsInteger(vector.AsVector128()).AsVector4();
717
public static
Vector4
IsNaN(
Vector4
vector) => Vector128.IsNaN(vector.AsVector128()).AsVector4();
722
public static
Vector4
IsNegative(
Vector4
vector) => Vector128.IsNegative(vector.AsVector128()).AsVector4();
727
public static
Vector4
IsNegativeInfinity(
Vector4
vector) => Vector128.IsNegativeInfinity(vector.AsVector128()).AsVector4();
732
public static
Vector4
IsNormal(
Vector4
vector) => Vector128.IsNormal(vector.AsVector128()).AsVector4();
737
public static
Vector4
IsOddInteger(
Vector4
vector) => Vector128.IsOddInteger(vector.AsVector128()).AsVector4();
742
public static
Vector4
IsPositive(
Vector4
vector) => Vector128.IsPositive(vector.AsVector128()).AsVector4();
747
public static
Vector4
IsPositiveInfinity(
Vector4
vector) => Vector128.IsPositiveInfinity(vector.AsVector128()).AsVector4();
752
public static
Vector4
IsSubnormal(
Vector4
vector) => Vector128.IsSubnormal(vector.AsVector128()).AsVector4();
757
public static
Vector4
IsZero(
Vector4
vector) => Vector128.IsZero(vector.AsVector128()).AsVector4();
762
public static int LastIndexOf(
Vector4
vector, float value) => Vector128.LastIndexOf(vector.AsVector128(), value);
767
public static int LastIndexOfWhereAllBitsSet(
Vector4
vector) => Vector128.LastIndexOfWhereAllBitsSet(vector.AsVector128());
769
/// <inheritdoc cref="Lerp(
Vector4
,
Vector4
,
Vector4
)" />
775
public static
Vector4
Lerp(
Vector4
value1,
Vector4
value2, float amount) => Vector128.Lerp(value1.AsVector128(), value2.AsVector128(), Vector128.Create(amount)).AsVector4();
780
public static
Vector4
Lerp(
Vector4
value1,
Vector4
value2,
Vector4
amount) => Vector128.Lerp(value1.AsVector128(), value2.AsVector128(), amount.AsVector128()).AsVector4();
785
public static
Vector4
LessThan(
Vector4
left,
Vector4
right) => Vector128.LessThan(left.AsVector128(), right.AsVector128()).AsVector4();
790
public static bool LessThanAll(
Vector4
left,
Vector4
right) => Vector128.LessThanAll(left.AsVector128(), right.AsVector128());
795
public static bool LessThanAny(
Vector4
left,
Vector4
right) => Vector128.LessThanAny(left.AsVector128(), right.AsVector128());
800
public static
Vector4
LessThanOrEqual(
Vector4
left,
Vector4
right) => Vector128.LessThanOrEqual(left.AsVector128(), right.AsVector128()).AsVector4();
805
public static bool LessThanOrEqualAll(
Vector4
left,
Vector4
right) => Vector128.LessThanOrEqualAll(left.AsVector128(), right.AsVector128());
810
public static bool LessThanOrEqualAny(
Vector4
left,
Vector4
right) => Vector128.LessThanOrEqualAny(left.AsVector128(), right.AsVector128());
816
public static unsafe
Vector4
Load(float* source) => Vector128.Load(source).AsVector4();
822
public static unsafe
Vector4
LoadAligned(float* source) => Vector128.LoadAligned(source).AsVector4();
828
public static unsafe
Vector4
LoadAlignedNonTemporal(float* source) => Vector128.LoadAlignedNonTemporal(source).AsVector4();
833
public static
Vector4
LoadUnsafe(ref readonly float source) => Vector128.LoadUnsafe(in source).AsVector4();
839
public static
Vector4
LoadUnsafe(ref readonly float source, nuint elementOffset) => Vector128.LoadUnsafe(in source, elementOffset).AsVector4();
843
public static
Vector4
Log(
Vector4
vector) => Vector128.Log(vector.AsVector128()).AsVector4();
847
public static
Vector4
Log2(
Vector4
vector) => Vector128.Log2(vector.AsVector128()).AsVector4();
852
public static
Vector4
Max(
Vector4
value1,
Vector4
value2) => Vector128.Max(value1.AsVector128(), value2.AsVector128()).AsVector4();
857
public static
Vector4
MaxMagnitude(
Vector4
value1,
Vector4
value2) => Vector128.MaxMagnitude(value1.AsVector128(), value2.AsVector128()).AsVector4();
862
public static
Vector4
MaxMagnitudeNumber(
Vector4
value1,
Vector4
value2) => Vector128.MaxMagnitudeNumber(value1.AsVector128(), value2.AsVector128()).AsVector4();
867
public static
Vector4
MaxNative(
Vector4
value1,
Vector4
value2) => Vector128.MaxNative(value1.AsVector128(), value2.AsVector128()).AsVector4();
872
public static
Vector4
MaxNumber(
Vector4
value1,
Vector4
value2) => Vector128.MaxNumber(value1.AsVector128(), value2.AsVector128()).AsVector4();
877
public static
Vector4
Min(
Vector4
value1,
Vector4
value2) => Vector128.Min(value1.AsVector128(), value2.AsVector128()).AsVector4();
882
public static
Vector4
MinMagnitude(
Vector4
value1,
Vector4
value2) => Vector128.MinMagnitude(value1.AsVector128(), value2.AsVector128()).AsVector4();
887
public static
Vector4
MinMagnitudeNumber(
Vector4
value1,
Vector4
value2) => Vector128.MinMagnitudeNumber(value1.AsVector128(), value2.AsVector128()).AsVector4();
892
public static
Vector4
MinNative(
Vector4
value1,
Vector4
value2) => Vector128.MinNative(value1.AsVector128(), value2.AsVector128()).AsVector4();
897
public static
Vector4
MinNumber(
Vector4
value1,
Vector4
value2) => Vector128.MinNumber(value1.AsVector128(), value2.AsVector128()).AsVector4();
905
public static
Vector4
Multiply(
Vector4
left,
Vector4
right) => (left.AsVector128() * right.AsVector128()).AsVector4();
913
public static
Vector4
Multiply(
Vector4
left, float right) => (left.AsVector128() * right).AsVector4();
921
public static
Vector4
Multiply(float left,
Vector4
right) => (right.AsVector128() * left).AsVector4();
926
public static
Vector4
MultiplyAddEstimate(
Vector4
left,
Vector4
right,
Vector4
addend) => Vector128.MultiplyAddEstimate(left.AsVector128(), right.AsVector128(), addend.AsVector128()).AsVector4();
933
public static
Vector4
Negate(
Vector4
value) => (-value.AsVector128()).AsVector4();
938
public static bool None(
Vector4
vector, float value) => Vector128.None(vector.AsVector128(), value);
943
public static bool NoneWhereAllBitsSet(
Vector4
vector) => Vector128.NoneWhereAllBitsSet(vector.AsVector128());
950
public static
Vector4
Normalize(
Vector4
vector) => Vector128.Normalize(vector.AsVector128()).AsVector4();
955
public static
Vector4
OnesComplement(
Vector4
value) => (~value.AsVector128()).AsVector4();
960
public static
Vector4
RadiansToDegrees(
Vector4
radians) => Vector128.RadiansToDegrees(radians.AsVector128()).AsVector4();
965
public static
Vector4
Round(
Vector4
vector) => Vector128.Round(vector.AsVector128()).AsVector4();
970
public static
Vector4
Round(
Vector4
vector, MidpointRounding mode) => Vector128.Round(vector.AsVector128(), mode).AsVector4();
980
public static
Vector4
Shuffle(
Vector4
vector, byte xIndex, byte yIndex, byte zIndex, byte wIndex)
987
public static
Vector4
Sin(
Vector4
vector) => Vector128.Sin(vector.AsVector128()).AsVector4();
991
public static (
Vector4
Sin,
Vector4
Cos) SinCos(
Vector4
vector)
1002
public static
Vector4
SquareRoot(
Vector4
value) => Vector128.Sqrt(value.AsVector128()).AsVector4();
1010
public static
Vector4
Subtract(
Vector4
left,
Vector4
right) => (left.AsVector128() - right.AsVector128()).AsVector4();
1015
public static float Sum(
Vector4
value) => Vector128.Sum(value.AsVector128());
1022
public static
Vector4
Transform(Vector2 position, Matrix4x4 matrix) => Vector2.Transform(position.AsVector128Unsafe(), in matrix.AsROImpl()).AsVector4();
1029
public static
Vector4
Transform(Vector2 value, Quaternion rotation) => Transform(value.AsVector128().WithElement(3, 1.0f), rotation.AsVector128()).AsVector4();
1036
public static
Vector4
Transform(Vector3 position, Matrix4x4 matrix) => Vector3.Transform(position.AsVector128Unsafe(), in matrix.AsROImpl()).AsVector4();
1043
public static
Vector4
Transform(Vector3 value, Quaternion rotation) => Transform(value.AsVector128Unsafe().WithElement(3, 1.0f), rotation.AsVector128()).AsVector4();
1050
public static
Vector4
Transform(
Vector4
vector, Matrix4x4 matrix) => Transform(vector.AsVector128(), in matrix.AsROImpl()).AsVector4();
1070
public static
Vector4
Transform(
Vector4
value, Quaternion rotation) => Transform(value.AsVector128(), rotation.AsVector128()).AsVector4();
1086
public static
Vector4
Truncate(
Vector4
vector) => Vector128.Truncate(vector.AsVector128()).AsVector4();
1091
public static
Vector4
Xor(
Vector4
left,
Vector4
right) => (left.AsVector128() ^ right.AsVector128()).AsVector4();
1106
Unsafe.As<float,
Vector4
>(ref array[0]) = this;
1134
Unsafe.As<float,
Vector4
>(ref array[index]) = this;
1147
Unsafe.As<float,
Vector4
>(ref MemoryMarshal.GetReference(destination)) = this;
1161
Unsafe.As<float,
Vector4
>(ref MemoryMarshal.GetReference(destination)) = this;
1170
public readonly bool Equals(
Vector4
other) => this.AsVector128().Equals(other.AsVector128());
1175
/// <remarks>The current instance and <paramref name="obj" /> are equal if <paramref name="obj" /> is a <see cref="
Vector4
" /> object and their corresponding elements are equal.</remarks>
1176
public override readonly bool Equals([NotNullWhen(true)] object? obj) => (obj is
Vector4
other) && Equals(other);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.Extensions.cs (20)
13
/// <summary>Reinterprets a <see cref="
Vector4
" /> as a new <see cref="Plane" />.</summary>
16
public static Plane AsPlane(this
Vector4
value) => Unsafe.BitCast<
Vector4
, Plane>(value);
18
/// <summary>Reinterprets a <see cref="
Vector4
" /> as a new <see cref="Quaternion" />.</summary>
21
public static Quaternion AsQuaternion(this
Vector4
value) => Unsafe.BitCast<
Vector4
, Quaternion>(value);
23
/// <summary>Reinterprets a <see cref="
Vector4
" /> as a new <see cref="Vector2" />.</summary>
26
public static Vector2 AsVector2(this
Vector4
value) => value.AsVector128().AsVector2();
28
/// <summary>Reinterprets a <see cref="
Vector4
" /> as a new <see cref="Vector3" />.</summary>
31
public static Vector3 AsVector3(this
Vector4
value) => value.AsVector128().AsVector3();
36
public static uint ExtractMostSignificantBits(this
Vector4
vector) => vector.AsVector128().ExtractMostSignificantBits();
40
public static float GetElement(this
Vector4
vector, int index) => vector.AsVector128().GetElement(index);
46
public static void Store(this
Vector4
source, float* destination) => source.AsVector128().Store(destination);
54
public static void StoreAligned(this
Vector4
source, float* destination) => source.AsVector128().StoreAligned(destination);
62
public static void StoreAlignedNonTemporal(this
Vector4
source, float* destination) => source.AsVector128().StoreAlignedNonTemporal(destination);
68
public static void StoreUnsafe(this
Vector4
source, ref float destination) => source.AsVector128().StoreUnsafe(ref destination);
76
public static void StoreUnsafe(this
Vector4
source, ref float destination, nuint elementOffset) => source.AsVector128().StoreUnsafe(ref destination, elementOffset);
80
public static float ToScalar(this
Vector4
vector) => vector.AsVector128().ToScalar();
84
public static
Vector4
WithElement(this
Vector4
vector, int index, float value) => vector.AsVector128().WithElement(index, value).AsVector4();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.Numerics.cs (66)
12
/// <inheritdoc cref="
Vector4
.All(
Vector4
, float)" />
17
/// <inheritdoc cref="
Vector4
.All(
Vector4
, float)" />
22
/// <inheritdoc cref="
Vector4
.AllWhereAllBitsSet(
Vector4
)" />
27
/// <inheritdoc cref="
Vector4
.AllWhereAllBitsSet(
Vector4
)" />
32
/// <inheritdoc cref="
Vector4
.Any(
Vector4
, float)" />
37
/// <inheritdoc cref="
Vector4
.Any(
Vector4
, float)" />
42
/// <inheritdoc cref="
Vector4
.AnyWhereAllBitsSet(
Vector4
)" />
47
/// <inheritdoc cref="
Vector4
.AnyWhereAllBitsSet(
Vector4
)" />
80
public static Vector128<float> AsVector128(this Vector2 value) =>
Vector4
.Create(value, 0, 0).AsVector128();
86
public static Vector128<float> AsVector128(this Vector3 value) =>
Vector4
.Create(value, 0).AsVector128();
92
public static Vector128<float> AsVector128(this
Vector4
value) => Unsafe.BitCast<
Vector4
, Vector128<float>>(value);
160
/// <summary>Reinterprets a <see langword="Vector128<Single>" /> as a new <see cref="
Vector4
" />.</summary>
162
/// <returns><paramref name="value" /> reinterpreted as a new <see cref="
Vector4
" />.</returns>
164
public static
Vector4
AsVector4(this Vector128<float> value) => Unsafe.BitCast<Vector128<float>,
Vector4
>(value);
183
/// <inheritdoc cref="
Vector4
.Count(
Vector4
, float)" />
188
/// <inheritdoc cref="
Vector4
.Count(
Vector4
, float)" />
193
/// <inheritdoc cref="
Vector4
.CountWhereAllBitsSet(
Vector4
)" />
198
/// <inheritdoc cref="
Vector4
.CountWhereAllBitsSet(
Vector4
)" />
203
/// <inheritdoc cref="
Vector4
.Distance(
Vector4
,
Vector4
)" />
212
/// <inheritdoc cref="
Vector4
.DistanceSquared(
Vector4
,
Vector4
)" />
221
/// <inheritdoc cref="
Vector4
.IndexOf(
Vector4
, float)" />
226
/// <inheritdoc cref="
Vector4
.IndexOf(
Vector4
, float)" />
231
/// <inheritdoc cref="
Vector4
.IndexOfWhereAllBitsSet(
Vector4
)" />
236
/// <inheritdoc cref="
Vector4
.IndexOfWhereAllBitsSet(
Vector4
)" />
241
/// <inheritdoc cref="
Vector4
.LastIndexOf(
Vector4
, float)" />
246
/// <inheritdoc cref="
Vector4
.LastIndexOf(
Vector4
, float)" />
251
/// <inheritdoc cref="
Vector4
.LastIndexOfWhereAllBitsSet(
Vector4
)" />
256
/// <inheritdoc cref="
Vector4
.LastIndexOfWhereAllBitsSet(
Vector4
)" />
261
/// <inheritdoc cref="
Vector4
.Length()" />
266
/// <inheritdoc cref="
Vector4
.LengthSquared()" />
271
/// <inheritdoc cref="
Vector4
.None(
Vector4
, float)" />
276
/// <inheritdoc cref="
Vector4
.None(
Vector4
, float)" />
281
/// <inheritdoc cref="
Vector4
.NoneWhereAllBitsSet(
Vector4
)" />
286
/// <inheritdoc cref="
Vector4
.NoneWhereAllBitsSet(
Vector4
)" />
291
/// <inheritdoc cref="
Vector4
.Normalize(
Vector4
)" />