c++ 的这段摘录是什么?意思是?

发布于 2024-12-12 04:27:15 字数 841 浏览 0 评论 0原文

我只是想了解 dX()dY() 所引用的内容,

Table2D<double> grad2(const Table2D<double>& intensity) {
    return grad2(intensity, dX(), dY());
}

Table2D<double> grad2(
    const Table2D<double>& intensity,
    const Kernel2D<double>& dX,
    const Kernel2D<double>& dY)
{
    Assert(
      dX.getWidth() <= intensity.getWidth()
   && dX.getHeight() <= intensity.getHeight(),
      "kernel 'dX' is bigger than array 'intensity' (in grad2)");
    Assert(!dX.isEmpty(), "kernel 'dX' is empty (in grad2)");  

    Table2D<double> Ix(intensity*dX), Iy(intensity*dY);
    return ((Ix%=Ix)+=(Iy%=Iy));
}

我已经使用中的各种设置上下搜索了文档查找器窗口(区分大小写等...),我在任何地方都找不到名为 dX()dY() 的函数。也没有使用命名空间,因此它必须引用同一文档中的某些内容,对吧?

I'm simply trying to understand what is being reffered to by dX() or dY() in

Table2D<double> grad2(const Table2D<double>& intensity) {
    return grad2(intensity, dX(), dY());
}

Table2D<double> grad2(
    const Table2D<double>& intensity,
    const Kernel2D<double>& dX,
    const Kernel2D<double>& dY)
{
    Assert(
      dX.getWidth() <= intensity.getWidth()
   && dX.getHeight() <= intensity.getHeight(),
      "kernel 'dX' is bigger than array 'intensity' (in grad2)");
    Assert(!dX.isEmpty(), "kernel 'dX' is empty (in grad2)");  

    Table2D<double> Ix(intensity*dX), Iy(intensity*dY);
    return ((Ix%=Ix)+=(Iy%=Iy));
}

I have searched the document up and down with all sorts of settings in the finder window (case sensetive etc...) and I couldn't find a function with the name dX() or dY() anywhere. no namespace is being used either so it would have to reference something in the same document right?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷情 2024-12-19 04:27:15

dX 和 dY(很可能表示 X 和 Y 方向的偏导数)也可以在通过 #include 包含的任何文件中声明。最好的办法是在文件上运行预处理器并查看输出。对于 gcc,当您调用编译器时,

gcc -o foo.o [... stuff ...] -c bar.c

您可以像这样调用预处理器:

cpp [... stuff ...] bar.c

查看预处理器的输出并找到 dX/dY 的声明。

dX and dY (most probably denoting the partial derivatives in X and Y direction) could also have been declared in any file that is included via #include. Your best bet is to run the preprocessor on your file and look at the output. For gcc, when you call your compiler like

gcc -o foo.o [... stuff ...] -c bar.c

you can call the preprocessor as

cpp [... stuff ...] bar.c

Look at the output of the preprocessor and find the declaration of dX/dY.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文