Created
November 25, 2014 22:05
-
-
Save SquidDev/128d9fc3bab62478afba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using MathNet.Numerics.LinearAlgebra; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace Testing | |
{ | |
[TestClass] | |
public class UnitTest1 | |
{ | |
[TestMethod] | |
public void TestMethod1() | |
{ | |
Matrix<float> a = Matrix<float>.Build.Dense(2, 2, new float[] { 10, 19, 25, 10 }); | |
Console.WriteLine("Det {0}", a.Determinant()); | |
Console.WriteLine("Det Int {0}", (int)a.Determinant()); | |
Console.WriteLine("Det Trunc {0}", Math.Truncate(a.Determinant())); | |
Console.WriteLine("Det Round {0}", Math.Round(a.Determinant())); | |
Console.WriteLine("Det floor {0}", Math.Floor(a.Determinant())); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run: | |
Det -375 | |
Det Int -374 | |
Det Trunc -374 | |
Det Round -375 | |
Det floor -375 | |
Debug: | |
Det -375 | |
Det Int -375 | |
Det Trunc -375 | |
Det Round -375 | |
Det floor -376 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment