From c321e65216392e3d8e7bcea335c6e4286f18f8c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Remacle=20=28students=29?= <jean-francois.remacle@uclouvain.be> Date: Wed, 15 Apr 2009 15:38:03 +0000 Subject: [PATCH] gbricteux --- Numeric/GmshMatrix.cpp | 7 ++++--- Numeric/GmshMatrix.h | 6 +++--- Numeric/gmshLaplace.cpp | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Numeric/GmshMatrix.cpp b/Numeric/GmshMatrix.cpp index 96281ed051..07a4e792e3 100644 --- a/Numeric/GmshMatrix.cpp +++ b/Numeric/GmshMatrix.cpp @@ -4,6 +4,7 @@ // bugs and problems to <gmsh@geuz.org>. #include <complex> +#include <string.h> #include "GmshConfig.h" #include "GmshMatrix.h" #include "GmshMessage.h" @@ -120,11 +121,11 @@ bool gmshMatrix<double>::invertInPlace() int *ipiv = new int[N]; double * invA = new double[N*N]; - for (size_t i=0;i<N*N;i++) invA[i ] = 0.; - for (size_t i=0;i<N;i++) invA[i*N+i] = 1.; + for (size_t i = 0; i < N * N; i++) invA[i] = 0.; + for (size_t i = 0; i < N; i++) invA[i * N + i] = 1.; dgesv_(&N, &nrhs, _data, &lda, ipiv, invA, &ldb, &info); - std::memcpy(_data,invA,N*N*sizeof(double)); + memcpy(_data, invA, N * N * sizeof(double)); delete [] invA; delete [] ipiv; diff --git a/Numeric/GmshMatrix.h b/Numeric/GmshMatrix.h index 771f963b79..9e6da0f6ff 100644 --- a/Numeric/GmshMatrix.h +++ b/Numeric/GmshMatrix.h @@ -78,7 +78,7 @@ class gmshMatrix gmshMatrix(const gmshMatrix<scalar> &other) : _r(other._r), _c(other._c) { _data = new scalar[_r * _c]; - memcpy(other); + gM_memcpy(other); } gmshMatrix() : _r(0), _c(0), _data(0) {} ~gmshMatrix() { if(_data) delete [] _data; } @@ -90,11 +90,11 @@ class gmshMatrix _r = other._r; _c = other._c; _data = new scalar[_r * _c]; - memcpy(other); + gM_memcpy(other); } return *this; } - void memcpy(const gmshMatrix<scalar> &other) + void gM_memcpy(const gmshMatrix<scalar> &other) { for(int i = 0; i < _r * _c; ++i) _data[i] = other._data[i]; } diff --git a/Numeric/gmshLaplace.cpp b/Numeric/gmshLaplace.cpp index d368962cd5..70caf33e55 100644 --- a/Numeric/gmshLaplace.cpp +++ b/Numeric/gmshLaplace.cpp @@ -41,7 +41,7 @@ void gmshLaplaceTerm::elementMatrix(MElement *e, gmshMatrix<double> &m) const for (int k = 0; k <= j; k++){ m(j, k) += (Grads[j][0] * Grads[k][0] + Grads[j][1] * Grads[k][1] + - Grads[j][2] * Grads[k][2]) * weight * detJ * _diff * 0.5; + Grads[j][2] * Grads[k][2]) * weight * detJ * _diff; } } } -- GitLab