八,iperf3源代码分析:状态机及状态转换过程--->运行正向TCP单向测试时的客户端代码

本文主要是介绍八,iperf3源代码分析:状态机及状态转换过程--->运行正向TCP单向测试时的客户端代码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

本文目录

  • 一、测试用命令
  • 二、客户端与服务端测试业务控制流程与状态机交换
  • 三、iperf3客户端状态机中各个状态解析
    • 状态机迁移图
    • 运行正向TCP单向测试时的客户端的状态列表
  • 四、iperf3客户端状态机迁移分析
    • A-初始化测试对象(NA--->初始化状态):
    • B-建立控制连接,等待服务端PARAM_EXCHANGE的指令(初始化状态--->PARAM_EXCHANGE状态):
    • C-完成服务端与客户端的配置参数交换(PARAM_EXCHANGE状态--->CREATE_STREAM状态):
    • D-发起创建TCP测试链接(CREATE_STREAM状态--->TEST_START状态):
    • E-创建客户端为TCP测试流使用的各种定时器及其它资源(TEST_START状态--->TEST_RUNNING状态):
    • F-发送TCP测试数据流,直到本次测试结束(TEST_RUNNING状态--->TEST_END状态):
    • G-不做什么,等待服务端下一条指令(TEST_END状态--->EXCHANGE_RESULT状态):
    • H-把测试结果发送给服务端(EXCHANGE_RESULT状态--->DISPLAY_RESULTS状态) :
    • I-打印测试报告,并向服务端发IPERF_DONE指令(DISPLAY_RESULTS状态--->IPERF_DONE状态):
    • J-本次测试完成,释放所有资源,退出iperf3客户端程序(IPERF_DONE状态--->NA):

这里描述的是iperf3进行单向TCP正向流测试时的iperf3客户端的状态机转换过程,以及转换过程中的代码调用关系。通过前面的iperf3代码主要架构分析之main函数主要流程我们已经知道iperf3虽然是C语言编写的,但它是以面向对象的方式实现的,所以本文中讲述的状态机是以每个测试对象(即为每次测试实例的运行过程创建一个测试对象,从测试开始到测试进行到测试结束输入测试报告管理测试实例的整个生命周期)为单位的。每个测试对象都拥有独立的状态机。所以这里同时也引也客户端和服务端都有自己的独立的状态机,服务端和客户端的状态会通过控制链接相互同步。

一、测试用命令

在正常的测试过程中,使用如下图描述的命令启动iperf3进行单向TCP正向流测试:

  • 服务端
iperf3 -s
  • 客户端
    总共发送8K数据,每次发送1K
iperf3 -c 127.0.0.1 -n 8K -l 1K

二、客户端与服务端测试业务控制流程与状态机交换

在进行TCP业务测试时,客户端与服务端有一个动态的业务控制流程,其中还要同步二侧的状态机,以保证测试业务逻辑的完整性,参照:九,iperf3源代码分析:正向TCP单向测试时服务端和客户端的交互过程详解

三、iperf3客户端状态机中各个状态解析

状态机迁移图

有限状态机编程通常是由当前状态,事件+条件,动作,状态迁移(或称为目标状态)的五元组组成的。所以下面我们也会用这五元组来描述状态。如图所示,iperf3客户端在正常情况下(客户端启动测试后,就一直跑到测试完成,中途不中断测试)有9个状态。状态迁移方向如如箭头所示,状态迁移发生的”事件+条件“由箭头上的字母标识,会在下一章中详细解析。
在这里插入图片描述

运行正向TCP单向测试时的客户端的状态列表

  • 初始化状态
  • PARAM_EXCHANGE状态
  • CREATE_STREAM状态
  • TEST_START状态
  • TEST_RUNNING状态
  • TEST_END状态
  • EXCHANGE_RESULT状态
  • DISPLAY_RESULT状态
  • IPERF_DONE状态

四、iperf3客户端状态机迁移分析

这一章节描述各个状态下有限状态机迁移五元组源代码调用过程。

A-初始化测试对象(NA—>初始化状态):

服务端开始运行,创建测试对象后,对象状态会直接初始化初始化状态,函数调用关系如下

