Skip to content
Snippets Groups Projects
Commit 9844b363 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Fix compilation bustage with older gcc versions + fix non-gsl compilation problem

parent b0d4154c
No related branches found
No related tags found
No related merge requests found
...@@ -187,7 +187,7 @@ void Adaptive_Post_View:: zoomElement (Post_View * view , ...@@ -187,7 +187,7 @@ void Adaptive_Post_View:: zoomElement (Post_View * view ,
std::set<_point>::iterator it = _point::all_points.begin(); std::set<_point>::iterator it = _point::all_points.begin();
std::set<_point>::iterator ite = _point::all_points.end(); std::set<_point>::iterator ite = _point::all_points.end();
clock_t c0 = clock(); double c0 = Cpu();
const int N = _coefs->size1(); const int N = _coefs->size1();
Double_Vector val ( N ), res(_point::all_points.size()); Double_Vector val ( N ), res(_point::all_points.size());
...@@ -208,7 +208,7 @@ void Adaptive_Post_View:: zoomElement (Post_View * view , ...@@ -208,7 +208,7 @@ void Adaptive_Post_View:: zoomElement (Post_View * view ,
_Interpolate->mult(val,res); _Interpolate->mult(val,res);
_Geometry->mult(xyz,XYZ); _Geometry->mult(xyz,XYZ);
clock_t c1 = clock(); double c1 = Cpu();
int kk=0; int kk=0;
for ( ; it !=ite ; ++it) for ( ; it !=ite ; ++it)
...@@ -232,7 +232,7 @@ void Adaptive_Post_View:: zoomElement (Post_View * view , ...@@ -232,7 +232,7 @@ void Adaptive_Post_View:: zoomElement (Post_View * view ,
kk++; kk++;
} }
clock_t c2 = clock(); double c2 = Cpu();
std::list<_triangle*>::iterator itt = _triangle::all_triangles.begin(); std::list<_triangle*>::iterator itt = _triangle::all_triangles.begin();
std::list<_triangle*>::iterator itte = _triangle::all_triangles.end(); std::list<_triangle*>::iterator itte = _triangle::all_triangles.end();
...@@ -248,7 +248,7 @@ void Adaptive_Post_View:: zoomElement (Post_View * view , ...@@ -248,7 +248,7 @@ void Adaptive_Post_View:: zoomElement (Post_View * view ,
else else
_triangle::Error ( max-min, tol ); _triangle::Error ( max-min, tol );
clock_t c3 = clock(); double c3 = Cpu();
itt = _triangle::all_triangles.begin(); itt = _triangle::all_triangles.begin();
for ( ;itt != itte ; itt++) for ( ;itt != itte ; itt++)
{ {
...@@ -272,12 +272,12 @@ void Adaptive_Post_View:: zoomElement (Post_View * view , ...@@ -272,12 +272,12 @@ void Adaptive_Post_View:: zoomElement (Post_View * view ,
view->NbST++; view->NbST++;
} }
} }
clock_t c4 = clock(); double c4 = Cpu();
t0 += (double)(c1-c0)/CLOCKS_PER_SEC; t0 += c1-c0;
t1 += (double)(c2-c1)/CLOCKS_PER_SEC; t1 += c2-c1;
t2 += (double)(c3-c2)/CLOCKS_PER_SEC; t2 += c3-c2;
t3 += (double)(c4-c3)/CLOCKS_PER_SEC; t3 += c4-c3;
} }
......
...@@ -2,89 +2,97 @@ ...@@ -2,89 +2,97 @@
#define _GMSH_BOOSTMATRIX_ #define _GMSH_BOOSTMATRIX_
template <class SCALAR> template <class SCALAR>
class Gmsh_Matrix class Gmsh_Vector
{ {
private: private:
int r,c; int r;
public: public:
inline int size1() const {return r;} inline int size() const {return r;}
inline int size2() const {return c;}
SCALAR *data; SCALAR *data;
~Gmsh_Matrix() {delete [] data;} ~Gmsh_Vector() {delete [] data;}
Gmsh_Matrix(int R,int C) Gmsh_Vector(int R)
: r(R),c(C) : r(R)
{ {
data = new SCALAR [r*c]; data = new SCALAR [r];
scal(0); scal(0);
} }
Gmsh_Matrix(const Gmsh_Matrix<SCALAR> &other) Gmsh_Vector(const Gmsh_Vector<SCALAR> &other)
: r(other.r),c(other.c) : r(other.r)
{ {
data = new double [r*c]; data = new double [r];
copy ( other.data ) ; copy ( other.data ) ;
} }
inline SCALAR operator () (int i, int j) const inline SCALAR operator () (int i) const
{ {
return data[i+r*j]; return data[i];
} }
inline SCALAR & operator () (int i, int j) inline SCALAR & operator () (int i)
{ {
return data[i+r*j]; return data[i];
} }
inline Gmsh_Matrix operator *(const Gmsh_Matrix<SCALAR> & other) inline SCALAR operator *(const Gmsh_Vector<SCALAR> & other)
{ {
throw; throw;
} }
inline void scal ( const SCALAR s) inline void scal ( const SCALAR s)
{ {
for (int i=0;i<r*c;++i)data[i]*=s; for (int i=0;i<r;++i)data[i]*=s;
} }
inline void copy ( const SCALAR **other) inline void copy ( const SCALAR **other)
{ {
for (int i=0;i<r*c;++i)data[i]=other.data[i]; for (int i=0;i<r;++i)data[i]=other.data[i];
} }
}; };
template <class SCALAR> template <class SCALAR>
class Gmsh_Vector class Gmsh_Matrix
{ {
private: private:
int r; int r,c;
public: public:
inline int size() const {return r;} inline int size1() const {return r;}
inline int size2() const {return c;}
SCALAR *data; SCALAR *data;
~Gmsh_Vector() {delete [] data;} ~Gmsh_Matrix() {delete [] data;}
Gmsh_Vector(int R) Gmsh_Matrix(int R,int C)
: r(R) : r(R),c(C)
{ {
data = new SCALAR [r]; data = new SCALAR [r*c];
scal(0); scal(0);
} }
Gmsh_Vector(const Gmsh_Vector<SCALAR> &other) Gmsh_Matrix(const Gmsh_Matrix<SCALAR> &other)
: r(other.r) : r(other.r),c(other.c)
{ {
data = new double [r]; data = new double [r*c];
copy ( other.data ) ; copy ( other.data ) ;
} }
inline SCALAR operator () (int i) const inline SCALAR operator () (int i, int j) const
{ {
return data[i]; return data[i+r*j];
} }
inline SCALAR & operator () (int i) inline SCALAR & operator () (int i, int j)
{ {
return data[i]; return data[i+r*j];
} }
inline SCALAR operator *(const Gmsh_Vector<SCALAR> & other) inline Gmsh_Matrix operator *(const Gmsh_Matrix<SCALAR> & other)
{ {
throw; throw;
} }
inline void scal ( const SCALAR s) inline void scal ( const SCALAR s)
{ {
for (int i=0;i<r;++i)data[i]*=s; for (int i=0;i<r*c;++i)data[i]*=s;
} }
inline void copy ( const SCALAR **other) inline void copy ( const SCALAR **other)
{ {
for (int i=0;i<r;++i)data[i]=other.data[i]; for (int i=0;i<r*c;++i)data[i]=other.data[i];
}
inline void mult(const Gmsh_Matrix<SCALAR> & x, const Gmsh_Matrix<SCALAR> & b)
{
throw;
}
inline void mult (const Gmsh_Vector<SCALAR> & x, Gmsh_Vector<SCALAR> & b )
{
throw;
} }
}; };
......
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
#include "VertexArray.h" #include "VertexArray.h"
#include "SmoothNormals.h" #include "SmoothNormals.h"
#include "GmshMatrix.h" #include "GmshMatrix.h"
#include<list> #include <list>
#define VIEW_NB_ELEMENT_TYPES (8*3) #define VIEW_NB_ELEMENT_TYPES (8*3)
#define VIEW_MAX_ELEMENT_NODES 8 #define VIEW_MAX_ELEMENT_NODES 8
#define VAL_INF 1.e200 #define VAL_INF 1.e200
...@@ -77,8 +78,7 @@ public: ...@@ -77,8 +78,7 @@ public:
inline double V () const inline double V () const
{ {
static const double THIRD = 1./3.; return (p[0]->val + p[1]->val + p[2]->val)/3.;
return (p[0]->val + p[1]->val + p[2]->val)*THIRD;
} }
void print () void print ()
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment