/// <summary>Initializes a new instance of the <see cref="HParametrization"/> class.
            /// </summary>
            /// <param name="gridPointMatrix">The grid point matrix.</param>
            /// <param name="verticalCurveFactory">A factory for grid point curves along vertical direction, i.e. taken into account a specified interpolation, parametrization etc.</param>
            /// <param name="horizontalParametrization">The interpolation approach along horizontal direction.</param>
            internal HParametrization(LabelMatrix <THorizontalLabel, TVerticalLabel> gridPointMatrix, Func <THorizontalLabel, IGridPointCurveFactory <TVerticalLabel> > verticalCurveFactory, GridPointCurve.Parametrization horizontalParametrization)
                : base(gridPointMatrix, verticalCurveFactory)
            {
                m_HorizontalParametrizationFactory = horizontalParametrization ?? throw new NullReferenceException(nameof(horizontalParametrization));
                m_HorizontalParametrization        = horizontalParametrization.Create();

                m_TempValuesForHorizontalEvaluation = new double[m_HorizontalDoubleLabels.Length];
                m_TempHorizontalDoubleLabels        = new double[m_GridPointMatrix.ColumnCount];
            }
Exemple #2
0
 /// <summary>Creates a specified two-dimensional surface, where the interpolation, parametrization etc. takes place first in vertical direction and then in horizontal direction.
 /// </summary>
 /// <typeparam name="THorizontalLabel">The type of the horizontal label.</typeparam>
 /// <typeparam name="TVerticalLabel">The type of the vertical label.</typeparam>
 /// <param name="gridPoints">The grid points in its <see cref="LabelMatrix&lt;THorizontalLabel,TVerticalLabel&gt;"/> representation.</param>
 /// <param name="verticalCurveFactory">A factory for horizontal grid point curves.</param>
 /// <param name="horizontalParametrization">The (curve) parametrization in horizontal direction.</param>
 /// <returns>An object that repesents the two-dimensional surface with respect to the specified grid points and interpolation/extrapolation.</returns>
 public static IGridPointSurface2d <THorizontalLabel, TVerticalLabel> Create <THorizontalLabel, TVerticalLabel>(LabelMatrix <THorizontalLabel, TVerticalLabel> gridPoints, Func <THorizontalLabel, IGridPointCurveFactory <TVerticalLabel> > verticalCurveFactory, GridPointCurve.Parametrization horizontalParametrization)
     where THorizontalLabel : IComparable <THorizontalLabel>, IEquatable <THorizontalLabel>
     where TVerticalLabel : IComparable <TVerticalLabel>, IEquatable <TVerticalLabel>
 {
     if (gridPoints == null)
     {
         throw new ArgumentNullException(nameof(gridPoints));
     }
     if (verticalCurveFactory == null)
     {
         throw new ArgumentNullException(nameof(verticalCurveFactory));
     }
     return(new VerticalHorizontalWiseSurface2d <THorizontalLabel, TVerticalLabel> .HParametrization(gridPoints, verticalCurveFactory, horizontalParametrization));
 }
Exemple #3
0
        /// <summary>Creates a specified two-dimensional surface.
        /// </summary>
        /// <typeparam name="THorizontalLabel">The type of the horizontal label.</typeparam>
        /// <typeparam name="TVerticalLabel">The type of the vertical label.</typeparam>
        /// <param name="gridPoints">The grid points in its <see cref="LabelMatrix&lt;THorizontalLabel,TVerticalLabel&gt;"/> representation.</param>
        /// <param name="horizontalParametrization">The (curve) parametrization in horizontal direction.</param>
        /// <param name="verticalParametrization">The (curve) parametrization in vertical direction.</param>
        /// <param name="constructionOrder">A value indicating the order of the vertical and horizontal interpolation, extrapolation etc.</param>
        /// <returns>An object that repesents the two-dimensional surface with respect to the specified grid points and interpolation/extrapolation.</returns>
        public static IGridPointSurface2d <THorizontalLabel, TVerticalLabel> Create <THorizontalLabel, TVerticalLabel>(LabelMatrix <THorizontalLabel, TVerticalLabel> gridPoints, GridPointCurve.Parametrization horizontalParametrization, GridPointCurve.Parametrization verticalParametrization, ConstructionOrder constructionOrder = ConstructionOrder.HorizontalVertical)
            where THorizontalLabel : IComparable <THorizontalLabel>, IEquatable <THorizontalLabel>
            where TVerticalLabel : IComparable <TVerticalLabel>, IEquatable <TVerticalLabel>
        {
            if (gridPoints == null)
            {
                throw new ArgumentNullException(nameof(gridPoints));
            }
            switch (constructionOrder)
            {
            case ConstructionOrder.HorizontalVertical:
                var horizontalCurveFactory = GridPointCurve.Factory.Create <THorizontalLabel>(horizontalParametrization);
                return(new HorizontalVerticalWiseSurface2d <THorizontalLabel, TVerticalLabel> .VParametrization(gridPoints, verticalLabel => horizontalCurveFactory, verticalParametrization));

            case ConstructionOrder.VerticalHorizontal:
                var verticalCurveFactory = GridPointCurve.Factory.Create <TVerticalLabel>(verticalParametrization);
                return(new VerticalHorizontalWiseSurface2d <THorizontalLabel, TVerticalLabel> .HParametrization(gridPoints, horizontalLabel => verticalCurveFactory, horizontalParametrization));

            default:
                throw new NotImplementedException();
            }
        }