Vectors and matrices are value types in Math.Net Numerics.

huangapple go评论78阅读模式
英文:

Are vectors and matrices reference or value types? Math.Net Numerics

问题

请原谅我的无知,向量和矩阵是引用类型还是值类型?不确定是否有区别,但我是指从数组创建的那些?

我尝试在网上快速查找,但找不到答案。

我在我的代码中尝试了一些东西,得出它们是引用类型的结论,但作为我这样的初学者,我想向专家确认一下。

英文:

Excuse my ignorance, but are vectors and matrices reference or value types? Not sure if that makes a difference, but I am referring to those created from an array?

I tried to look it up online quickly, but couldn't find the answer.

I tried a few things in my code that made me conclude they are reference types, but being the beginner I am, I wanted to confirm from the experts.

答案1

得分: 3

Math.NET Numerics的VectorMatrix是引用类型:

public abstract partial class Vector<T> : IFormattable, IEquatable<Vector<T>>, IList, IList<T>, ICloneable
        where T : struct, IEquatable<T>, IFormattable

public abstract partial class Matrix<T> : IFormattable, IEquatable<Matrix<T>>, ICloneable
        where T : struct, IEquatable<T>, IFormattable
英文:

Math.NET Numerics Vector and Matrix are reference types:

public abstract partial class Vector&lt;T&gt; : IFormattable, IEquatable&lt;Vector&lt;T&gt;&gt;, IList, IList&lt;T&gt;, ICloneable
        where T : struct, IEquatable&lt;T&gt;, IFormattable

public abstract partial class Matrix&lt;T&gt; : IFormattable, IEquatable&lt;Matrix&lt;T&gt;&gt;, ICloneable
        where T : struct, IEquatable&lt;T&gt;, IFormattable

huangapple
  • 本文由 发表于 2023年2月18日 07:15:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/75490031.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定