常用运营商PLMN值(MCCMNC)

PLMN(Public Land Mobile Network,公共陆地移动网络)=MCC+MNC

中国运营商PLMN值
PLMN运营商
46000中国移动 (GSM)
46001中国联通 (GSM)
46002中国移动 (TD-S)
46003中国电信(CDMA)
46005中国电信 (CDMA)
46006中国联通 (WCDMA)
46007中国移动 (TD-S)
46008中国移动
46009中国联通
46011中国电信 (FDD-LTE)
46020中国移动 铁路专用
日本运营商PLMN值
PLMN        运营商
44000SoftBank Corp.
44001UQ Communications Inc.
44002Hanshin Cable Engineering Co.,Ltd.
44003Internet Initiative Japan Inc.
44004Japan Radio Co., Ltd.
44005Wireless City Planning Inc.
44006SAKURA Internet Inc.
44007LTEX, Inc.
44008Panasonic System Solutions Japan Co., Ltd.
44009Marubeni Network Solutions Inc.
44010NTT DOCOMO, INC.
44011Rakuten Mobile, Inc.
44012Cable media waiwai Co,ltd.
44014Grape One Co., Ltd.
44015BB BACKBONE Corp.
44020SoftBank Corp.
44021SoftBank Corp.
44050KDDI CORPORATION
44051KDDI CORPORATION
44052KDDI CORPORATION
44053KDDI CORPORATION
44054KDDI CORPORATION
44070KDDI CORPORATION
44071KDDI CORPORATION
44072KDDI CORPORATION
44073KDDI CORPORATION
44074KDDI CORPORATION
44075KDDI CORPORATION
44076KDDI CORPORATION
44078Okinawa Cellular Telephone Company
44100Wireless City Planning Inc.
44101SoftBank Corp.
44110UQ Communications Inc.
44190sXGP
44191The Tokyo Organising Committee of the Olympic and Paralympic Games

详细信息参考:blog of mobile » Blog Archive » 日本におけるPLMN番号の割当一覧 (2020年1月)

