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

1 文本格式

using System;

using System.Collections.Generic;

namespace Legalsoft.Truffer

{

public class Phylo_wpgma : 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 0.5 * (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_wpgma(double[,] dist) : base(dist)

{

makethetree(dist);

}

}

}

2 代码格式

cs 复制代码
using System;
using System.Collections.Generic;

namespace Legalsoft.Truffer
{
    public class Phylo_wpgma : 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 0.5 * (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_wpgma(double[,] dist) : base(dist)
        {
            makethetree(dist);
        }
    }
}
相关推荐
星火撩猿几秒前
ubantu中下载编译安装qt5.15.3
开发语言·qt
电商api接口开发1 分钟前
ASP.NET MVC 入门指南二
前端·c#·html·mvc
wuqingshun3141592 分钟前
蓝桥杯 5. 交换瓶子
数据结构·c++·算法·职场和发展·蓝桥杯
Demons_kirit12 分钟前
Leetcode 2845 题解
算法·leetcode·职场和发展
球求了31 分钟前
C++:继承机制详解
开发语言·c++·学习
adam_life42 分钟前
http://noi.openjudge.cn/——2.5基本算法之搜索——200:Solitaire
算法·宽搜·布局唯一码
张槊哲1 小时前
函数的定义与使用(python)
开发语言·python
北辰浮光1 小时前
[Mybatis-plus]
java·开发语言·mybatis
我想进大厂1 小时前
图论---朴素Prim(稠密图)
数据结构·c++·算法·图论
我想进大厂1 小时前
图论---Bellman-Ford算法
数据结构·c++·算法·图论