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);
        }
    }
}
相关推荐
脑袋大大的13 分钟前
判断当前是否为钉钉环境
开发语言·前端·javascript·钉钉·企业应用开发
卷福同学30 分钟前
【AI编程】AI+高德MCP不到10分钟搞定上海三日游
人工智能·算法·程序员
mit6.82432 分钟前
[Leetcode] 预处理 | 多叉树bfs | 格雷编码 | static_cast | 矩阵对角线
算法
Wy. Lsy40 分钟前
Kotlin基础学习记录
开发语言·学习·kotlin
皮卡蛋炒饭.1 小时前
数据结构—排序
数据结构·算法·排序算法
Tanecious.1 小时前
C++--红黑树
开发语言·c++
Top`1 小时前
Java 泛型 (Generics)
java·开发语言·windows
爱吃土豆的马铃薯ㅤㅤㅤㅤㅤㅤㅤㅤㅤ2 小时前
如何使用Java WebSocket API实现客户端和服务器端的通信?
java·开发语言·websocket
??tobenewyorker2 小时前
力扣打卡第23天 二叉搜索树中的众数
数据结构·算法·leetcode
Shartin2 小时前
Can201-Introduction to Networking: Application Layer应用层
服务器·开发语言·php