C#,数值计算——分类与推理Phylo_slc的计算方法与源程序

C#,数值计算——分类与推理Phylo_slc的计算方法与源程序_第1张图片

1 文本格式

using System;
using System.Collections.Generic;

namespace Legalsoft.Truffer
{
    public class Phylo_slc : Phylagglom
    {
        public override void premin(double[,] d, int[] nextp)
        {
        }

        public override double dminfn(double[,] d, int i, int j)
        {
            return d[i, j];
        }

        public override double dbranchfn(double[,] d, int i, int j)
        {
            return 0.5 * d[i, j];
        }

        public override double dnewfn(double[,] d, int k, int i, int j, int ni, int nj)
        {
            return Math.Min(d[i, k], d[j, k]);
        }

        public override void drootbranchfn(double[,] d, int i, int j, int ni, int nj, ref double bi, ref double bj)
        {
            bi = bj = 0.5 * d[i, j];
        }

        public Phylo_slc(double[,] dist) : base(dist)
        {
            makethetree(dist);
        }
    }
}
 

2 代码格式

using System;
using System.Collections.Generic;

namespace Legalsoft.Truffer
{
    public class Phylo_slc : Phylagglom
    {
        public override void premin(double[,] d, int[] nextp)
        {
        }

        public override double dminfn(double[,] d, int i, int j)
        {
            return d[i, j];
        }

        public override double dbranchfn(double[,] d, int i, int j)
        {
            return 0.5 * d[i, j];
        }

        public override double dnewfn(double[,] d, int k, int i, int j, int ni, int nj)
        {
            return Math.Min(d[i, k], d[j, k]);
        }

        public override void drootbranchfn(double[,] d, int i, int j, int ni, int nj, ref double bi, ref double bj)
        {
            bi = bj = 0.5 * d[i, j];
        }

        public Phylo_slc(double[,] dist) : base(dist)
        {
            makethetree(dist);
        }
    }
}

你可能感兴趣的:(C#数值计算,Numerical,Recipes,c#,开发语言,分类,算法,数值计算)