Question about the arguments type and the return type in specific methods #813
-
C# is a strongly-typed language, when I use MathNet.Numerics in C#, this put me to trouble. for example: But we don't need to do that in MATLAB, so I'm wondering is there any better practice? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The type-safety is intentional and generally desired and wanted. It does mean that you can, but also have to, be aware of what domain you're computing in. Technically we could offer all operations also cross-type, unfortunately this would explode the API in a way that is hard to justify. So you'll essentially have to find a good boundary in your algorithms between real and complex domain areas, and convert whenever you have to cross that boundary, e.g. using |
Beta Was this translation helpful? Give feedback.
-
I got it. Thanks |
Beta Was this translation helpful? Give feedback.
The type-safety is intentional and generally desired and wanted. It does mean that you can, but also have to, be aware of what domain you're computing in.
Technically we could offer all operations also cross-type, unfortunately this would explode the API in a way that is hard to justify. So you'll essentially have to find a good boundary in your algorithms between real and complex domain areas, and convert whenever you have to cross that boundary, e.g. using
ToComplex32()
.