forum.alglib.net
http://forum.alglib.net/

including alglib
http://forum.alglib.net/viewtopic.php?f=2&t=385
Page 1 of 1

Author:  Ashandorath [ Fri Jun 10, 2011 11:57 am ]
Post subject:  including alglib

I'm having a problem getting the alglib (C++) to work.

All the alglib files are in the source directory (headers and cpp files).

The code that's giving the problem (header file) (the last line being where the error occurs).



#include "ap.h"
#include "alglibmisc.h"
#include "alglibinternal.h"
#include "linalg.h"
#include "statistics.h"
#include "dataanalysis.h"
#include "specialfunctions.h"
#include "solvers.h"
#include "optimization.h"
#include "diffequations.h"
#include "fasttransforms.h"
#include "integration.h"
#include "interpolation.h"
//#include "ap.h"



//== CLASS DEFINITION =========================================================



class HeatKernelMain : public MeshViewer
{
public:


typedef OpenMesh::Vec3f Vec3f;
ap::real_2d_array laplaceArray; //removing "ap" doesn't help


2>c:\users\myname\geometric modelling\project\exercise2\exercise2\src\courseexamples\02-diffgeom\HeatKernelMain.h(47): error C2653: 'ap': no class or Namespace
2>c:\users\myname\geometric modelling\project\exercise2\exercise2\src\courseexamples\02-diffgeom\HeatKernelMain.h(47): error C2146: Syntax error: missing ';' in front of identifier 'laplaceArray'
2>c:\users\myname\geometric modelling\project\exercise2\exercise2\src\courseexamples\02-diffgeom\HeatKernelMain.h(47): error C4430: missing Typspecifier - assuming int. hint: "default-int" is not supported by C++.


original german:
2>c:\users\myname\geometric modelling\project\exercise2\exercise2\src\courseexamples\02-diffgeom\HeatKernelMain.h(47): error C2653: 'ap': Keine Klasse oder Namespace
2>c:\users\myname\geometric modelling\project\exercise2\exercise2\src\courseexamples\02-diffgeom\HeatKernelMain.h(47): error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'laplaceArray'
2>c:\users\nmyname\geometric modelling\project\exercise2\exercise2\src\courseexamples\02-diffgeom\HeatKernelMain.h(47): error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterst?tzt.





the entire header file


//=============================================================================
//=============================================================================
//
// CLASS HeatKernelMain
//
//=============================================================================




//== INCLUDES =================================================================


#include "../01-ValenceViewer/MeshViewer.hh"
#include "ap.h"

#include "alglibmisc.h"
#include "alglibinternal.h"
//#include "linalg.h"
#include "ap.cpp"
#include "linalg.cpp"
#include "statistics.h"
#include "dataanalysis.h"
#include "specialfunctions.h"
#include "solvers.h"
#include "optimization.h"
#include "diffequations.h"
#include "fasttransforms.h"
#include "integration.h"
#include "interpolation.h"
//#include "ap.h"



//== CLASS DEFINITION =========================================================



class HeatKernelMain : public MeshViewer
{
public:

// typedef gmm::dense_matrix<double> gmmMatrix;
//typedef std::vector<double> gmmVector;
typedef OpenMesh::Vec3f Vec3f;
ap::real_2d_array laplaceArray;
const int k;
std::vector<VertexHandle> orderedVertices;
/// default constructor
HeatKernelMain(const char* _title, int _width, int _height);

// destructor
~HeatKernelMain();

/// open mesh
virtual bool open_mesh(const char* _filename);



protected:

virtual void draw(const std::string& _draw_mode);

OpenMesh::VPropHandleT<double> mixedArea;
OpenMesh::EPropHandleT<Mesh::Scalar> eweight_;
/// calculate vertex valences
void calc_valences();

/// set vertex color from vertex valence
void color_coding();



private:
void calculateMixedArea(VertexHandle vert);
double calculateVoroniArea(VertexHandle vert1,VertexHandle vert2,VertexHandle vert3);
std::vector<double> getVeroniCotAngles(VertexHandle vert1,VertexHandle vert2,VertexHandle vert3);
double calcTriangleArea2d(Vec3f A, Vec3f B, Vec3f C);
bool obtuseAngleAtFirst(Vec3f A, Vec3f B, Vec3f C);
bool isObtuseTriangle(Vec3f A, Vec3f B, Vec3f C);
void calc_weights();
void buildLaplaceMatrix();
unsigned int getOrderedPosition(VertexHandle vert);
void addAreaToWeights(VertexHandle vert);

};

Author:  Sergey.Bochkanov [ Fri Jun 10, 2011 12:04 pm ]
Post subject:  Re: including alglib

Try using namespace alglib:: instead of ap::

Former is current standard while latter is obsolete version, which is provided for backward compatibility only and can be inaccessible when compiling with some compilers.

Author:  Ashandorath [ Fri Jun 10, 2011 12:19 pm ]
Post subject:  Re: including alglib

Quote:
Try using namespace alglib:: instead of ap::

works.

thanks

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/