Ejemplo n.º 1
0
        public static Parameter <MatrixQuery <T> > .Builder SetDefaultQuery <T>(this Parameter <MatrixQuery <T> > .Builder builder, string query,
                                                                                ITypeConverter <double, T> numberConverter)
        {
            var converter = MatrixQuery <T> .CreateTypeConverter(numberConverter);

            return(builder.SetDefaultValue(converter.ConvertBackward(query)).SetTypeConverters(converter));
        }
Ejemplo n.º 2
0
        public void Should_be_able_perform_all_queries()
        {
            var query = new MatrixQuery(DatabaseGateway, new MatrixQueryFactory());

            using (TransactionScopeFactory.Create())
                using (DatabaseContextFactory.Create())
                {
                    Assert.That(() => query.Get(Guid.NewGuid()), Throws.TypeOf <RecordNotFoundException>());
                    Assert.That(() => query.All(), Throws.Nothing);
                    Assert.That(() => query.Search(new MatrixSearchSpecification()), Throws.Nothing);
                    Assert.That(() => query.Constraints(Guid.NewGuid()), Throws.Nothing);
                    Assert.That(() => query.Elements(Guid.NewGuid()), Throws.Nothing);
                }
        }
Ejemplo n.º 3
0
                    public static BandpassFilter[] Parse(MatrixQuery matrixQuery)
                    {
                        var matrix = matrixQuery?.GetMatrix();

                        if (matrix == null || matrix.Length == 0)
                        {
                            return(null);
                        }
                        var filterCount     = matrix.GetRowCount();
                        var bandpassFilters = new BandpassFilter[filterCount];

                        for (var r = 0; r < filterCount; r++)
                        {
                            bandpassFilters[r] = new BandpassFilter(matrix[r, 0], matrix[r, 1]);
                        }
                        return(bandpassFilters);
                    }
Ejemplo n.º 4
0
        public static Parameter <MatrixQuery <double> > .Builder SetDefaultQuery(this Parameter <MatrixQuery <double> > .Builder builder, string query)
        {
            var converter = MatrixQuery <double> .CreateTypeConverter(IdentityTypeConverter <double> .Instance);

            return(builder.SetDefaultValue(converter.ConvertBackward(query)).SetTypeConverters(converter));
        }