-----------------------------------------------------------------------------------
debug out: func = main                     ,line =   62, file = main.c
debug out: func = iperf_new_test           ,line = 2748, file = iperf_api.c
debug out: func = iperf_defaults           ,line = 2812, file = iperf_api.c
debug out: func = iperf_parse_arguments    ,line = 1136, file = iperf_api.c
debug out: test state is 0 
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态
事件+条件perf3做为客户端被启动运行
动作A-初始化测试对象
下一状态初始化状态

B-建立控制连接,等待服务端PARAM_EXCHANGE的指令(初始化状态—>PARAM_EXCHANGE状态):

根据用户的输入参数,向服务端发起连接请求,等链接建立成功后,调用iperf_handle_message_client()函数来等待服务端发送过来的“准备好做PARAM_EXCHANGE的指令”(通过test->ctrl_sck指向的控制链接) 。

......
-----------------------------------------------------------------------------------
debug out: func = main                     ,line =   62, file = main.c
debug out: func = iperf_new_test           ,line = 2748, file = iperf_api.c
debug out: func = iperf_defaults           ,line = 2812, file = iperf_api.c
debug out: func = iperf_parse_arguments    ,line = 1136, file = iperf_api.c
debug out: test state is 0 
-----------------------------------------------------------------------------------
debug out: func = run                      ,line =  145, file = main.c
debug out: func = run                      ,line =  196, file = main.c
debug out: func = iperf_run_client         ,line =  536, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  566, file = iperf_client_api.c
debug out: func = iperf_connect            ,line =  376, file = iperf_client_api.c
debug out: func = make_cookie              ,line =  119, file = iperf_util.c
debug out: func = netdial                  ,line =  237, file = net.c
debug out: create control link
debug out: func = create_socket            ,line =  129, file = net.c
debug out: func = timeout_connect          ,line =   87, file = net.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 0 to 9
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态初始化状态
事件+条件无条件向下执行
动作B-建立控制连接,等待服务端PARAM_EXCHANGE的指令
下一状态PARAM_EXCHANGE状态

C-完成服务端与客户端的配置参数交换(PARAM_EXCHANGE状态—>CREATE_STREAM状态):

在收以服务端发过来的PARAM_EXCHANGE指令后,调用iperf_exchange_parameters函数,通过控制链接向服务端发送配置参数,完成服务端与客户端的参数交换后,重新调用iperf_handle_message_client()等待服务端发送CREATE_STREAM指令

......
-----------------------------------------------------------------------------------
debug out: func = run                      ,line =  145, file = main.c
debug out: func = run                      ,line =  196, file = main.c
debug out: func = iperf_run_client         ,line =  536, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  566, file = iperf_client_api.c
debug out: func = iperf_connect            ,line =  376, file = iperf_client_api.c
debug out: func = make_cookie              ,line =  119, file = iperf_util.c
debug out: func = netdial                  ,line =  237, file = net.c
debug out: create control link
debug out: func = create_socket            ,line =  129, file = net.c
debug out: func = timeout_connect          ,line =   87, file = net.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 0 to 9
-----------------------------------------------------------------------------------
debug out: func = iperf_exchange_parameters,line = 2076, file = iperf_api.c
debug out: func = send_parameters          ,line = 2160, file = iperf_api.c
debug out: func = iperf_on_connect         ,line =  908, file = iperf_api.c
debug out: func = iperf_on_connect         ,line =  921, file = iperf_api.c
Connecting to host 127.0.0.1, port 5201
debug out: func = iperf_on_connect         ,line =  952, file = iperf_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 9 to 10
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态PARAM_EXCHANGE状态
事件+条件收到服务端发过来的PARAM_EXCHANGE指令
动作C-完成服务端与客户端的配置参数交换,等待服务端的下一条指令
下一状态CREATE_STREAM状态

D-发起创建TCP测试链接(CREATE_STREAM状态—>TEST_START状态):

在收到服务端发过来的CREATE_STREAM指令后,调用iperf_create_streams函数,创建本次新的TCP测试流实例 ,重新调用iperf_handle_message_client()等待服务端发起的TEST_START指令。

