C++ 带约束的Ceres形状拟合

C++ 带约束的Ceres形状拟合

  • 一、Ceres Solver
    • 1.定义问题
    • 2. 添加残差
      • AddResidualBlock
      • AutoDiffCostFunction
    • 3. 配置求解器
    • 4. 求解
    • 5. 检查结果
  • 二、基于Ceres的最佳拟合
    • 残差结构体
    • 拟合主函数
  • 三、带约束的Ceres拟合
    • 残差设计
    • 拟合区间限定
  • 四、拟合结果
    • best
    • min
    • max
  • 五、完整代码

对Ceres早有耳闻,现结合一个具体需求对其进行学习。比如我需要通过一个近似圆的点集拟合一个最佳圆,除此之外,我还要拟合最小圆和最大圆,要求它们的平均偏差、最大偏差、最小偏差分别为0。完整代码在文末。

一、Ceres Solver

Ceres Solver 是一个由 Google 开发的开源库,专门用于解决非线性最小二乘问题。它被广泛应用于机器人学、计算机视觉和其他需要精确数据拟合的应用中。Ceres 提供了一种灵活的方式来定义目标函数,并允许用户指定约束条件,从而使得复杂的优化问题可以被高效地求解。

SLAM领域应该常用这个

1.定义问题

首先要定义一个需要优化的问题:

ceres::Problem problem;

定义了一个ceres::Problem对象后,在使用 Ceres 进行拟合之前,还需要:

成本函数(Cost Function):描述了观测值与模型预测值之间的差异。
参数块(Parameter Block):即你要优化的变量。
损失函数(Loss Function):可选的,用于减少残差中的大误差对结果的影响。
局部参数化(Local Parameterization):用于非欧几里得空间中的参数优化。
约束(Constraints):可以为参数块添加额外的限制。


2. 添加残差

通过调用 problem.AddResidualBlock() 方法来添加成本项到问题中。每个成本项通常对应一个观测或测量(所以通常需要循环构建)。

AddResidualBlock

AddResidualBlock是ceres::Problem类的一个成员函数,它允许你将一个残差项(即误差项)添加到优化问题中。这个残差块定义了模型与观测数据之间的差异度量,是构成整个非线性最小二乘问题的基础单元。

  ResidualBlockId AddResidualBlock(CostFunction* cost_function,LossFunction* loss_function,const std::vector<double*>& parameter_blocks);
  • CostFunction

这是一个指向用户定义的代价函数(残差函数)的指针。Ceres 使用这个函数来计算残差值,最终目标是使残差最小化。用户可以通过继承 Ceres 的 CostFunction 类,或者使用 Ceres 提供的自动求导工具(如 ceres::AutoDiffCostFunction)来定义自己的残差函数。

  • LossFunction

这是一个指向损失函数的指针。损失函数用于对残差进行处理,特别是在鲁棒估计中,它可以帮助减少异常值的影响。如果为 nullptr,Ceres 将使用二次损失函数,即直接最小化残差的平方和。
常用的损失函数包括 Huber 损失、Cauchy 损失等,可以通过实例化 ceres::HuberLoss、ceres::CauchyLoss 等来使用。

  • std::vector parameter_blocks

参数块是指向优化参数的指针数组。每个参数块对应了残差函数所需的参数。double* 类型表示每个参数块的起始地址。Ceres 允许优化多个参数块,因此你可以传入多个参数的指针。
每个参数块可以是一个标量,也可以是一个向量(例如 3D 空间中的点)。Ceres 会在优化过程中修改这些参数,使得残差函数的值尽可能地小。

AutoDiffCostFunction

AutoDiffCostFunction 是 Google Ceres Solver 中一个重要的类,它通过自动求导来简化用户定义残差函数时的梯度计算。这个类可以将用户定义的代价函数(残差计算函数)自动地转换为可以用于优化问题的 CostFunction,并自动计算其导数。

