This forum has been archived. All content is frozen. Please use KDE Discuss instead.

'MatrixXd' does not name a type

Tags: None
(comma "," separated)
silent_missile
Registered Member
Posts
7
Karma
0
OS

'MatrixXd' does not name a type

Mon Apr 23, 2012 6:34 am
Hello

I'm using Eigen to do some computing work, but I meet some difficulty.

This is the .h code, I use qtcreator and add Eigen path to the .pro file, so Eigen should be included.

But 'MatrixXd' does not name a type is the tip of mistake, it can't be compiled, can anyone help me?

Code: Select all
#ifndef GEOMETRY_BASE_H
#define GEOMETRY_BASE_H
#include<Eigen/Eigen>
#include<math.h>
#include<vector>

class geometry_base
{
public:
    geometry_base();
    const double pi;
    double cal_area_fillet(const double &r, const double &a);
    //r is radius, a is angle
    MatrixXd cal_fillet_geometry(const double &r, const double &a, const double &da);
    //r is radius, a is start angle, da is delta angle
    bool cal_triangular_geometry(const MatrixXd &p, double &a, Vector2d &c);
    bool cal_triangular_geometry(const MatrixXd &p, double &a);
    bool cal_triangular_geometry(const MatrixXd &p, Vector2d &c);
    bool cal_triangular_geometry(const Vector2d &p1, const Vector2d &p2, const Vector2d &p3, double &a, Vector2d &c);
    bool cal_triangular_geometry(const Vector2d &p1, const Vector2d &p2, const Vector2d &p3, double &a);
    bool cal_triangular_geometry(const Vector2d &p1, const Vector2d &p2, const Vector2d &p3, Vector2d &c);
    //p is a 2*3 matrix, each col means a point, row 0 means x, row 1 means y
    //p1, p2 and p3 are the 3 points
    //a means area of the triangular, c means x, y of the centroid
    double cal_angle(const Vector2d &p0, const Vector2d &p1, const Vector2d &p2);
    //p0 is the angle point, p1 and p2 are the side point, this function calculates the angle 1-0-2
    //it returns the value between 0 to pi
};

#endif // GEOMETRY_BASE_H
silent_missile
Registered Member
Posts
7
Karma
0
OS

Re: 'MatrixXd' does not name a type

Mon Apr 23, 2012 6:41 am
it's resolved, just add

using namespace Eigen;


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]