......
-----------------------------------------------------------------------------------
debug out: func = iperf_exchange_parameters,line = 2076, file = iperf_api.c
debug out: func = send_parameters          ,line = 2160, file = iperf_api.c
debug out: func = iperf_on_connect         ,line =  908, file = iperf_api.c
debug out: func = iperf_on_connect         ,line =  921, file = iperf_api.c
Connecting to host 127.0.0.1, port 5201
debug out: func = iperf_on_connect         ,line =  952, file = iperf_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 9 to 10
-----------------------------------------------------------------------------------
debug out: func = iperf_create_streams     ,line =   69, file = iperf_client_api.c
debug out: func = create_socket            ,line =  129, file = net.c
debug out: func = iperf_new_stream         ,line = 4241, file = iperf_api.c
debug out: func = iperf_add_stream         ,line = 4453, file = iperf_api.c
[  5] local 127.0.0.1 port 59494 connected to 127.0.0.1 port 5201
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 10 to 1
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态CREATE_STREAM状态
事件+条件收到服务端发起的CREATE_STREAM指令
动作D-发起创建TCP测试链接,等待服务端的TEST_START指令
下一状态TEST_START状态

E-创建客户端为TCP测试流使用的各种定时器及其它资源(TEST_START状态—>TEST_RUNNING状态):

进入TEST_START状态后,无条件的开始创建客户端为TCP测试流使用的各种定时器及其它资源,然后等待服务端发过来TEST_RUNNING指令。

......
-----------------------------------------------------------------------------------
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 10 to 1
-----------------------------------------------------------------------------------
debug out: func = iperf_init_test          ,line = 1972, file = iperf_api.c
debug out: func = create_client_timers     ,line =  179, file = iperf_client_api.c
debug out: func = create_client_omit_timer ,line =  234, file = iperf_client_api.c
debug out: func = iperf_create_send_timers ,line = 2011, file = iperf_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 1 to 2
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态TEST_START状态
事件+条件进入TEST_START状态后,无条件开始以下动作
动作E-创建客户端为TCP测试流使用的各种定时器及其它资源
下一状态TEST_RUNNING状态

F-发送TCP测试数据流,直到本次测试结束(TEST_RUNNING状态—>TEST_END状态):

调用iperf_run_client函数,直接进入TEST_RUNNING分支后,调用iperf_send函数里的sp->snd和test->protocol->send二个函数指针,最终调用iperf_tcp_send()函数向服务端发送测试数据开始测试,直到本次测试结束后进入到TEST_END状态,并向服务端发送TEST_END指令。

......
-----------------------------------------------------------------------------------
debug out: func = iperf_init_test          ,line = 1972, file = iperf_api.c
debug out: func = create_client_timers     ,line =  179, file = iperf_client_api.c
debug out: func = create_client_omit_timer ,line =  234, file = iperf_client_api.c
debug out: func = iperf_create_send_timers ,line = 2011, file = iperf_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 1 to 2
-----------------------------------------------------------------------------------
debug out: func = iperf_run_client         ,line =  633, file = iperf_client_api.c
debug out: func = iperf_send               ,line = 1890, file = iperf_api.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_tcp_send           ,line =   87, file = iperf_tcp.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_tcp_send           ,line =   87, file = iperf_tcp.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_tcp_send           ,line =   87, file = iperf_tcp.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_stats_callback     ,line = 3237, file = iperf_api.c
debug out: func = iperf_set_send_state     ,line = 1810, file = iperf_api.c
wangsheng: set the state from 2 to 4
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态TEST_RUNNING状态
事件+条件进入TEST_RUNNING状态后,无条件开始以下动作
动作F-发送TCP测试数据流,直到本次测试结束
下一状态TEST_END状态

G-不做什么,等待服务端下一条指令(TEST_END状态—>EXCHANGE_RESULT状态):

调用iperf_handle_message_client()等待服务端发过来的EXCHANGE_RESULT指令。