template <typename CostFunctor,int kNumResiduals,  // Number of residuals, or ceres::DYNAMIC.int N0,       // Number of parameters in block 0.int N1 = 0,   // Number of parameters in block 1.int N2 = 0,   // Number of parameters in block 2.int N3 = 0,   // Number of parameters in block 3.int N4 = 0,   // Number of parameters in block 4.int N5 = 0,   // Number of parameters in block 5.int N6 = 0,   // Number of parameters in block 6.int N7 = 0,   // Number of parameters in block 7.int N8 = 0,   // Number of parameters in block 8.int N9 = 0>   // Number of parameters in block 9.
  • CostFunctor
  • 用户定义的残差计算函数类。
  • kNumResiduals
  • 残差的数量(标量或向量的维度),即目标函数输出的维数。
  • N0, N1, N2, N3…
  • 各参数块的维度,N0 是第一个参数块的维度,N1 是第二个参数块的维度,依此类推。

3. 配置求解器

使用 ceres::Solver::Options 来配置求解器的选项,如线性求解器、非线性最小化策略、收敛标准等。

// 配置求解器ceres::Solver::Options options;options.linear_solver_type = ceres::DENSE_QR;options.minimizer_progress_to_stdout = false;

Options参数相当之多

Options() {minimizer_type = TRUST_REGION;line_search_direction_type = LBFGS;line_search_type = WOLFE;nonlinear_conjugate_gradient_type = FLETCHER_REEVES;max_lbfgs_rank = 20;use_approximate_eigenvalue_bfgs_scaling = false;line_search_interpolation_type = CUBIC;min_line_search_step_size = 1e-9;line_search_sufficient_function_decrease = 1e-4;max_line_search_step_contraction = 1e-3;min_line_search_step_contraction = 0.6;max_num_line_search_step_size_iterations = 20;max_num_line_search_direction_restarts = 5;line_search_sufficient_curvature_decrease = 0.9;max_line_search_step_expansion = 10.0;trust_region_strategy_type = LEVENBERG_MARQUARDT;dogleg_type = TRADITIONAL_DOGLEG;use_nonmonotonic_steps = false;max_consecutive_nonmonotonic_steps = 5;max_num_iterations = 50;max_solver_time_in_seconds = 1e9;num_threads = 1;initial_trust_region_radius = 1e4;max_trust_region_radius = 1e16;min_trust_region_radius = 1e-32;min_relative_decrease = 1e-3;min_lm_diagonal = 1e-6;max_lm_diagonal = 1e32;max_num_consecutive_invalid_steps = 5;function_tolerance = 1e-6;gradient_tolerance = 1e-10;parameter_tolerance = 1e-8;#if defined(CERES_NO_SUITESPARSE) && defined(CERES_NO_CXSPARSE) && !defined(CERES_ENABLE_LGPL_CODE)  // NOLINTlinear_solver_type = DENSE_QR;
#elselinear_solver_type = SPARSE_NORMAL_CHOLESKY;
#endifpreconditioner_type = JACOBI;visibility_clustering_type = CANONICAL_VIEWS;dense_linear_algebra_library_type = EIGEN;// Choose a default sparse linear algebra library in the order:////   SUITE_SPARSE > CX_SPARSE > EIGEN_SPARSE > NO_SPARSEsparse_linear_algebra_library_type = NO_SPARSE;
#if !defined(CERES_NO_SUITESPARSE)sparse_linear_algebra_library_type = SUITE_SPARSE;
#else#if !defined(CERES_NO_CXSPARSE)sparse_linear_algebra_library_type = CX_SPARSE;#else#if defined(CERES_USE_EIGEN_SPARSE)sparse_linear_algebra_library_type = EIGEN_SPARSE;#endif#endif
#endifnum_linear_solver_threads = -1;use_explicit_schur_complement = false;use_postordering = false;dynamic_sparsity = false;min_linear_solver_iterations = 0;max_linear_solver_iterations = 500;eta = 1e-1;jacobi_scaling = true;use_inner_iterations = false;inner_iteration_tolerance = 1e-3;logging_type = PER_MINIMIZER_ITERATION;minimizer_progress_to_stdout = false;trust_region_problem_dump_directory = "/tmp";trust_region_problem_dump_format_type = TEXTFILE;check_gradients = false;gradient_check_relative_precision = 1e-8;gradient_check_numeric_derivative_relative_step_size = 1e-6;update_state_every_iteration = false;evaluation_callback = NULL;}

常用的有

  • linear_solver_type:
    类型:ceres::LinearSolverType
    说明:指定用于解决线性子问题的线性求解器类型。线性求解是 Ceres 优化中一个关键步骤,不同的线性求解器适用于不同的问题规模和稀疏性。如DENSE_QR: 适合小规模且致密的问题。SPARSE_NORMAL_CHOLESKY: 适合大规模稀疏问题。ITERATIVE_SCHUR: 适用于大规模稠密问题。

  • max_num_iterations:
    类型:int
    说明:指定优化问题的最大迭代次数,达到此次数后求解器停止。一般设置为 50 到 500 之间的值。

  • function_tolerance:
    类型:double
    说明:当目标函数值的相对变化小于这个阈值时,优化过程会终止。该值用于控制收敛精度,较小的值意味着更严格的收敛条件。默认1e-6 。

  • minimizer_progress_to_stdout:
    类型:bool
    说明:是否在标准输出中打印优化过程的进展信息。如果设为 true,每次迭代会打印当前残差和其他调试信息。


4. 求解

配置好所有参数后,调用 ceres::Solve 对象开始求解过程。Ceres 将会尝试找到最小化所有成本项的参数值。

ceres::Solver::Summary summary;// 求解问题ceres::Solve(options, &problem, &summary);

Solve还需要一个ceres::Solver::Summary参数用来存放求解过程中产生的信息


5. 检查结果

ceres::Solver::Summary是一个结构体,它包含了非线性最小二乘问题求解过程的详细信息。当使用Ceres Solver完成一次优化后,可以通过Summary来获取关于求解过程的各种统计数据。

std::cout << summary.BriefReport() << "\n";   //概要报告
std::cout << summary.FullReport() << "\n";	  //详解报告

还有一些关键成员变量

termination_type: 表示求解器终止的原因。
iterations: 求解过程中迭代的次数。
initial_cost: 最初的成本函数值。
final_cost: 经过优化后的成本函数值。
reduced_chi2: 最终的归一化后的成本函数值。
num_successful_steps: 成功的迭代步数。
num_unsuccessful_steps: 不成功的迭代步数。
num_parameters: 参数的数量。
num_residuals: 残差的数量。
num_linear_solves: 线性求解器调用的次数。
num_threads_invoked: 被调用的线程数量。
linear_solver_time_in_seconds: 线性求解器花费的时间(秒)。
minimizer_time_in_seconds: 整个最小化过程花费的时间(秒)。

二、基于Ceres的最佳拟合

通常会将ceres拟合问题拆为一个残差结构体和一个拟合主函数

残差结构体


// 定义圆的残差计算结构体
struct CircleResidual
{CircleResidual(double x, double y) : x_(x), y_(y) {}template <typename T>bool operator()(const T* const center, const T* const radius, T* residual) const{T dist = sqrt((x_ - center[0]) * (x_ - center[0]) +(y_ - center[1]) * (y_ - center[1]));// 计算点到圆心的距离减去半径T deviation = dist - radius[0];residual[0] = deviation ;                 // bestreturn true;}private:const double x_, y_;
};

拟合主函数

在主函数中可以看到整个求解(solve problem)过程

void fitCircle(const std::vector<std::pair<double, double>>& data, double* center, double& radius)
{// 1.构建 Ceres 问题ceres::Problem problem;for (const auto& point : data) {  // 2.添加残差块problem.AddResidualBlock(new ceres::AutoDiffCostFunction<CircleResidual, 1, 2, 1>(new CircleResidual(point.first, point.second)),nullptr,center, &radius);}// 3.配置求解器ceres::Solver::Options options;options.linear_solver_type = ceres::DENSE_QR;options.minimizer_progress_to_stdout = true;  // 可选,设为true会打印每次迭代的基本信息// 4.求解ceres::Solver::Summary summary;ceres::Solve(options, &problem, &summary);// 5.检查结果(可选)// std::cout << summary.FullReport() << "\n";
}

三、带约束的Ceres拟合

经过多次探索,终于在ceres中找到了拟合最大最小圆的方法(主要是最大最小圆)。这里注意两个关键点:1. 残差的设计 2. 拟合区间限定

残差设计

以最大圆为例,最开始我想的是,如果点到圆心距离大于半径,则将其残差赋一个较大值,但结果一直不佳,怎么赋值,赋多大的值都没有可靠来源

最后发现,应该反向思考,将点到圆心距离小于半径的点的残差设为0,则其就会自动去找最大偏差点完成优化

最后正确的(或者说可行的)残差如下

//residual[0] = deviation ;                 // best
residual[0] = deviation > T(0) ? deviation : T(0);     //max
//residual[0] = deviation < T(0) ? deviation : T(0) ;     //min

其实很简单…

拟合区间限定

即使有正确的残差设计,如果不对参数加以限定,可能会出现异常值(比如半径为负)的情况,这时候就自然想到应该对其进行限定,而ceres完全支持这种参数拟合区间的限定,那么(在初始参数已知且相对可靠的情况下)为何不干脆对所有参数都来一个限定呢?

	problem.SetParameterLowerBound(&radius, 0, 0.0);problem.SetParameterUpperBound(&radius, 0, radius * 2);problem.SetParameterLowerBound(center, 0, center[0] - radius);problem.SetParameterUpperBound(center, 0, center[0] + radius);problem.SetParameterLowerBound(center, 1, center[1] - radius);problem.SetParameterUpperBound(center, 1, center[1] + radius);

在这里其实限定得非常宽松


四、拟合结果

综上,可得不同拟合结果如下:

best

在这里插入图片描述

在这里插入图片描述

min

在这里插入图片描述
在这里插入图片描述

max

在这里插入图片描述

在这里插入图片描述

参与拟合的点没变,三个模式下的相应偏差指标为0,且不是简单的内缩/外扩,所有点都参与了拟合过程,目标达成。

在这里插入图片描述


五、完整代码

#include <ceres/ceres.h>
#include <iostream>
#include <vector>
#include <cmath>
#include <random>
#include <limits>
#include <numeric>
#include <iomanip>
#include <fstream>
#define M_PI  3.141592653589793// 定义残差计算结构体
struct CircleResidual
{CircleResidual(double x, double y) : x_(x), y_(y) {}template <typename T>bool operator()(const T* const center, const T* const radius, T* residual) const{T dist = sqrt((x_ - center[0]) * (x_ - center[0]) +(y_ - center[1]) * (y_ - center[1]));// 计算点到圆心的距离减去半径T deviation = dist - radius[0];//residual[0] = deviation ;                 // bestresidual[0] = deviation > T(0) ? deviation : T(0);     //max//residual[0] = deviation < T(0) ? deviation : T(0) ;     //minreturn true;}private:const double x_, y_;
};void fitCircle(const std::vector<std::pair<double, double>>& data, double* center, double& radius)
{// 构建 Ceres 问题ceres::Problem problem;for (const auto& point : data) {problem.AddResidualBlock(new ceres::AutoDiffCostFunction<CircleResidual, 1, 2, 1>(new CircleResidual(point.first, point.second)),nullptr,center, &radius);}problem.SetParameterLowerBound(&radius, 0, 0.0);problem.SetParameterUpperBound(&radius, 0, radius * 2);problem.SetParameterLowerBound(center, 0, center[0] - radius);problem.SetParameterUpperBound(center, 0, center[0] + radius);problem.SetParameterLowerBound(center, 1, center[1] - radius);problem.SetParameterUpperBound(center, 1, center[1] + radius);// 配置求解器ceres::Solver::Options options;options.linear_solver_type = ceres::DENSE_QR;options.minimizer_progress_to_stdout = true;// 求解问题ceres::Solver::Summary summary;ceres::Solve(options, &problem, &summary);
}int main()
{// 已知的真实圆参数double true_center[2] = { 2.0, 3.0 };  // 圆心double true_radius = 5.0;            // 半径// 生成模拟数据:100个点,均匀分布在圆周上,并添加噪声std::vector<std::pair<double, double>> data;//std::default_random_engine generator;//std::normal_distribution<double> noise(0.0, 0.1); // 添加少量噪声//for (int i = 0; i < 100; ++i) {//	double angle = 2 * M_PI * i / 100;  // 在圆周上均匀分布//	double x = true_center[0] + true_radius * cos(angle) + noise(generator);//	double y = true_center[1] + true_radius * sin(angle) + noise(generator);//	data.emplace_back(x, y);//}//std::ofstream file("circles_pts.txt");		// 为了使用同一份数据以及可视化,将随机生成的点保存并在后续读取使用//if (file.is_open()) {//    for (const auto& point : data) {//        file << point.first << " " << point.second << "\n";//    }//    file.close();//}std::ifstream file("circles_pts.txt");if (!file.is_open()) {return false;}double x, y;std::string line;while (std::getline(file, line)) {std::istringstream stream(line);if (stream >> x >> y) {data.emplace_back(x, y);}else {std::cerr << "Error reading line: " << line << std::endl;}}file.close();// 初始猜测的圆参数double center[2] = { 2.0, 3.0 };  // 初始圆心double radius = 5.0;            // 初始半径fitCircle(data, center, radius);// 输出拟合结果//std::cout << summary.FullReport() << "\n";std::cout << "Estimated center: (" << center[0] << ", " << center[1] << ")\n";std::cout << "Estimated radius: " << radius << "\n";// 计算偏差的最大、最小和平均值double max_deviation = std::numeric_limits<double>::lowest();double min_deviation = std::numeric_limits<double>::max();double sum_deviation = 0.0;for (const auto& point : data) {double distance = sqrt((point.first - center[0]) * (point.first - center[0]) +(point.second - center[1]) * (point.second - center[1]));double deviation = distance - radius;if (deviation > max_deviation) max_deviation = deviation;if (deviation < min_deviation) min_deviation = deviation;sum_deviation += deviation;}double avg_deviation = sum_deviation / data.size();// 输出统计结果std::cout << std::fixed << std::setprecision(4);std::cout << "\nDeviation statistics:\n";std::cout << "Min deviation: " << min_deviation << "\n";std::cout << "Avg deviation: " << avg_deviation << "\n";std::cout << "Max deviation: " << max_deviation << "\n";return 0;
}

其他形状的拟合如球体等同理。

打完收工。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/142608.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

无法将ggplot图保存为PDF文件怎么办

即serif代表Times New Roman字体&#xff0c;sans代表Arial字体&#xff0c;mono代表Courier New字体。这种映射关系在基础绘图系统和ggplot2系统中均可使用。 既然字体找不到&#xff0c;那么就导入我们电脑的字体咯&#xff1a; # 这个代码只需运行一次 extrafont::font_im…

使用GitHub Actions实现前后端CI/CD到云服务器

一、静态站点部署&#xff08;前端&#xff09; 如果你要部署到github pages或者你不用SSR&#xff08;服务端渲染&#xff09;&#xff0c;那就构建&#xff08;SSG&#xff09;静态站点 配置 nextjs配置SSG&#xff08;静态站点&#xff09;next.config.mjs&#xff0c;其…

跨域训练评估BEVal:自动驾驶 BEV 的跨数据集评估框架

跨域训练评估BEVal&#xff1a;自动驾驶 BEV 的跨数据集评估框架 Abstract 当前在自动驾驶中的鸟瞰图语义分割研究主要集中在使用单个数据集&#xff08;通常是nuScenes数据集&#xff09;优化神经网络模型。这种做法导致了高度专业化的模型&#xff0c;可能在面对不同环境或…

孙溟㠭浅析中国碑帖〈曹全碑〉

孙溟㠭浅析中国碑帖《曹全碑》 《曹全碑》 《曹全碑》亦称《郃阳令曹全碑》&#xff0c;东汉时期的碑刻。属于隶书体&#xff0c;东汉中平二年&#xff08;公元158年&#xff09;立碑。 《曹全碑》 于明代万历初年在陕西郃阳县莘里村被发现&#xff0c;碑文记载了东汉末年曹全…

2025秋招LLM大模型多模态面试题(七)- 思维链CoT

1.思维链(cot) 论文名称:Chain-of-Thought Prompting Elicits Reasoningin Large Language Models论文连接:Chain-of-Thought Prompting Elicits Reasoningin Large Language Models1.什么是思维链提示? 思维链(CoT)提示过程是一种最近开发的提示方法,它鼓励大语言模型解…

GUI编程14:Icon(图标)、ImageIcon(图像图标)标签

视频链接&#xff1a;16、Icon、ImageIcon标签_哔哩哔哩_bilibilihttps://www.bilibili.com/video/BV1DJ411B75F?p16&vd_sourceb5775c3a4ea16a5306db9c7c1c1486b5 1.在Label上添加Icon package com.yundait.lesson04;import javax.swing.*; import java.awt.*;public cl…

C++数据结构-树的深度优先搜索及树形模拟法运用(进阶篇)

1. DFS简介 深度优先搜索算法&#xff08;英语&#xff1a;Depth-First-Search&#xff0c;简称DFS&#xff09;是一种用于遍历或搜索树或图的算法。 沿着树的深度遍历树的节点&#xff0c;尽可能深的搜索树的分支。当节点v的所在边都己被探寻过或者在搜寻时结点不满足条件&am…

Vue2电商平台项目 (三) Search模块、面包屑(页面自己跳自己)、排序、分页器!

文章目录 一、Search模块1、Search模块的api2、Vuex保存数据3、组件获取vuex数据并渲染(1)、分析请求数据的数据结构(2)、getters简化数据、渲染页面 4、Search模块根据不同的参数获取数据(1)、 派发actions的操作封装为函数(2)、设置带给服务器的参数(3)、Object.assign整理参…

comfyui中报错 Cmd(‘git‘) failed due to: exit code(128) 如何解决

&#x1f388;背景 comfyui今天在安装插件的过程中&#xff0c;发现有个插件第一次安装失败后&#xff0c;再次安装就开始报错了&#xff0c;提示&#xff1a; ComfyUI-Inpaint-CropAndStitch install failed: Bad Request 截图如下&#xff1a; 看下后台的报错&#xff1a; …

输入一个整数表示输出函数,也表示组成正方形边的*的数量

//输入一个整数表示输出函数&#xff0c;也表示组成正方形边的*的数量 //空心正方形 #include<stdio.h> int main() {int c 5;int i 0;int a[5][5] { 0 };int j 0;for (i 0; i < c; i){for (j 0; j < c; j){if (i 0)a[i][j] *;else if (j 0)a[i][j] *;el…

python的数据类型详解

python基础 认识python基本类型python的注释风格有三种&#xff08;也可以说是两种&#xff09;python的对齐方式python的多行语句折断字符串类型的“计算”列表的常见用法元组的常见用法集合set的常见用法字典的常见用法bytes类型python的输入输出python中的引用 认识python基…

优化最长上升子序列

前言&#xff1a;平时我们做的题目都是用动态规划做的&#xff0c;但是有没有能够优化一下呢&#xff1f; 有一个结论&#xff0c;长度为 i 的一个序列&#xff0c;最后一个元素一定是构成长度为 i 的序列中最小的 我们可以用二分来优化 题目地址 #include<bits/stdc.h>…

作为HR如何利用好校园招聘的渠道

对于企业来说校招是个非常不错的招聘渠道&#xff0c;虽然应届生没有工作经验&#xff0c;但是有很多具有高潜能的人才就在其中&#xff0c;他们年轻朝气&#xff0c;学习能力强&#xff0c;稍加培养就可以成为得力顺手的能人。 作为HR绝对要善于运营校招的渠道&#xff0c;如…

微服务_1、入门

文章目录 一、 认识微服务二、 微服务演变2.1、 单体架构2.2、 分布式架构2.3、 微服务2.4、 微服务方案对比 三、 注册中心3.1、 Eureka3.2、 Nacos3.2.1、服务分级存储模型3.2.2、权重配置3.2.3、环境隔离 一、 认识微服务 二、 微服务演变 随着互联网行业的发展&#xff0c;…

ICM20948 DMP代码详解(26)

接前一篇文章&#xff1a;ICM20948 DMP代码详解&#xff08;25&#xff09; 上一回解析完了inv_icm20948_load_firmware函数&#xff0c;回到inv_icm20948_initialize_lower_driver函数中&#xff0c;继续往下进行解析。为了便于理解和回顾&#xff0c;再次贴出inv_icm20948_in…

【黑马点评】已解决java.lang.NullPointerException异常

Redis学习Day3——黑马点评项目工程开发-CSDN博客 问题发现及描述 在黑马点评项目中&#xff0c;进行到使用Redis提供的Stream消息队列优化异步秒杀问题时&#xff0c;我在进行jmeter测试时遇到了重大的错误 发现无论怎么测试&#xff0c;一定会进入到catch中&#xff0c;又由…

ST表(算法篇)

算法篇之ST表 引言&#xff1a;ST表实际是一个数据结构&#xff0c;但是它本质是基于dp算法的&#xff0c;而算法题中有时也会用到&#xff0c;这边我就归类于算法篇先把 ST表 概念&#xff1a; ST表适用于解决区间最值的问题(RMQ问题)的数据结构ST表本质是dp算法&#xff…

【工作流集成】springboot+vue工作流审批系统(实际源码)

前言 activiti工作流引擎项目&#xff0c;企业erp、oa、hr、crm等企事业办公系统轻松落地&#xff0c;一套完整并且实际运用在多套项目中的案例&#xff0c;满足日常业务流程审批需求。 一、项目形式 springbootvueactiviti集成了activiti在线编辑器&#xff0c;流行的前后端…

深度揭秘:日志打印的艺术与实战技巧,让你的代码会说话!

&#x1f351;个人主页&#xff1a;Jupiter. &#x1f680; 所属专栏&#xff1a;Linux从入门到进阶 欢迎大家点赞收藏评论&#x1f60a; 目录 &#x1f341;日志&#x1f342;日志分模块实现讲解&#x1f343;日志等级的实现&#x1f965;日志时间*时间的获取* &#x1f308;文…

IntelliJ IDEA 创建 HTML 项目教程

传送门 IntelliJ IDEA 是 JetBrains 提供的一款强大且多功能的集成开发环境&#xff08;IDE&#xff09;&#xff0c;不仅可以用于 Java 开发&#xff0c;还支持多种其他编程语言和技术&#xff0c;包括 HTML、CSS 和 JavaScript 等前端开发工具。本文将带你逐步了解如何使用 …