public void DescriptiveAnalysisConstructorTest1() { double[,] data = { // hours minutes weekedays { 7, 52, (int)DayOfWeek.Monday }, { 3, 12, (int)DayOfWeek.Friday }, { 23, 12, (int)DayOfWeek.Thursday }, { 21, 42, (int)DayOfWeek.Saturday }, { 5, 13, (int)DayOfWeek.Friday }, { 15, 16, (int)DayOfWeek.Saturday }, { 6, 8, (int)DayOfWeek.Sunday }, { 8, 22, (int)DayOfWeek.Friday }, }; double[] lengths = { 24, 60, 7 }; // Create the analysis var analysis = new CircularDescriptiveAnalysis(data, lengths); // Compute analysis.Compute(); test(analysis); }
public void DescriptiveAnalysis_InPlaceRow() { double[,] data = { // hours minutes weekedays { 7, 52, (int)DayOfWeek.Monday }, { 3, 12, (int)DayOfWeek.Friday }, { 23, 12, (int)DayOfWeek.Thursday }, { 21, 42, (int)DayOfWeek.Saturday }, { 5, 13, (int)DayOfWeek.Friday }, { 15, 16, (int)DayOfWeek.Saturday }, { 6, 8, (int)DayOfWeek.Sunday }, { 8, 22, (int)DayOfWeek.Friday }, }; double[] lengths = { 24 }; double[] row = data.GetColumn(0); double[] original = data.GetColumn(0); // Create the analysis var analysis = new CircularDescriptiveAnalysis(row, 24, "Hours", inPlace: true); // Compute analysis.Compute(); testOne(analysis, original, 24); Assert.AreSame(row, analysis.Angles[0]); }
public void DataBindTest() { double[,] data = { // hours minutes { 7, 52 }, { 3, 12 }, { 23, 12 }, { 21, 42 }, { 5, 13 }, { 15, 16 }, { 6, 8 }, { 8, 22 }, }; double[] lengths = { 24, 60 }; var analysis = new CircularDescriptiveAnalysis(data, lengths); analysis.Compute(); var m0 = analysis.Measures[0]; var m1 = analysis.Measures[1]; Assert.AreEqual(0, m0.Index); Assert.AreEqual(1, m1.Index); Assert.AreEqual("Column 0", m0.Name); Assert.AreEqual("Column 1", m1.Name); Assert.AreEqual(m0, analysis.Measures["Column 0"]); Assert.AreEqual(m1, analysis.Measures["Column 1"]); // var box = DataGridBox.Show(analysis.Measures); // Assert.AreEqual(23, box.DataGridView.Columns.Count); }
public void DataBindTest() { double[,] data = { // hours minutes { 7, 52 }, { 3, 12 }, { 23, 12 }, { 21, 42 }, { 5, 13 }, { 15, 16 }, { 6, 8 }, { 8, 22 }, }; double[] lengths = { 24, 60 }; var analysis = new CircularDescriptiveAnalysis(data, lengths); analysis.Compute(); var m0 = analysis.Measures[0]; var m1 = analysis.Measures[1]; Assert.AreEqual(0, m0.Index); Assert.AreEqual(1, m1.Index); Assert.AreEqual("Column 0", m0.Name); Assert.AreEqual("Column 1", m1.Name); Assert.AreEqual(m0, analysis.Measures["Column 0"]); Assert.AreEqual(m1, analysis.Measures["Column 1"]); // var box = Accord.Controls.DataGridBox.Show(analysis.Measures); // Assert.AreEqual(23, box.DataGridView.Columns.Count); }