......
-----------------------------------------------------------------------------------
debug out: func = iperf_tcp_send           ,line =   87, file = iperf_tcp.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_tcp_send           ,line =   87, file = iperf_tcp.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_tcp_send           ,line =   87, file = iperf_tcp.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_tcp_send           ,line =   87, file = iperf_tcp.c
debug out: func = iperf_send               ,line = 1907, file = iperf_api.c
debug out: func = iperf_stats_callback     ,line = 3237, file = iperf_api.c
debug out: func = iperf_set_send_state     ,line = 1810, file = iperf_api.c
wangsheng: set the state from 2 to 4
-----------------------------------------------------------------------------------
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 4 to 13
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态TEST_END状态
事件+条件收到服务端发过来的EXCHANGE_RESULT指令
动作G-不做什么,等待服务端下一条指令
下一状态EXCHANGE_RESULT状态

H-把测试结果发送给服务端(EXCHANGE_RESULT状态—>DISPLAY_RESULTS状态) :

进入EXCHANGE_RESULT状态后,服务端无条件调用iperf_exchange_result()函数,向服务端发送的测试报告后等待服务商端发过来的DISPLAY_RESULTS指令。

......
-----------------------------------------------------------------------------------
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 4 to 13
-----------------------------------------------------------------------------------
debug out: func = iperf_exchange_results   ,line = 2134, file = iperf_api.c
debug out: func = send_results             ,line = 2367, file = iperf_api.c
debug out: func = get_results              ,line = 2488, file = iperf_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 13 to 14
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态EXCHANGE_RESULT状态
事件+条件进入EXCHANGE_RESULT状态后,无条件开始以下动作
动作H-把测试结果发送给服务端,等待服务端发过来的下一条指令
下一状态DISPLAY_RESULTS状态

I-打印测试报告,并向服务端发IPERF_DONE指令(DISPLAY_RESULTS状态—>IPERF_DONE状态):

进入DISPLAY_RESULTS状态后,客户端主动发起打印测试报告,并向服务端发IPERF_DONE指令。

......
debug out: func = iperf_exchange_results   ,line = 2134, file = iperf_api.c
debug out: func = send_results             ,line = 2367, file = iperf_api.c
debug out: func = get_results              ,line = 2488, file = iperf_api.c
debug out: func = iperf_run_client         ,line =  620, file = iperf_client_api.c
debug out: func = iperf_handle_message_client,line =  267, file = iperf_client_api.c
debug out: receive and change the state from 13 to 14
-----------------------------------------------------------------------------------
debug out: func = iperf_client_end         ,line =  490, file = iperf_client_api.c
debug out: func = iperf_reporter_callback  ,line = 4075, file = iperf_api.c
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-0.00   sec  8.00 KBytes   105 Mbits/sec    0    320 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-0.00   sec  8.00 KBytes   105 Mbits/sec    0             sender
[  5]   0.00-0.00   sec  4.00 KBytes  36.8 Mbits/sec                  receiver
debug out: func = iperf_set_send_state     ,line = 1810, file = iperf_api.c
debug out: set the state from 14 to 16
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态DISPLAY_RESULTS状态
事件+条件进入DISPLAY_RESULTS状态后,无条件开始以下动作
动作I-打印测试报告,并向服务端发IPERF_DONE指令
下一状态IPERF_DONE状态

J-本次测试完成,释放所有资源,退出iperf3客户端程序(IPERF_DONE状态—>NA):

进入IPERF_DONE状态后,释放所有资源,退出iperf3客户端程序,本次测试完成。

......
-----------------------------------------------------------------------------------
debug out: func = iperf_client_end         ,line =  490, file = iperf_client_api.c
debug out: func = iperf_reporter_callback  ,line = 4075, file = iperf_api.c
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-0.00   sec  8.00 KBytes   105 Mbits/sec    0    320 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-0.00   sec  8.00 KBytes   105 Mbits/sec    0             sender
[  5]   0.00-0.00   sec  4.00 KBytes  36.8 Mbits/sec                  receiver
debug out: func = iperf_set_send_state     ,line = 1810, file = iperf_api.c
wangsheng: set the state from 14 to 16
-----------------------------------------------------------------------------------
iperf Done.
-----------------------------------------------------------------------------------
状态机元组名称状态机元组当前值
当前状态IPERF_DONE状态
事件+条件进入IPERF_DONE状态后,无条件开始以下动作
动作J-本次测试完成,释放所有资源,退出iperf3客户端程序
下一状态NA

这篇关于八,iperf3源代码分析:状态机及状态转换过程--->运行正向TCP单向测试时的客户端代码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/715477

