Browse Source

cleanup

master
philipp schoenberger 10 years ago
parent
commit
6687415374
  1. 0
      lwrserv/Point.h
  2. 0
      lwrserv/SocketObject.cpp
  3. 0
      lwrserv/SocketObject.h
  4. 0
      lwrserv/StringTool.cpp
  5. 0
      lwrserv/StringTool.h
  6. 0
      lwrserv/SvrHandling.cpp
  7. 0
      lwrserv/SvrHandling.h
  8. 177
      lwrserv/config.h
  9. 0
      lwrserv/friComm.h
  10. 0
      lwrserv/friremote.cpp
  11. 0
      lwrserv/friremote.h
  12. 0
      lwrserv/friudp.cpp
  13. 0
      lwrserv/friudp.h
  14. 0
      lwrserv/header.h
  15. 0
      lwrserv/include/SvrData.h
  16. 0
      lwrserv/include/defines.h
  17. 8
      lwrserv/include/mat.h
  18. 1
      lwrserv/program.cpp
  19. 0
      lwrserv/resource.h
  20. 0
      lwrserv/sgn.h
  21. 235
      lwrserv/vec.h

0
lwrserv/Point.h

0
lwrserv/SocketObject.cpp

0
lwrserv/SocketObject.h

0
lwrserv/StringTool.cpp

0
lwrserv/StringTool.h

0
lwrserv/SvrHandling.cpp

0
lwrserv/SvrHandling.h

177
lwrserv/config.h

@ -0,0 +1,177 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Compiling CppUTest itself */
#define CPPUTEST_COMPILATION 1
/* memory leak detection disabled */
/* #undef CPPUTEST_MEM_LEAK_DETECTION_DISABLED */
/* Standard C++ library disabled */
/* #undef CPPUTEST_STD_CPP_LIB_DISABLED */
/* Standard C library disabled */
/* #undef CPPUTEST_STD_C_LIB_DISABLED */
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the `fork' function. */
#define HAVE_FORK 1
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define if you have POSIX threads libraries and header files. */
/* #undef HAVE_PTHREAD */
/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strstr' function. */
#define HAVE_STRSTR 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `vfork' function. */
#define HAVE_VFORK 1
/* Define to 1 if you have the <vfork.h> header file. */
/* #undef HAVE_VFORK_H */
/* Define to 1 if `fork' works. */
#define HAVE_WORKING_FORK 1
/* Define to 1 if `vfork' works. */
#define HAVE_WORKING_VFORK 1
/* Include the GTest-related tests in the build */
/* #undef INCLUDE_GTEST_TESTS */
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"
/* Name of package */
#define PACKAGE "cpputest"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "https://github.com/cpputest/cpputest"
/* Define to the full name of this package. */
#define PACKAGE_NAME "CppUTest"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "CppUTest 3.7.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "cpputest"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "3.7.1"
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
/* #undef PTHREAD_CREATE_JOINABLE */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "3.7.1"
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT32_T */
/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT64_T */
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT8_T */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to the type of a signed integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
/* #undef int16_t */
/* Define to the type of a signed integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
/* #undef int32_t */
/* Define to the type of a signed integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
/* #undef int64_t */
/* Define to the type of a signed integer type of width exactly 8 bits if such
a type exists and the standard includes do not define it. */
/* #undef int8_t */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef pid_t */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
/* Define to the type of an unsigned integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint16_t */
/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint32_t */
/* Define to the type of an unsigned integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint64_t */
/* Define to the type of an unsigned integer type of width exactly 8 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint8_t */
/* Define as `fork' if `vfork' does not work. */
/* #undef vfork */

0
lwrserv/friComm.h

0
lwrserv/friremote.cpp

0
lwrserv/friremote.h

0
lwrserv/friudp.cpp

0
lwrserv/friudp.h

0
lwrserv/header.h

0
lwrserv/SvrData.h → lwrserv/include/SvrData.h

0
lwrserv/defines.h → lwrserv/include/defines.h

8
lwrserv/mat.h → lwrserv/include/mat.h

