Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`static_cast<time_type>` in `integrate_times`

Đang mở
#73 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
cpp
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu trong include/boost/numeric/odeint/integrate/detail/integrate_times.hpp, đặc biệt là các chỗ sử dụng static_cast<time_type> quanh dòng 64, 97 và 139. Đọc cách TimeIterator được giải tham chiếu và cách Time cũng như time_type được định nghĩa, sau đó kiểm tra hành vi với một kiểu thời gian của Boost Units. Hoàn tất có nghĩa là integrate_times chấp nhận các kiểu quantity tương thích mà không gặp lỗi trình biên dịch đã được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi,

it seems to me that there are a number of static_cast<time_type> in the integrate_times implementation, e.g.
https://github.com/boostorg/odeint/blob/8b4768ef4926051dbe4ffe13782d7540351ff019/include/boost/numeric/odeint/integrate/detail/integrate_times.hpp#L64
https://github.com/boostorg/odeint/blob/8b4768ef4926051dbe4ffe13782d7540351ff019/include/boost/numeric/odeint/integrate/detail/integrate_times.hpp#L97
https://github.com/boostorg/odeint/blob/8b4768ef4926051dbe4ffe13782d7540351ff019/include/boost/numeric/odeint/integrate/detail/integrate_times.hpp#L139
(and potentially more; L139 is where I encountered a compiler error) that don't fit the the target variables' types. Say, for instance, Time in these cases is a Boost Units quantity, then time_type, if I understand correctly, is a plain double (or other floating point format). If I further understand the TimeIterator type correctly, that type should return a Time instance on valid dereference.

Now the static_cast tries to cast a quantity to, say, double (which fails), which is then reassigned to a quantity (which should
also fail).

It seems to me that simply removing the static casts might fix the issue, although I have not spent much time looking into it.
For now I'll use another integrator but I'd be happy to help to solve this issue in the future - if my hypothesis is correct.

Best
Malte

Ngôn ngữ chính
C++
Star
55
Fork
59
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của boostorg/odeint

Tất cả issue của boostorg/odeint

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.