小编use*_*657的帖子

用cython包装C ++类,获得基本示例

我正在尝试学习如何用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)

c++ python cython

5
推荐指数
1
解决办法
2830
查看次数

在mathematica中找到两个ListLinePlot的交叉点

我有很多实验数据,我使用mathematica中的ListLinePlot绘制为2条曲线.我想找到这两者之间的交叉点.如果不进行插值功能和Solve [],我可以这样做吗?我真的不认为有必要制作一个1000次的多项式或者我的情况下的任何东西.它应该很简单,但我找不到那样做的功能.我完全没有一个函数,它假设ListLinePlot之间的每个数据点之间有直线(因为它们有很多).我觉得这应该是非常明显的,但我真的不知道该怎么做(除了只用我的眼睛外)

wolfram-mathematica

4
推荐指数
1
解决办法
4274
查看次数

标签 统计

c++ ×1

cython ×1

python ×1

wolfram-mathematica ×1