我正在尝试学习如何用cython包装c ++代码。为了做到这一点,我从cython网页上的基本c ++示例开始,该示例位于:http ://docs.cython.org/src/userguide/wrapping_CPlusPlus.html
这看起来很简单,但是我无法正常工作。这是我所做的:
直接从网页复制Rectangle.h和Rectangle.cpp
Rectangle.h:
namespace shapes {
class Rectangle {
public:
int x0, y0, x1, y1;
Rectangle(int x0, int y0, int x1, int y1);
~Rectangle();
int getLength();
int getHeight();
int getArea();
void move(int dx, int dy);
};
}
Run Code Online (Sandbox Code Playgroud)
矩形文件
#include "Rectangle.h"
using namespace shapes;
Rectangle::Rectangle(int X0, int Y0, int X1, int Y1) {
x0 = X0;
y0 = Y0;
x1 = X1;
y1 = Y1;
}
Rectangle::~Rectangle() {
}
int Rectangle::getLength() {
return (x1 - x0); …Run Code Online (Sandbox Code Playgroud) 我有很多实验数据,我使用mathematica中的ListLinePlot绘制为2条曲线.我想找到这两者之间的交叉点.如果不进行插值功能和Solve [],我可以这样做吗?我真的不认为有必要制作一个1000次的多项式或者我的情况下的任何东西.它应该很简单,但我找不到那样做的功能.我完全没有一个函数,它假设ListLinePlot之间的每个数据点之间有直线(因为它们有很多).我觉得这应该是非常明显的,但我真的不知道该怎么做(除了只用我的眼睛外)