Skip to content

Commit

Permalink
refactor: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiphereth-A committed Mar 1, 2025
1 parent 5272a9b commit cfe214e
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1149,10 +1149,10 @@ notebook:
- conv_lcm: 卷积(LCM)
code_ext: hpp
test_ext: cpp
- conv_minplus_ca: 卷积(min-plus,一个凸序列)
- conv_minplus_cv: 卷积(min-plus,一个凸序列)
code_ext: hpp
test_ext: cpp
- conv_minplus_cc: 卷积(min-plus,两个凸序列)
- conv_minplus_cv_cv: 卷积(min-plus,两个凸序列)
code_ext: hpp
test_ext: cpp
poly:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TIFALIBS_CONV_CONV_MINPLUS_CA
#define TIFALIBS_CONV_CONV_MINPLUS_CA
#ifndef TIFALIBS_CONV_CONV_MINPLUS_CV
#define TIFALIBS_CONV_CONV_MINPLUS_CV

#include "../opt/smawk.hpp"

Expand All @@ -8,7 +8,7 @@ namespace tifa_libs::math {
//! assume a is convex, aka. $a_{i-1} - a_{i-2} \leq a_i - a_{i-1}$
//! assume b is arbitary, aka. $b_i = b_j \iff i = j$
template <class T>
CEXP vec<T> conv_minplus_ca(vec<T> CR a, vec<T> CR b) NE {
CEXP vec<T> conv_minplus_cv(vec<T> CR a, vec<T> CR b) NE {
const u32 n = (u32)a.size(), m = (u32)b.size();
const vecu argmin = opt::smawk(
n + m - 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#ifndef TIFALIBS_CONV_CONV_MINPLUS_CC
#define TIFALIBS_CONV_CONV_MINPLUS_CC
#ifndef TIFALIBS_CONV_CONV_MINPLUS_CV_CV
#define TIFALIBS_CONV_CONV_MINPLUS_CV_CV

#include "../util/util.hpp"

namespace tifa_libs::math {

//! assume a and b are convex, aka. $a_{i-1} - a_{i-2} \leq a_i - a_{i-1}$ and it also holds for b
template <class T>
CEXP vec<T> conv_minplus_cc(vec<T> CR a, vec<T> CR b) NE {
CEXP vec<T> conv_minplus_cv_cv(vec<T> CR a, vec<T> CR b) NE {
const u32 n = (u32)a.size(), m = (u32)b.size();
vec<T> c(n + m - 1);
c[0] = a[0] + b[0];
Expand Down
4 changes: 0 additions & 4 deletions src/doc_md/conv/conv_minplus_ca.md

This file was deleted.

4 changes: 0 additions & 4 deletions src/doc_md/conv/conv_minplus_cc.md

This file was deleted.

4 changes: 4 additions & 0 deletions src/doc_md/conv/conv_minplus_cv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: conv_minplus_cv
documentation_of: //src/code/conv/conv_minplus_cv.hpp
---
4 changes: 4 additions & 0 deletions src/doc_md/conv/conv_minplus_cv_cv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: conv_minplus_cv_cv
documentation_of: //src/code/conv/conv_minplus_cv_cv.hpp
---
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define PROBLEM "https://judge.yosupo.jp/problem/min_plus_convolution_convex_arbitrary"

#include "../../code/conv/conv_minplus_ca.hpp"
#include "../../code/conv/conv_minplus_cv.hpp"
#include "../../code/io/ios_container.hpp"

int main() {
Expand All @@ -9,6 +9,6 @@ int main() {
std::cin >> n >> m;
vecu a(n), b(m);
std::cin >> a >> b;
std::cout << tifa_libs::math::conv_minplus_ca(a, b) << '\n';
std::cout << tifa_libs::math::conv_minplus_cv(a, b) << '\n';
return 0;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define PROBLEM "https://judge.yosupo.jp/problem/min_plus_convolution_convex_convex"

#include "../../code/conv/conv_minplus_cc.hpp"
#include "../../code/conv/conv_minplus_cv_cv.hpp"
#include "../../code/io/ios_container.hpp"

int main() {
Expand All @@ -9,6 +9,6 @@ int main() {
std::cin >> n >> m;
vecu a(n), b(m);
std::cin >> a >> b;
std::cout << tifa_libs::math::conv_minplus_cc(a, b) << '\n';
std::cout << tifa_libs::math::conv_minplus_cv_cv(a, b) << '\n';
return 0;
}
File renamed without changes.
File renamed without changes.

0 comments on commit cfe214e

Please sign in to comment.