我使用以下失败驱动循环来列出所有内容,而无需使用分号。
happiness(fred,5).
happiness(john,3).
happiness(grace,2).
someGoal(X) :-
happiness(X,Y), write(Y), tab(4), fail.
Run Code Online (Sandbox Code Playgroud)
在查询模式下,我得到了预期的结果
?- someGoal(_).
5 3 2
Run Code Online (Sandbox Code Playgroud)
如何将这些数字插入列表中,而不是将它们写到屏幕上?someGoal由于回溯似乎是隐式的,因此我无法在内部进行处理。
对于我使用允许类型的任何Mat类型,当我尝试做一些赋值或写入流等时,我得到如下的错误.它发生在MSVC++ 2010 express编译器上,gnu g ++编译器不会发生这种情况.
示例有缺陷的用法:
Mat M = Mat::zeros( image.size(), DataType<int>::type );
std::cout << M.at<int>( 0,0 ) << std::endl; // error
// OR
int x = M.at<int>( 0,0 ); // error
Run Code Online (Sandbox Code Playgroud)
这两个错误一起发生:
在弹出窗口上
Unhandled exception at <some hex adress> in test.exe:Microsoft C++ exception: cv:xception at memory location <some hex adress>
Run Code Online (Sandbox Code Playgroud)
并在控制台窗口上
OpenCV Error: Assertion failed ... \mat.hpp, line 537
Run Code Online (Sandbox Code Playgroud)
有什么建议?