/// <summary> /// Construct a 1d neighborhood function. /// </summary> /// <param name="type">The RBF type to use.</param> public NeighborhoodRBF1D(RBFEnum type) { switch (type) { case RBFEnum.Gaussian: _radial = new GaussianFunction(1, _params, 0); break; case RBFEnum.InverseMultiquadric: _radial = new InverseMultiquadricFunction(1, _params, 0); break; case RBFEnum.Multiquadric: _radial = new MultiquadricFunction(1, _params, 0); break; case RBFEnum.MexicanHat: _radial = new MexicanHatFunction(1, _params, 0); break; default: throw new AIFHError("Unknown RBF type: " + type.ToString()); } _radial.Width = 1.0; }
/// <summary> /// Construct a 2d neighborhood function based on the sizes for the /// x and y dimensions. /// </summary> /// <param name="type">The RBF type to use.</param> /// <param name="x">The size of the x-dimension.</param> /// <param name="y">The size of the y-dimension.</param> public NeighborhoodRBF(RBFEnum type, int x, int y) { var size = new int[2]; size[0] = x; size[1] = y; _params = new double[3]; switch (type) { case RBFEnum.Gaussian: _rbf = new GaussianFunction(2, _params, 0); break; case RBFEnum.InverseMultiquadric: _rbf = new InverseMultiquadricFunction(2, _params, 0); break; case RBFEnum.Multiquadric: _rbf = new MultiquadricFunction(2, _params, 0); break; case RBFEnum.MexicanHat: _rbf = new MexicanHatFunction(2, _params, 0); break; } _rbf.Width = 1; _size = size; CalculateDisplacement(); }
/// <summary> /// Construct a multi-dimensional neighborhood function. /// </summary> /// <param name="size">The sizes of each dimension.</param> /// <param name="type">The RBF type to use.</param> public NeighborhoodRBF(int[] size, RBFEnum type) { _params = new double[size.Length]; switch (type) { case RBFEnum.Gaussian: _rbf = new GaussianFunction(size.Length, _params, 0); break; case RBFEnum.InverseMultiquadric: _rbf = new InverseMultiquadricFunction(size.Length, _params, 0); break; case RBFEnum.Multiquadric: _rbf = new MultiquadricFunction(size.Length, _params, 0); break; case RBFEnum.MexicanHat: _rbf = new MexicanHatFunction(size.Length, _params, 0); break; } _size = size; CalculateDisplacement(); }
/// <summary> /// Construct a 2d neighborhood function based on the sizes for the /// x and y dimensions. /// </summary> /// <param name="type">The RBF type to use.</param> /// <param name="x">The size of the x-dimension.</param> /// <param name="y">The size of the y-dimension.</param> public NeighborhoodRBF(RBFEnum type, int x, int y) { var size = new int[2]; size[0] = x; size[1] = y; _params = new double[3]; switch (type) { case RBFEnum.Gaussian: _rbf = new GaussianFunction(2, _params, 0); break; case RBFEnum.InverseMultiquadric: _rbf = new InverseMultiquadricFunction(2, _params, 0); break; case RBFEnum.Multiquadric: _rbf = new MultiquadricFunction(2, _params, 0); break; case RBFEnum.MexicanHat: _rbf = new MexicanHatFunction(2, _params, 0); break; } _rbf.Width = 1; _size = size; CalculateDisplacement(); }
/// <summary> /// Construct a 1d neighborhood function. /// </summary> /// <param name="type">The RBF type to use.</param> public NeighborhoodRBF1D(RBFEnum type) { switch (type) { case RBFEnum.Gaussian: _radial = new GaussianFunction(1, _params, 0); break; case RBFEnum.InverseMultiquadric: _radial = new InverseMultiquadricFunction(1, _params, 0); break; case RBFEnum.Multiquadric: _radial = new MultiquadricFunction(1, _params, 0); break; case RBFEnum.MexicanHat: _radial = new MexicanHatFunction(1, _params, 0); break; default: throw new AIFHError("Unknown RBF type: " + type.ToString()); } _radial.Width = 1.0; }
/// <summary> /// Construct the neighborhood function with the specified radial function. /// Generally this will be a Gaussian function but any RBF should do. /// </summary> /// <param name="radial">The radial basis function to use.</param> public NeighborhoodRBF1D(IFnRBF radial) { _radial = radial; }
/// <summary> /// Construct a multi-dimensional neighborhood function. /// </summary> /// <param name="size">The sizes of each dimension.</param> /// <param name="type">The RBF type to use.</param> public NeighborhoodRBF(int[] size, RBFEnum type) { _params = new double[size.Length]; switch (type) { case RBFEnum.Gaussian: _rbf = new GaussianFunction(size.Length, _params, 0); break; case RBFEnum.InverseMultiquadric: _rbf = new InverseMultiquadricFunction(size.Length, _params, 0); break; case RBFEnum.Multiquadric: _rbf = new MultiquadricFunction(size.Length, _params, 0); break; case RBFEnum.MexicanHat: _rbf = new MexicanHatFunction(size.Length, _params, 0); break; } _size = size; CalculateDisplacement(); }
/// <summary> /// Construct the neighborhood function with the specified radial function. /// Generally this will be a Gaussian function but any RBF should do. /// </summary> /// <param name="radial">The radial basis function to use.</param> public NeighborhoodRBF1D(IFnRBF radial) { _radial = radial; }