Commit 8a86bd567ff19f0cfd12ea43ee6ed319c5f8e40e

Authored by David Mayerich
1 parent bba4f4d9

changed rts namespace to stim

@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 3
4 #include <cuda.h> 4 #include <cuda.h>
5 5
6 -namespace rts{ 6 +namespace stim{
7 7
8 int maxThreadsPerBlock() 8 int maxThreadsPerBlock()
9 { 9 {
@@ -15,4 +15,4 @@ int maxThreadsPerBlock() @@ -15,4 +15,4 @@ int maxThreadsPerBlock()
15 } 15 }
16 } //end namespace rts 16 } //end namespace rts
17 17
18 -#endif  
19 \ No newline at end of file 18 \ No newline at end of file
  19 +#endif
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 #include <cstring> 6 #include <cstring>
7 #include <utility> 7 #include <utility>
8 8
9 -namespace rts{ 9 +namespace stim{
10 10
11 template <typename T> 11 template <typename T>
12 12
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 #include <fstream> 8 #include <fstream>
9 #include <sys/stat.h> 9 #include <sys/stat.h>
10 10
11 -namespace rts{ 11 +namespace stim{
12 12
13 //This class contains a bunch of functions useful for multidimensional binary file access 13 //This class contains a bunch of functions useful for multidimensional binary file access
14 template< typename T, unsigned int D = 3 > 14 template< typename T, unsigned int D = 3 >
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 #include <cstring> 7 #include <cstring>
8 #include <utility> 8 #include <utility>
9 9
10 -namespace rts{ 10 +namespace stim{
11 11
12 template <typename T> 12 template <typename T>
13 13
@@ -438,7 +438,7 @@ public: @@ -438,7 +438,7 @@ public:
438 //first creat a temporary bil file and convert bip file to bil file 438 //first creat a temporary bil file and convert bip file to bil file
439 bil(temp); 439 bil(temp);
440 440
441 - rts::bil<T> n; 441 + stim::bil<T> n;
442 if(n.open(temp, R[0], R[1], R[2], offset, w)==false){ //open infile 442 if(n.open(temp, R[0], R[1], R[2], offset, w)==false){ //open infile
443 std::cout<<"ERROR: unable to open input file"<<std::endl; 443 std::cout<<"ERROR: unable to open input file"<<std::endl;
444 exit(1); 444 exit(1);
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 -namespace rts{ 11 +namespace stim{
12 12
13 template <typename T> 13 template <typename T>
14 14
@@ -274,7 +274,7 @@ public: @@ -274,7 +274,7 @@ public:
274 //first creat a temporary bil file and convert bsq file to bil file 274 //first creat a temporary bil file and convert bsq file to bil file
275 bil(temp); 275 bil(temp);
276 276
277 - rts::bil<T> n; 277 + stim::bil<T> n;
278 if(n.open(temp, R[0], R[1], R[2], offset, w)==false){ //open infile 278 if(n.open(temp, R[0], R[1], R[2], offset, w)==false){ //open infile
279 std::cout<<"ERROR: unable to open input file"<<std::endl; 279 std::cout<<"ERROR: unable to open input file"<<std::endl;
280 exit(1); 280 exit(1);
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 #include "../envi/bip.h" 6 #include "../envi/bip.h"
7 #include "../envi/bil.h" 7 #include "../envi/bil.h"
8 8
9 -namespace rts{ 9 +namespace stim{
10 10
11 //container class for an ENVI binary file reader 11 //container class for an ENVI binary file reader
12 class envi{ 12 class envi{
@@ -173,7 +173,7 @@ public: @@ -173,7 +173,7 @@ public:
173 } 173 }
174 174
175 //perform conversion 175 //perform conversion
176 - bool convert(std::string outfile, rts::envi_header::interleaveType interleave){ 176 + bool convert(std::string outfile, stim::envi_header::interleaveType interleave){
177 177
178 if(header.interleave == envi_header::BSQ){ //if the infile is bsq file 178 if(header.interleave == envi_header::BSQ){ //if the infile is bsq file
179 179
envi/envi_header.h
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 //information from an ENVI header file 11 //information from an ENVI header file
12 //A good resource can be found here: http://www.exelisvis.com/docs/enviheaderfiles.html 12 //A good resource can be found here: http://www.exelisvis.com/docs/enviheaderfiles.html
13 13
14 -namespace rts{ 14 +namespace stim{
15 15
16 struct envi_header 16 struct envi_header
17 { 17 {
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 #include "rts/gl/error.h" 6 #include "rts/gl/error.h"
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 -namespace rts{ 9 +namespace stim{
10 10
11 ///This class stores an OpenGL texture map and is used by rts_glShaderProgram. 11 ///This class stores an OpenGL texture map and is used by rts_glShaderProgram.
12 class glTexture 12 class glTexture
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 #define el 0.5772156649015329 8 #define el 0.5772156649015329
9 9
10 10
11 -namespace rts{ 11 +namespace stim{
12 12
13 static complex<double> cii(0.0,1.0); 13 static complex<double> cii(0.0,1.0);
14 static complex<double> cone(1.0,0.0); 14 static complex<double> cone(1.0,0.0);
@@ -1512,4 +1512,4 @@ int cbessjyva_sph(int v,complex&lt;P&gt; z,P &amp;vm,complex&lt;P&gt;*cjv, @@ -1512,4 +1512,4 @@ int cbessjyva_sph(int v,complex&lt;P&gt; z,P &amp;vm,complex&lt;P&gt;*cjv,
1512 } //end namespace rts 1512 } //end namespace rts
1513 1513
1514 1514
1515 -#endif  
1516 \ No newline at end of file 1515 \ No newline at end of file
  1516 +#endif
@@ -11,7 +11,7 @@ and can therefore be used in CUDA code and on CUDA devices. @@ -11,7 +11,7 @@ and can therefore be used in CUDA code and on CUDA devices.
11 #include <sstream> 11 #include <sstream>
12 #include <iostream> 12 #include <iostream>
13 13
14 -namespace rts 14 +namespace stim
15 { 15 {
16 16
17 template <class T> 17 template <class T>
math/complexfield.cuh
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 #include "../math/complex.h" 8 #include "../math/complex.h"
9 #include "../math/realfield.cuh" 9 #include "../math/realfield.cuh"
10 10
11 -namespace rts{ 11 +namespace stim{
12 12
13 template<typename T> 13 template<typename T>
14 __global__ void gpu_complexfield_mag(T* dest, complex<T>* source, unsigned int r0, unsigned int r1){ 14 __global__ void gpu_complexfield_mag(T* dest, complex<T>* source, unsigned int r0, unsigned int r1){
1 #ifndef RTS_CONSTANTS_H 1 #ifndef RTS_CONSTANTS_H
2 #define RTS_CONSTANTS_H 2 #define RTS_CONSTANTS_H
3 3
4 -#define rtsPI 3.14159  
5 -#define rtsTAU 2 * rtsPI 4 +#define stimPI 3.14159
  5 +#define stimTAU 2 * rtsPI
6 6
7 -#endif  
8 \ No newline at end of file 7 \ No newline at end of file
  8 +#endif
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 #include "../visualization/colormap.h" 15 #include "../visualization/colormap.h"
16 16
17 17
18 -namespace rts{ 18 +namespace stim{
19 19
20 //multiply R = X * Y 20 //multiply R = X * Y
21 template<typename T> 21 template<typename T>
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 3
4 #include <string> 4 #include <string>
5 5
6 -namespace rts{ 6 +namespace stim{
7 7
8 //template class for a one-dimensional function 8 //template class for a one-dimensional function
9 template <class Tx, class Ty> 9 template <class Tx, class Ty>
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 3
4 #include "rts/cuda/callable.h" 4 #include "rts/cuda/callable.h"
5 5
6 -namespace rts{ 6 +namespace stim{
7 7
8 template <typename T> 8 template <typename T>
9 CUDA_CALLABLE void init_legendre(T x, T& P0, T& P1) 9 CUDA_CALLABLE void init_legendre(T x, T& P0, T& P1)
@@ -7,8 +7,7 @@ @@ -7,8 +7,7 @@
7 #include "vector.h" 7 #include "vector.h"
8 #include "../cuda/callable.h" 8 #include "../cuda/callable.h"
9 9
10 -namespace rts  
11 -{ 10 +namespace stim{
12 11
13 template <class T, int N> 12 template <class T, int N>
14 struct matrix 13 struct matrix
@@ -6,14 +6,14 @@ @@ -6,14 +6,14 @@
6 #include "rts/cuda/callable.h" 6 #include "rts/cuda/callable.h"
7 7
8 8
9 -namespace rts{ 9 +namespace stim{
10 template <typename T, int D> class plane; 10 template <typename T, int D> class plane;
11 } 11 }
12 12
13 template <typename T, int D> 13 template <typename T, int D>
14 -CUDA_CALLABLE rts::plane<T, D> operator-(rts::plane<T, D> v); 14 +CUDA_CALLABLE stim::plane<T, D> operator-(stim::plane<T, D> v);
15 15
16 -namespace rts{ 16 +namespace stim{
17 17
18 template <class T, int D = 3> 18 template <class T, int D = 3>
19 class plane{ 19 class plane{
@@ -176,4 +176,4 @@ public: @@ -176,4 +176,4 @@ public:
176 176
177 177
178 178
179 -#endif  
180 \ No newline at end of file 179 \ No newline at end of file
  180 +#endif
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 #include <iomanip> 10 #include <iomanip>
11 #include <algorithm> 11 #include <algorithm>
12 12
13 -namespace rts{ 13 +namespace stim{
14 14
15 //template for a quadangle class in ND space 15 //template for a quadangle class in ND space
16 template <class T, int N = 3> 16 template <class T, int N = 3>
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 #include "../math/matrix.h" 4 #include "../math/matrix.h"
5 #include "../cuda/callable.h" 5 #include "../cuda/callable.h"
6 6
7 -namespace rts{ 7 +namespace stim{
8 8
9 template<typename T> 9 template<typename T>
10 class quaternion 10 class quaternion
math/realfield.cuh
@@ -33,7 +33,7 @@ __global__ void gpu_gaussian(T* dest, unsigned int r0, unsigned int r1, T mean, @@ -33,7 +33,7 @@ __global__ void gpu_gaussian(T* dest, unsigned int r0, unsigned int r1, T mean,
33 dest[i] = fx * fy * fz; 33 dest[i] = fx * fy * fz;
34 }*/ 34 }*/
35 35
36 -namespace rts{ 36 +namespace stim{
37 37
38 //multiply R = X * Y 38 //multiply R = X * Y
39 template<typename T> 39 template<typename T>
@@ -293,4 +293,4 @@ public: @@ -293,4 +293,4 @@ public:
293 } //end namespace rts 293 } //end namespace rts
294 294
295 295
296 -#endif  
297 \ No newline at end of file 296 \ No newline at end of file
  297 +#endif
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 #include <iomanip> 10 #include <iomanip>
11 #include <algorithm> 11 #include <algorithm>
12 12
13 -namespace rts{ 13 +namespace stim{
14 14
15 //template for a rectangle class in ND space 15 //template for a rectangle class in ND space
16 template <class T, int N = 3> 16 template <class T, int N = 3>
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 #include "../math/vector.h" 6 #include "../math/vector.h"
7 #include <iostream> 7 #include <iostream>
8 8
9 -namespace rts{ 9 +namespace stim{
10 10
11 template <class T, int N=3> 11 template <class T, int N=3>
12 struct triangle 12 struct triangle
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 #include "../cuda/callable.h" 8 #include "../cuda/callable.h"
9 9
10 10
11 -namespace rts 11 +namespace stim
12 { 12 {
13 13
14 14
@@ -257,7 +257,7 @@ struct vec @@ -257,7 +257,7 @@ struct vec
257 } //end namespace rts 257 } //end namespace rts
258 258
259 template <typename T, int N> 259 template <typename T, int N>
260 -std::ostream& operator<<(std::ostream& os, rts::vec<T, N> v) 260 +std::ostream& operator<<(std::ostream& os, stim::vec<T, N> v)
261 { 261 {
262 os<<v.str(); 262 os<<v.str();
263 return os; 263 return os;
@@ -266,9 +266,9 @@ std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, rts::vec&lt;T, N&gt; v) @@ -266,9 +266,9 @@ std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, rts::vec&lt;T, N&gt; v)
266 266
267 267
268 template <typename T, int N> 268 template <typename T, int N>
269 -CUDA_CALLABLE rts::vec<T, N> operator*(T lhs, rts::vec<T, N> rhs) 269 +CUDA_CALLABLE stim::vec<T, N> operator*(T lhs, stim::vec<T, N> rhs)
270 { 270 {
271 - rts::vec<T, N> r; 271 + stim::vec<T, N> r;
272 272
273 return rhs * lhs; 273 return rhs * lhs;
274 } 274 }
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 #include "../optics/planewave.h" 6 #include "../optics/planewave.h"
7 #include <vector> 7 #include <vector>
8 8
9 -namespace rts{ 9 +namespace stim{
10 10
11 template<typename P> 11 template<typename P>
12 class beam : public planewave<P> 12 class beam : public planewave<P>
@@ -200,4 +200,4 @@ public: @@ -200,4 +200,4 @@ public:
200 200
201 } 201 }
202 202
203 -#endif  
204 \ No newline at end of file 203 \ No newline at end of file
  204 +#endif
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 #include "../math/rect.h" 10 #include "../math/rect.h"
11 11
12 12
13 -namespace rts{ 13 +namespace stim{
14 14
15 template<typename T> 15 template<typename T>
16 __global__ void gpu_planewave2efield(complex<T>* X, complex<T>* Y, complex<T>* Z, unsigned int r0, unsigned int r1, 16 __global__ void gpu_planewave2efield(complex<T>* X, complex<T>* Y, complex<T>* Z, unsigned int r0, unsigned int r1,
@@ -406,4 +406,4 @@ public: @@ -406,4 +406,4 @@ public:
406 406
407 } //end namespace rts 407 } //end namespace rts
408 408
409 -#endif  
410 \ No newline at end of file 409 \ No newline at end of file
  410 +#endif
optics/esphere.cuh
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 #include "../cuda/devices.h" 8 #include "../cuda/devices.h"
9 #include "../optics/efield.cuh" 9 #include "../optics/efield.cuh"
10 10
11 -namespace rts{ 11 +namespace stim{
12 12
13 /* This class implements a discrete representation of an electromagnetic field 13 /* This class implements a discrete representation of an electromagnetic field
14 in 2D scattered by a sphere. This class implements Mie scattering. 14 in 2D scattered by a sphere. This class implements Mie scattering.
@@ -17,7 +17,7 @@ template&lt;typename P&gt; @@ -17,7 +17,7 @@ template&lt;typename P&gt;
17 class esphere : public efield<P> 17 class esphere : public efield<P>
18 { 18 {
19 private: 19 private:
20 - rts::complex<P> n; //sphere refractive index 20 + stim::complex<P> n; //sphere refractive index
21 P a; //sphere radius 21 P a; //sphere radius
22 22
23 //parameters dependent on wavelength 23 //parameters dependent on wavelength
@@ -159,4 +159,4 @@ public: @@ -159,4 +159,4 @@ public:
159 159
160 } //end namespace rts 160 } //end namespace rts
161 161
162 -#endif  
163 \ No newline at end of file 162 \ No newline at end of file
  163 +#endif
optics/halfspace.cuh
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 #include "../math/plane.h" 4 #include "../math/plane.h"
5 5
6 6
7 -namespace rts{ 7 +namespace stim{
8 8
9 //GPU kernel to compute the electric field 9 //GPU kernel to compute the electric field
10 template<typename T> 10 template<typename T>
@@ -336,4 +336,4 @@ public: @@ -336,4 +336,4 @@ public:
336 } 336 }
337 337
338 338
339 -#endif  
340 \ No newline at end of file 339 \ No newline at end of file
  340 +#endif
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 #include "../math/constants.h" 12 #include "../math/constants.h"
13 #include "../math/function.h" 13 #include "../math/function.h"
14 14
15 -namespace rts{ 15 +namespace stim{
16 16
17 //Material class - default representation for the material property is the refractive index (RI) 17 //Material class - default representation for the material property is the refractive index (RI)
18 template<typename T> 18 template<typename T>
optics/mirst-1d.cuh
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 #include <vector> 8 #include <vector>
9 #include <sstream> 9 #include <sstream>
10 10
11 -namespace rts{ 11 +namespace stim{
12 12
13 //this function writes a sinc function to "dest" such that an iFFT produces a slab 13 //this function writes a sinc function to "dest" such that an iFFT produces a slab
14 template<typename T> 14 template<typename T>
optics/planewave.h
@@ -8,13 +8,13 @@ @@ -8,13 +8,13 @@
8 #include "../math/quaternion.h" 8 #include "../math/quaternion.h"
9 #include "../math/constants.h" 9 #include "../math/constants.h"
10 #include "../math/plane.h" 10 #include "../math/plane.h"
11 -#include "rts/cuda/callable.h" 11 +#include "../cuda/callable.h"
12 12
13 /*Basic conversions used here (assuming a vacuum) 13 /*Basic conversions used here (assuming a vacuum)
14 lambda = 14 lambda =
15 */ 15 */
16 16
17 -namespace rts{ 17 +namespace stim{
18 18
19 template<typename T> 19 template<typename T>
20 class planewave{ 20 class planewave{
@@ -315,4 +315,4 @@ std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, rts::planewave&lt;T&gt; p) @@ -315,4 +315,4 @@ std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, rts::planewave&lt;T&gt; p)
315 return os; 315 return os;
316 } 316 }
317 317
318 -#endif  
319 \ No newline at end of file 318 \ No newline at end of file
  319 +#endif
visualization/camera.h
1 -#include <rts/math/vector.h>  
2 -#include <rts/math/point.h>  
3 -#include <rts/math/quaternion.h>  
4 -#include <rts/math/matrix.h> 1 +#include <../math/vector.h>
  2 +#include <../math/point.h>
  3 +#include <../math/quaternion.h>
  4 +#include <../math/matrix.h>
5 5
6 #include <ostream> 6 #include <ostream>
7 7
8 -#ifndef RTS_CAMERA_H  
9 -#define RTS_CAMERA_H 8 +#ifndef STIM_CAMERA_H
  9 +#define STIM_CAMERA_H
10 10
11 -namespace rts{ 11 +namespace stim{
12 12
13 class camera 13 class camera
14 { 14 {
visualization/colormap.h
1 -#ifndef RTS_COLORMAP_H  
2 -#define RTS_COLORMAP_H 1 +#ifndef STIM_COLORMAP_H
  2 +#define STIM_COLORMAP_H
3 3
4 #include <string> 4 #include <string>
5 #include <stdlib.h> 5 #include <stdlib.h>
@@ -30,7 +30,7 @@ texture&lt;float4, cudaTextureType1D&gt; cudaTexBrewer; @@ -30,7 +30,7 @@ texture&lt;float4, cudaTextureType1D&gt; cudaTexBrewer;
30 static cudaArray* gpuBrewer; 30 static cudaArray* gpuBrewer;
31 #endif 31 #endif
32 32
33 -namespace rts{ 33 +namespace stim{
34 34
35 enum colormapType {cmBrewer, cmGrayscale, cmRainbow}; 35 enum colormapType {cmBrewer, cmGrayscale, cmRainbow};
36 36