~vcs-imports/simias/trunk

« back to all changes in this revision

Viewing changes to simias/tools/gsoap/gsoap-linux-2.7/samples/lu/lu.h

  • Committer: kalidasbala
  • Date: 2007-08-25 12:48:51 UTC
  • Revision ID: vcs-imports@canonical.com-20070825124851-vlfvzun3732ld196
Latest gsoap code update

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//gsoap ns1 service name:       lu
 
2
//gsoap ns1 service style:      rpc
 
3
//gsoap ns1 service encoding:   encoded
 
4
//gsoap ns1 service namespace:  http://websrv.cs.fsu.edu/~engelen/lu.wsdl
 
5
//gsoap ns1 service location:   http://websrv.cs.fsu.edu/~engelen/luserver.cgi
 
6
 
 
7
//gsoap ns1 schema namespace: urn:lu
 
8
typedef double xsd__double;
 
9
typedef int xsd__int;
 
10
class vector // dynamic array of type SOAP-ENC:Array with arrayType="double[]"
 
11
{ public:
 
12
        xsd__double             *__ptr; // pointer to array of double
 
13
        int                     __size; // number of elements pointed to
 
14
        int                     __offset;
 
15
        struct soap             *soap;  // gSOAP env. instance was created
 
16
                                vector();
 
17
                                vector(struct soap *env);
 
18
                                vector(struct soap *env, int size);
 
19
                                vector(struct soap *env, int start, int end);
 
20
        virtual                 ~vector();
 
21
        virtual int             start(); // index of first element (=__offset)
 
22
        virtual int             end();   // index of last element
 
23
        virtual int             size();  // vector size
 
24
        virtual void            resize(int size);
 
25
        virtual void            resize(int start, int end);
 
26
        virtual double&         operator[](int i);
 
27
        virtual double          operator()(int i);
 
28
        virtual void            print();
 
29
};
 
30
 
 
31
class ivector // dynamic array of type SOAP-ENC:Array with arrayType="int[]"
 
32
{ public:
 
33
        xsd__int                *__ptr; // pointer to array of int
 
34
        int                     __size; // number of elements pointed to
 
35
        int                     __offset;
 
36
        struct soap             *soap;  // gSOAP env. instance was created
 
37
                                ivector();
 
38
                                ivector(struct soap *env);
 
39
                                ivector(struct soap *env, int size);
 
40
                                ivector(struct soap *env, int start, int end);
 
41
        virtual                 ~ivector();
 
42
        virtual int             start(); // index of first element (=__offset)
 
43
        virtual int             end();   // index of last element
 
44
        virtual int             size();  // vector size
 
45
        virtual void            resize(int size);
 
46
        virtual void            resize(int start, int end);
 
47
        virtual int&            operator[](int i);
 
48
        virtual int             operator()(int i);
 
49
        virtual void            print();
 
50
};
 
51
 
 
52
class matrix // dynamic array of type SOAP-ENC:Array with arrayType="double[][]"
 
53
{ public:
 
54
        vector                  *__ptr; // pointer to array of vectors
 
55
        int                     __size; // number of vectors pointed to
 
56
        int                     __offset;
 
57
        struct soap             *soap;  // gSOAP env. instance was created
 
58
                                matrix();
 
59
                                matrix(struct soap *env);
 
60
                                matrix(struct soap *env, int rows);
 
61
                                matrix(struct soap *env, int rows, int cols);
 
62
                                matrix(struct soap *env, int rowstart, int rowend, int colstart, int colend);
 
63
        virtual                 ~matrix();
 
64
        virtual int             start();
 
65
        virtual int             end();
 
66
        virtual int             size();
 
67
        virtual void            resize(int rows, int cols);
 
68
        virtual void            resize(int rowstart, int rowend, int colstart, int colend);
 
69
        virtual vector&         operator[](int i);
 
70
        virtual double          operator()(int i, int j);
 
71
        virtual void            print();
 
72
};
 
73
// LU decomposition, see Numerical Recipies for C
 
74
ns1__ludcmp(matrix *a, struct ns1__ludcmpResponse {matrix *a; ivector *i; xsd__double d;} &result);
 
75
// backsubstitution, see Numerical Recipies for C
 
76
ns1__lubksb(matrix *a, ivector *i, vector *b, vector *x);
 
77
// Linear system solver using LU decomposition: solves ax=b
 
78
ns1__lusol(matrix *a, vector *b, vector *x);
 
79
// Linear systems solver using LU decomposition: solves ax=b for all rows in x and b
 
80
ns1__lusols(matrix *a, matrix *b, matrix *x);
 
81
// Matrix inversion using LU decomposition
 
82
ns1__luinv(matrix *a, matrix *b);
 
83
// Determinant of matrix
 
84
ns1__ludet(matrix *a, xsd__double &d);