相关文章

浅析Spring Security认证过程

类图 为了方便理解Spring Security认证流程,特意画了如下的类图,包含相关的核心认证类 概述 核心验证器 AuthenticationManager 该对象提供了认证方法的入口,接收一个Authentiaton对象作为参数; public interface AuthenticationManager {Authentication authenticate(Authenti

性能测试介绍

性能测试是一种测试方法,旨在评估系统、应用程序或组件在现实场景中的性能表现和可靠性。它通常用于衡量系统在不同负载条件下的响应时间、吞吐量、资源利用率、稳定性和可扩展性等关键指标。 为什么要进行性能测试 通过性能测试,可以确定系统是否能够满足预期的性能要求,找出性能瓶颈和潜在的问题,并进行优化和调整。 发现性能瓶颈:性能测试可以帮助发现系统的性能瓶颈,即系统在高负载或高并发情况下可能出现的问题

作业提交过程之HDFSMapReduce

作业提交全过程详解 (1)作业提交 第1步:Client调用job.waitForCompletion方法,向整个集群提交MapReduce作业。 第2步:Client向RM申请一个作业id。 第3步:RM给Client返回该job资源的提交路径和作业id。 第4步:Client提交jar包、切片信息和配置文件到指定的资源提交路径。 第5步:Client提交完资源后,向RM申请运行MrAp

如何用Docker运行Django项目

本章教程,介绍如何用Docker创建一个Django,并运行能够访问。 一、拉取镜像 这里我们使用python3.11版本的docker镜像 docker pull python:3.11 二、运行容器 这里我们将容器内部的8080端口,映射到宿主机的80端口上。 docker run -itd --name python311 -p

字节面试 | 如何测试RocketMQ、RocketMQ?

字节面试:RocketMQ是怎么测试的呢? 答: 首先保证消息的消费正确、设计逆向用例,在验证消息内容为空等情况时的消费正确性; 推送大批量MQ,通过Admin控制台查看MQ消费的情况,是否出现消费假死、TPS是否正常等等问题。(上述都是临场发挥,但是RocketMQ真正的测试点,还真的需要探讨) 01 先了解RocketMQ 作为测试也是要简单了解RocketMQ。简单来说,就是一个分

hdu1043(八数码问题,广搜 + hash(实现状态压缩) )

利用康拓展开将一个排列映射成一个自然数,然后就变成了普通的广搜题。 #include<iostream>#include<algorithm>#include<string>#include<stack>#include<queue>#include<map>#include<stdio.h>#include<stdlib.h>#include<ctype.h>#inclu

性能分析之MySQL索引实战案例

文章目录 一、前言二、准备三、MySQL索引优化四、MySQL 索引知识回顾五、总结 一、前言 在上一讲性能工具之 JProfiler 简单登录案例分析实战中已经发现SQL没有建立索引问题,本文将一起从代码层去分析为什么没有建立索引? 开源ERP项目地址:https://gitee.com/jishenghua/JSH_ERP 二、准备 打开IDEA找到登录请求资源路径位置

hdu1565(状态压缩)

本人第一道ac的状态压缩dp,这题的数据非常水,很容易过 题意:在n*n的矩阵中选数字使得不存在任意两个数字相邻,求最大值 解题思路: 一、因为在1<<20中有很多状态是无效的,所以第一步是选择有效状态,存到cnt[]数组中 二、dp[i][j]表示到第i行的状态cnt[j]所能得到的最大值,状态转移方程dp[i][j] = max(dp[i][j],dp[i-1][k]) ,其中k满足c

活用c4d官方开发文档查询代码

当你问AI助手比如豆包,如何用python禁止掉xpresso标签时候,它会提示到 这时候要用到两个东西。https://developers.maxon.net/论坛搜索和开发文档 比如这里我就在官方找到正确的id描述 然后我就把参数标签换过来

poj 1258 Agri-Net(最小生成树模板代码)

感觉用这题来当模板更适合。 题意就是给你邻接矩阵求最小生成树啦。~ prim代码:效率很高。172k...0ms。 #include<stdio.h>#include<algorithm>using namespace std;const int MaxN = 101;const int INF = 0x3f3f3f3f;int g[MaxN][MaxN];int n