好的,以下是polylineT的类模板实现,其中包含了您需要的所有功能: ```c++ #include <cmath> #include <vector> template<typename T> class polylineT { public: // 构造函数 polylineT() {} polylineT(const std::vector<T>& x, const std::vector<T>& y, const std::vector<T>& z = {}) { if (x.size() != y.size() || (z.size() != 0 && z.size() != x.size())) { throw std::invalid_argument("Invalid input size"); } for (int i = 0; i < x.size(); i++) { points.push_back({x[i], y[i], (z.size() == 0 ? 0 : z[i])}); } } // 计算线条长度 double length() const { double len = 0.0; for (int i = 1; i < points.size(); i++) { len += std::sqrt(std::pow(points[i].x - points[i-1].x, 2) + std::pow(points[i].y - points[i-1].y, 2) + std::pow(points[i].z - points[i-1].z, 2)); } return len; } // 增加和删除线条结点 void add_point(const T& x, const T& y, const T& z = 0) { points.push_back({x, y, z}); } void remove_point(int idx) { if (idx < 0 || idx >= points.size()) { throw std::out_of_range("Index out of range"); } points.erase(points.begin() + idx); } // 运算符重载 polylineT operator+(const polylineT& other) const { polylineT res = *this; res.points.insert(res.points.end(), other.points.begin(), other.points.end()); return res; } polylineT& operator+=(const polylineT& other) { points.insert(points.end(), other.points.begin(), other.points.end()); return *this; } // 判断两条线是否相交 bool intersect(const polylineT& other, std::vector<T>& inter_x, std::vector<T>& inter_y, std::vector<T>& inter_z) const { for (int i = 1; i < points.size(); i++) { for (int j = 1; j < other.points.size(); j++) { T x1 = points[i-1].x, y1 = points[i-1].y, z1 = points[i-1].z; T x2 = points[i].x, y2 = points[i].y, z2 = points[i].z; T x3 = other.points[j-1].x, y3 = other.points[j-1].y, z3 = other.points[j-1].z; T x4 = other.points[j].x, y4 = other.points[j].y, z4 = other.points[j].z; T den = (x1-x2)*(y3-y4) - (y1-y2)*(x3-x4); if (den == 0) { continue; } T num_x = (x1*y2-y1*x2)*(x3-x4) - (x1-x2)*(x3*y4-y3*x4); T num_y = (x1*y2-y1*x2)*(y3-y4) - (y1-y2)*(x3*y4-y3*x4); T num_z = (z1-z2)*(x3*y4-y3*x4) - (z3-z4)*(x1*y2-y1*x2); T x = num_x / den, y = num_y / den, z = num_z / den; if (x < std::min(x1, x2) || x > std::max(x1, x2) || x < std::min(x3, x4) || x > std::max(x3, x4) || y < std::min(y1, y2) || y > std::max(y1, y2) || y < std::min(y3, y4) || y > std::max(y3, y4)) { continue; } inter_x.push_back(x); inter_y.push_back(y); inter_z.push_back(z); } } return inter_x.size() > 0; } // 首尾相连 polylineT loop() const { polylineT res = *this; for (int i = 1; i < points.size(); i++) { res.points.push_back(points[i]); } return res; } private: struct point_t { T x, y, z; }; std::vector<point_t> points; }; ``` 在上述代码中,我们使用了一个内部的结构体 `point_t` 表示一个维坐标点,用 `std::vector` 存储了所有的点。下面对每个功能进行详细解释: 1. 构造函数:可以使用个 `std::vector` 分别传入所有点的 x、y、z 坐标,构造一个 `polylineT` 对象。其中,如果 z 坐标不传入,则默认为 0。 2. 计算线条长度:使用勾股定理计算线条长度,即每两个相邻点之间的距离的累加和。 3. 增加和删除线条结点:分别实现了 `add_point` 和 `remove_point` 函数,可以在线条末尾添加一个新的点或删除一个指定位置的点。 4. 运算符重载:实现了加法运算符 `+` 和复合赋运算符 `+=`,支持将两条线条首尾相连。其中,加法运算符返回一个新的 `polylineT` 对象,而复合赋运算符直接在原来的对象上修改。 5. 判断两条线是否相交:使用了光线追踪的思想,枚举每两个相邻的线段,判断它们是否有交点。如果有,则将交点坐标存储在 `inter_x`、`inter_y`、`inter_z` 个向量中,并返回 `true`,否则返回 `false`。 6. 首尾相连:实现了 `loop` 函数,将原来的线条首尾相接,返回一个新的线条对象。 在 main 函数中,您可以按照以下方式构造两条线条对象: ```c++ polylineT<double> line1({0, 1, 3}, {0, 2, 4}, {0, 0, 1}); polylineT<double> line2({1, 2, 4}, {1, 3, 5}, {0, 0, 1}); ``` 其中,`line1` 包含个点 (0,0,0)(1,2,0)(3,4,1),`line2` 包含个点 (1,1,0)(2,3,0)(4,5,1)。 然后,您可以测试 `polylineT` 的各个功能,例如: ```c++ // 计算线条长度 std::cout << "Length of line1: " << line1.length() << std::endl; // 增加和删除线条结点 line1.add_point(4, 6, 1); line1.remove_point(1); // 首尾相连 polylineT<double> line3 = line1.loop(); // 判断两条线是否相交 std::vector<double> inter_x, inter_y, inter_z; if (line1.intersect(line2, inter_x, inter_y, inter_z)) { std::cout << "Intersection points: "; for (int i = 0; i < inter_x.size(); i++) { std::cout << "(" << inter_x[i] << "," << inter_y[i] << "," << inter_z[i] << ") "; } std::cout << std::endl; } // 合并两条线 polylineT<double> line4 = line1 + line2; std::cout << "Length of line4: " << line4.length() << std::endl; ``` 这些代码将测试 `polylineT` 的各个功能,并输出线条长度、增加和删除结点后的线条、首尾相连后的线条、两条线是否相交以及合并后的线条长度。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值