forum.alglib.net

ALGLIB forum
It is currently Fri Mar 29, 2024 2:26 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: including alglib
PostPosted: Fri Jun 10, 2011 11:57 am 
Offline

Joined: Fri Jun 10, 2011 11:41 am
Posts: 3
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);

};


Top
 Profile  
 
 Post subject: Re: including alglib
PostPosted: Fri Jun 10, 2011 12:04 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 903
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.


Top
 Profile  
 
 Post subject: Re: including alglib
PostPosted: Fri Jun 10, 2011 12:19 pm 
Offline

Joined: Fri Jun 10, 2011 11:41 am
Posts: 3
Quote:
Try using namespace alglib:: instead of ap::

works.

thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 90 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group