PawelTroka / Computator.NET

Computator.NET is a special kind of numerical software that is fast and easy to use but not worse than others feature-wise. It's features include: - Real and complex functions charts - Real and complex calculator - Real functions numerical calculations including different methods - Over 107 Elementary functions - Over 141 Special functions - Over 21 Matrix functions and operations - Scripting language with power to easy computations including matrices - You can declare your own custom functions with scripting language
GNU General Public License v3.0
234 stars 51 forks source link

Lack of implicit conversion from MathNet.Numerics.LinearAlgebra.Matrix<double> to MathNet.Numerics.LinearAlgebra.Matrix<System.Numerics.Complex> causes TSL errors #18

Open PawelTroka opened 7 years ago

PawelTroka commented 7 years ago

See #https://github.com/mathnet/mathnet-numerics/issues/304 Lack of this implicit conversion causes below TSL code to not run properly: Example below code will throw error:

var n = 5;

var m1 = matrix<real>(n,n);
var m2 = matrix<complex>(n,n);

writeln(m1+m2);

image

Another example where it will fail:

var m = sqrt(-1)·matrix({{1,0}});

cdrnet commented 7 years ago

Do you work with the generic base types (Matrix<T>, Vector<T>) or with the explicit types in the sub-namespaces? It seems to me we should rather add conversion on the base types (which essentially call ToComplex etc.) rather than on the explicit types.

PawelTroka commented 7 years ago

@cdrnet Yeah, you are right - sorry I missed that. We only need implicit conversion on the base types.