Changeset 3252
- Timestamp:
- 03/11/10 09:16:07 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Bamgx/BamgObjects.h
r3245 r3252 34 34 35 35 /*INLINE functions{{{1*/ 36 inline double det3x3(double A[3] ,double B[3],double C[3]){37 return A[0]*( B[1]*C[2]-B[2]*C[1])38 - A[1]*( B[0]*C[2]-B[2]*C[0])39 + A[2]*( B[0]*C[1]-B[1]*C[0]);40 }41 36 inline TriangleAdjacent Adj(const TriangleAdjacent & a) 42 37 { return a.Adj();} … … 73 68 /*}}}1*/ 74 69 75 /*INLINE functions of CLASS GeometricalVertex{{{1*/76 inline void GeometricalVertex::Set(const GeometricalVertex & rec,const Geometry & ,const Geometry & ){77 *this = rec;78 }79 /*}}}1*/80 70 /*INLINE functions of CLASS VertexOnVertex{{{1*/ 81 71 inline void VertexOnVertex::Set(const Triangles & Th ,long i,Triangles & ThNew) { … … 335 325 336 326 /*Other prototypes IN TRIANGLES.CPP (TO BE REORGANIZED){{{1*/ 337 long AGoodNumberPrimeWith(long n);338 327 TriangleAdjacent CloseBoundaryEdge(I2 ,Triangle *, double &,double &) ; 339 328 TriangleAdjacent CloseBoundaryEdgeV2(I2 A,Triangle *t, double &a,double &b); -
issm/trunk/src/c/Bamgx/objects/GeometricalVertex.h
r3232 r3252 36 36 37 37 //Inline methods 38 inline void Set(const GeometricalVertex & rec,const Geometry & Gh ,const Geometry & GhNew); 38 inline void Set(const GeometricalVertex & rec,const Geometry & ,const Geometry & ){ 39 *this = rec; 40 } 39 41 }; 40 42 -
issm/trunk/src/c/Bamgx/objects/R2.h
r3246 r3252 3 3 #define _R2_H 4 4 5 #include "../../shared/shared.h" 6 #include "../../include/macros.h" 7 #include "../../toolkits/toolkits.h" 5 #include <cstdio> 8 6 9 7 namespace bamg { -
issm/trunk/src/c/Bamgx/objects/Triangles.cpp
r3246 r3252 3596 3596 * [0 nbv[ all distincts*/ 3597 3597 for (i=0;i<nbv;i++) ordre[i]= &vertices[i] ; 3598 const long PrimeNumber= AGoodNumberPrimeWith(nbv) ;3598 const long PrimeNumber= BigPrimeNumber(nbv) ; 3599 3599 int k0=rand()%nbv; 3600 3600 for (int is3=0; is3<nbv; is3++){ … … 3722 3722 3723 3723 /*construction of a random order*/ 3724 const long PrimeNumber= AGoodNumberPrimeWith(nbv) ;3724 const long PrimeNumber= BigPrimeNumber(nbv) ; 3725 3725 //remainder of the division of rand() by nbvnew 3726 3726 long k3 = rand()%nbvnew; … … 4304 4304 //allocate memory to r 4305 4305 r=(int*)xmalloc(nbv*sizeof(int)); 4306 int PrimeNumber= AGoodNumberPrimeWith(nbv) ;4306 int PrimeNumber= BigPrimeNumber(nbv) ; 4307 4307 int k0=rand()%nbv; 4308 4308 for (int i=0; i<nbv; i++){ … … 5655 5655 } 5656 5656 /*}}}1*/ 5657 /*FUNCTION AGoodNumberPrimeWith{{{1*/5658 long AGoodNumberPrimeWith(long n){5659 /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/AGoodNumberPrimeWith)*/5660 5661 //list of big prime numbers5662 const long BigPrimeNumber[] ={ 567890359L,5663 567890431L, 567890437L, 567890461L, 567890471L,5664 567890483L, 567890489L, 567890497L, 567890507L,5665 567890591L, 567890599L, 567890621L, 567890629L , 0};5666 5667 //initialize o and pi5668 long o =0;5669 long pi=BigPrimeNumber[1];5670 5671 //loop until BigPrimeNumber[i]==0 (end of BigPrimeNumber)5672 for (int i=0; BigPrimeNumber[i]; i++){5673 5674 //compute r, rest of the remainder of the division of BigPrimeNumber[i] by n5675 long r = BigPrimeNumber[i] % n;5676 5677 /*compute oo = min ( r , n-r , |n - 2r|, |n-3r|)*/5678 long oo = Min(Min(r,n-r),Min(Abs(n-2*r),Abs(n-3*r)));5679 if ( o < oo){5680 o=oo;5681 pi=BigPrimeNumber[i];5682 }5683 }5684 return pi;5685 }5686 /*}}}1*/5687 5657 /*FUNCTION SwapForForcingEdge{{{1*/ 5688 5658 int SwapForForcingEdge(Vertex * & pva ,Vertex * & pvb ,TriangleAdjacent & tt1,Icoor2 & dets1, Icoor2 & detsa,Icoor2 & detsb, int & NbSwap) { -
issm/trunk/src/c/Bamgx/shared/shared.h
r3239 r3252 7 7 #define _SHAREDBamg_H_ 8 8 9 #include "BigPrimeNumber.h" 9 10 #include "TheVertex.h" 10 11 #include "FindTriangleAdjacent.h" -
issm/trunk/src/c/Makefile.am
r3245 r3252 358 358 ./Bamgx/objects/Triangle.cpp\ 359 359 ./Bamgx/objects/Triangle.h\ 360 ./Bamgx/shared/BigPrimeNumber.h\ 361 ./Bamgx/shared/BigPrimeNumber.cpp\ 360 362 ./Bamgx/objects/Triangles.cpp\ 361 363 ./Bamgx/objects/Triangles.h\ … … 724 726 ./Bamgx/objects/Triangle.cpp\ 725 727 ./Bamgx/objects/Triangle.h\ 728 ./Bamgx/shared/BigPrimeNumber.h\ 729 ./Bamgx/shared/BigPrimeNumber.cpp\ 726 730 ./Bamgx/objects/Triangles.cpp\ 727 731 ./Bamgx/objects/Triangles.h\ -
issm/trunk/src/c/include/macros.h
r2250 r3252 24 24 catch(ErrorException &exception){\ 25 25 exception.Report(); \ 26 mexErrMsgTxt(" "); \26 mexErrMsgTxt(" "); \ 27 27 }\ 28 28 catch (exception& e) {\ -
issm/trunk/src/c/shared/TriMesh/TriMeshUtils.cpp
r1904 r3252 3 3 */ 4 4 5 #include <stdio.h> 6 #include <assert.h> 7 5 8 #include "./trimesh.h" 6 9 7 10 #include "../Alloc/alloc.h" 8 11 #include "../../include/macros.h" 12 #include "../../include/typedefs.h" 9 13 10 14 int IsGridOnRift(int* riftsegments, int nriftsegs, int grid){ … … 985 989 /*Using the order vector, and the riftsegments_copy and riftspairs_copy, reorder the segments and the pairs: */ 986 990 for (j=0;j<numsegs;j++){ 991 assert(order[j]<numsegs); 987 992 *(riftsegments_copy+3*j+0)=*(riftsegments+3*order[j]+0); 988 993 *(riftsegments_copy+3*j+1)=*(riftsegments+3*order[j]+1);
Note:
See TracChangeset
for help on using the changeset viewer.