@ -258,15 +258,19 @@ public:
if (indxr[1] != indxc[1]) {
ir = indxr[1];
ic = indxc[1];
temp = invOut(0,ir);
invOut(0,ir) = invOut(0,ic);
invOut(0,ic) = temp;
temp = invOut(1,ir);
invOut(1,ir) = invOut(1,ic);
invOut(1,ic) = temp;
temp = invOut(2,ir);
invOut(2,ir) = invOut(2,ic);
invOut(2,ic) = temp;
temp = invOut(3,ir);
invOut(3,ir) = invOut(3,ic);
invOut(3,ic) = temp;
@ -274,15 +278,19 @@ public:
if (indxr[0] != indxc[0]) {
ir = indxr[0];
ic = indxc[0];
temp = invOut(0,ir);
invOut(0,ir) = invOut(0,ic);
invOut(0,ic) = temp;
temp = invOut(1,ir);
invOut(1,ir) = invOut(1,ic);
invOut(1,ic) = temp;
temp = invOut(2,ir);
invOut(2,ir) = invOut(2,ic);
invOut(2,ic) = temp;
temp = invOut(3,ir);
invOut(3,ir) = invOut(3,ic);
invOut(3,ic) = temp;

1
lwrserv/program.cpp

@ -54,6 +54,7 @@ float* abctomat(float a, float b, float c)
rz(2,2) = 1;
rz(3,3) = 1;
Mat4f result;
Mat4f temp;
temp = rz * ry;

0
lwrserv/resource.h

0
lwrserv/sgn.h

235
lwrserv/vec.h

@ -1,235 +0,0 @@
#ifndef _VEC_H_
#define _VEC_H_
#include <math.h>
#include "mat.h"
#include <ostream>
template<class T, unsigned SIZE> class Mat;
template<class T, unsigned SIZE> class Vec;
// Vector class for SIMPLE data types
template <class T, unsigned SIZE> class Vec
{
public:
// standard constructor
Vec<T,SIZE> ()
{ // initialize all elements with zero
for (unsigned int i=0; i<SIZE; i++)
m_atData[i] = T(0);
}
// construction with data array
Vec<T, SIZE> (const T atData[SIZE])
{
for (unsigned int i=0; i<SIZE; i++)
m_atData[i] = atData[i];
}
// copy constructor
Vec<T, SIZE> (const Vec<T, SIZE> &vec)
{
if (this==&vec)
return; // nothing to do, it's me
for (unsigned int i=0; i<SIZE; i++)
m_atData[i] = vec.m_atData[i];
}
// destructor
~Vec ()
{ // nothing to do here ...
}
void setData (const T atData[SIZE])
{
for (unsigned int i=0; i<SIZE; i++)
m_atData[i] = atData[i];
}
void getData (const T atData[SIZE])
{
for (unsigned int i=0; i<SIZE; i++)
atData[i] = m_atData[i];
}
unsigned getDimension ()
{
return SIZE;
}
Vec<T, SIZE> &operator = (const Vec<T, SIZE> &vec)
{
if (this==&vec)
return (*this); // ok, it's me, so no L-value action
for (unsigned int i=0; i<SIZE; i++) // not me, so L-Value action: copy data
m_atData[i] = vec.m_atData[i];
return (*this); // also an R-value in e.g
// vec1 = vec2 = vec3;
// L-Value = R-Value/L-Value = R-Value
}
Vec<T, SIZE> &operator = (const T atData[SIZE])
{
for (unsigned int i=0; i<SIZE; i++) // not me, so L-Value action: copy data
m_atData[i] = atData[i];
return (*this); // also an R-value in e.g.
// vec1 = vec2 + (vec2=atData); // parenthesis () needed to evaluate expression vec2=atData
// L-Val = R-Val + R-Val
// " = " + (L-Val = R-Val)
}
// usage of operator:
// vec(i) = var; // 0 <= i <= SIZE-1
// var = vec(i);
// vec1(i) = vec2(j);
T &operator () (unsigned i)
{
if (i>=SIZE)
i = SIZE-1; // !!! operator clips index ...
return m_atData[i]; // ... so we can safely return a reference
}
T operator () (unsigned i) const
{
if (i>=SIZE)
i = SIZE-1;
return m_atData[i];
}
void operator += (const Vec<T, SIZE> &vec)
{
for (int i=0; i<SIZE; i++)
m_atData[i] += vec.m_atData[i];
}
Vec<T, SIZE> operator + (const Vec<T, SIZE> &vec)
{
Vec<T, SIZE> buf (m_atData);
for (unsigned int i=0; i<SIZE; i++)
buf.m_atData[i] += vec.m_atData[i];
return buf;
}
void operator -= (const Vec<T, SIZE> &vec)
{
for (unsigned int i=0; i<SIZE; i++)
m_atData[i] -= vec.m_atData[i];
}
// binary -
// vec1 - vec2 i.e. (*this) - vec
Vec<T, SIZE> operator - (const Vec<T, SIZE> &vec)
{
Vec<T, SIZE> buf (m_atData);
for (unsigned int i=0; i<SIZE; i++)
buf.m_atData[i] -= vec.m_atData[i];
return buf;
}
// unary -
// -vec i.e. -(*this)
Vec<T, SIZE> operator - ()
{
T atBuffer[SIZE];
for (int i=0; i<SIZE; i++)
atBuffer[i] = -m_atData[i];
return Vec<T, SIZE> (atBuffer);
}
T operator * (const Vec<T, SIZE> & vec)
{
T dp = T(0);
for (int i=0; i<SIZE; i++)
dp += m_atData[i]*vec.m_atData[i];
return dp;
}
void operator *= (T tScale)
{
for (unsigned int i=0; i<SIZE; i++)
m_atData[i] *= tScale;
}
Vec<T, SIZE> operator * (T tScale)
{
T atBuffer[SIZE];
for (unsigned int i=0; i<SIZE; i++)
atBuffer[i] = m_atData[i]*tScale;
return Vec<T, SIZE> (atBuffer);
}
Vec<T, SIZE> operator * (const Mat<T, SIZE> &mat)
{
Vec<T, SIZE> vec;
for (unsigned int j=0; j<SIZE; j++)
for (unsigned int i=0; i<SIZE; i++)
vec(j) += m_atData[i]*mat(i,j);
return vec;
}
T norm ()
{
T retval = 0;
// this * this
for (int i=0; i<SIZE; i++)
retval += m_atData[i] * m_atData[i];
sqrt(retval);
return retval;
}
Vec<T, SIZE> x(const Vec<T, SIZE> &vec)
{
T temp[SIZE];
temp[0] = m_atData[1]*vec(2) - m_atData[2]*vec(1);
temp[1] = m_atData[2]*vec(0) - m_atData[0]*vec(2);
temp[2] = m_atData[0]*vec(1) - m_atData[1]*vec(0);
temp[3] = vec(3);
return Vec<T, SIZE> (temp);
}
private:
T m_atData[SIZE];
}; // class Vec
// some common vector classes (abbr. names)
typedef Vec<float, 2> Vec2f;
typedef Vec<float, 3> Vec3f;
typedef Vec<float, 4> Vec4f;
typedef Vec<double, 2> Vec2d;
typedef Vec<double, 3> Vec3d;
typedef Vec<double, 4> Vec4d;
typedef Vec<int, 2> Vec2i;
typedef Vec<int, 3> Vec3i;
typedef Vec<int, 4> Vec4i;
typedef Vec<bool, 2> Vec2b;
typedef Vec<bool, 3> Vec3b;
typedef Vec<bool, 4> Vec4b;
template <class T, unsigned SIZE>
static std::ostream& operator<< (std::ostream& output,const Vec<T,SIZE> &vec)
{
output << "( ";
for(unsigned int i = 0 ; i< SIZE; ++i)
{
output << vec(i);
if (i<SIZE-1)
output << " , ";
else
output << " )";
}
return output;
}
#endif
Loading…
Cancel
Save