public void Bipolar2Double()
{
// test a 1x4
bool[] boolData1 = { true, false, true, false };
double[] checkData1 = { 1, -1, 1, -1 };
Matrix matrix1 = Matrix.CreateRowMatrix(BiPolarUtil.Bipolar2double(boolData1));
Matrix checkMatrix1 = Matrix.CreateRowMatrix(checkData1);
Assert.IsTrue(matrix1.Equals(checkMatrix1));
// test a 2x2
bool[][] boolData2 =
{
new[] { true, false },
new[] { false, true }
};
double[][] checkData2 =
{
new[] { 1.0, -1.0 },
new[] { -1.0, 1.0 }
};
var matrix2 = new Matrix(BiPolarUtil.Bipolar2double(boolData2));
var checkMatrix2 = new Matrix(checkData2);
Assert.IsTrue(matrix2.Equals(checkMatrix2));
}