Exemple #1
0
        public void ValidatePaddedDoubleGetInstanceFromSparse()
        {
            SparseMatrix <string, string, double> sparseMatObj =
                CreateSimpleSparseMatrix();

            sparseMatObj.WriteSparse(Constants.FastQTempTxtFileName);

            PaddedDouble pdObj =
                PaddedDouble.GetInstanceFromSparse(Constants.FastQTempTxtFileName);

            Assert.AreEqual(sparseMatObj.ColCount, pdObj.ColCount);
            Assert.AreEqual(sparseMatObj.RowCount, pdObj.RowCount);
            Assert.AreEqual(sparseMatObj.RowKeys.Count, pdObj.RowKeys.Count);
            Assert.AreEqual(sparseMatObj.ColKeys.Count, pdObj.ColKeys.Count);

            if (File.Exists(Constants.FastQTempTxtFileName))
            {
                File.Delete(Constants.FastQTempTxtFileName);
            }

            Console.WriteLine(
                "PaddedDouble BVT : Validation of GetInstanceFromSparse() method successful");
            ApplicationLog.WriteLine(
                "PaddedDouble BVT : Validation of GetInstanceFromSparse() method successful");
        }
Exemple #2
0
        public void ValidatePaddedDoubleGetInstanceFromSparseEnum()
        {
            RowKeyColKeyValue <string, string, double> rowKeyObj =
                new RowKeyColKeyValue <string, string, double>("R0", "C0", 2);

            List <RowKeyColKeyValue <string, string, double> > enumObj =
                new List <RowKeyColKeyValue <string, string, double> >();

            enumObj.Add(rowKeyObj);

            PaddedDouble pdObj =
                PaddedDouble.GetInstanceFromSparse(enumObj);

            Assert.AreEqual(1, pdObj.ColCount);
            Assert.AreEqual(1, pdObj.RowCount);
            Assert.AreEqual("R0", pdObj.RowKeys[0]);
            Assert.AreEqual("C0", pdObj.ColKeys[0]);

            ApplicationLog.WriteLine(
                "PaddedDouble BVT : Validation of GetInstanceFromSparse(enum) method successful");
        }