-#include "alglin_i.hxx"\r
-#include <iostream>\r
-\r
-\r
-AlgLin_i:: AlgLin_i(CORBA::ORB_ptr orb,\r
- PortableServer::POA_ptr poa,\r
- PortableServer::ObjectId * contId, \r
- const char *instanceName, \r
- const char *interfaceName) :\r
- Engines_Component_i(orb, poa, contId, instanceName, interfaceName, 1)\r
-{\r
- MESSAGE("activate object");\r
- _thisObj = this ;\r
- _id = _poa->activate_object(_thisObj);\r
-}\r
-\r
-\r
-AlgLin_i::~AlgLin_i()\r
-{\r
-}\r
-\r
-void AlgLin_i::addvec(Engines::vecteur_out C,\r
- const Engines::vecteur& A, \r
- const Engines::vecteur& B)\r
-{\r
- beginService("addvec");\r
-\r
- long i, n = A.length();\r
-\r
- if (n != B.length())\r
- sendMessage("warning", "vecteurs de longueur differente");\r
-\r
- vecteur A_(n);\r
- vecteur B_(n);\r
- vecteur C_(n);\r
-\r
- double *xA = A_.x();\r
- double *xB = B_.x();\r
- double *xC = C_.x();\r
-\r
- for (i=0; i<n; i++) {\r
- xA[i] = A[i];\r
- xB[i] = B[i];\r
- }\r
-\r
- A_interne.addvec(&C_, &A_, &B_);\r
-\r
- C = new Engines::vecteur;\r
- C->length(n);\r
- for (i=0; i<n; i++) {\r
- (*C)[i] = xC[i];\r
- }\r
-\r
- endService("addvec");\r
-}\r
-\r
-CORBA::Double AlgLin_i::prdscl(const Engines::vecteur& A, \r
- const Engines::vecteur& B)\r
-{\r
- beginService("prdscl");\r
-\r
- long i, n = A.length();\r
-\r
- if (n != B.length())\r
- sendMessage("warning", "vecteurs de longueur differente");\r
-\r
- vecteur A_(n);\r
- vecteur B_(n);\r
-\r
- double *xA = A_.x();\r
- double *xB = B_.x();\r
-\r
- for (i=0; i<n; i++) {\r
- xA[i] = A[i];\r
- xB[i] = B[i];\r
- }\r
-\r
- CORBA::Double d = A_interne.prdscl(&A_, &B_); \r
-\r
- endService("prdscl");\r
- return d;\r
-}\r
-\r
-extern "C"\r
-{\r
- PortableServer::ObjectId * AlgLinEngine_factory(\r
- CORBA::ORB_ptr orb,\r
- PortableServer::POA_ptr poa,\r
- PortableServer::ObjectId * contId,\r
- const char *instanceName,\r
- const char *interfaceName)\r
- {\r
- MESSAGE("PortableServer::ObjectId * AlgLinEngine_factory()");\r
- AlgLin_i * O\r
- = new AlgLin_i(orb, poa, contId, instanceName, interfaceName);\r
- return O->getId() ;\r
- }\r
-}\r
-\r
+#include "alglin_i.hxx"
+#include <iostream>
+
+
+AlgLin_i:: AlgLin_i(CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName) :
+ Engines_Component_i(orb, poa, contId, instanceName, interfaceName, 1)
+{
+ MESSAGE("activate object");
+ _thisObj = this ;
+ _id = _poa->activate_object(_thisObj);
+}
+
+
+AlgLin_i::~AlgLin_i()
+{
+}
+
+void AlgLin_i::addvec(Engines::vecteur_out C,
+ const Engines::vecteur& A,
+ const Engines::vecteur& B)
+{
+ beginService("addvec");
+
+ long i, n = A.length();
+
+ if (n != B.length())
+ sendMessage("warning", "vecteurs de longueur differente");
+
+ vecteur A_(n);
+ vecteur B_(n);
+ vecteur C_(n);
+
+ double *xA = A_.x();
+ double *xB = B_.x();
+ double *xC = C_.x();
+
+ for (i=0; i<n; i++) {
+ xA[i] = A[i];
+ xB[i] = B[i];
+ }
+
+ A_interne.addvec(&C_, &A_, &B_);
+
+ C = new Engines::vecteur;
+ C->length(n);
+ for (i=0; i<n; i++) {
+ (*C)[i] = xC[i];
+ }
+
+ endService("addvec");
+}
+
+CORBA::Double AlgLin_i::prdscl(const Engines::vecteur& A,
+ const Engines::vecteur& B)
+{
+ beginService("prdscl");
+
+ long i, n = A.length();
+
+ if (n != B.length())
+ sendMessage("warning", "vecteurs de longueur differente");
+
+ vecteur A_(n);
+ vecteur B_(n);
+
+ double *xA = A_.x();
+ double *xB = B_.x();
+
+ for (i=0; i<n; i++) {
+ xA[i] = A[i];
+ xB[i] = B[i];
+ }
+
+ CORBA::Double d = A_interne.prdscl(&A_, &B_);
+
+ endService("prdscl");
+ return d;
+}
+
+extern "C"
+{
+ PortableServer::ObjectId * AlgLinEngine_factory(
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName)
+ {
+ MESSAGE("PortableServer::ObjectId * AlgLinEngine_factory()");
+ AlgLin_i * O
+ = new AlgLin_i(orb, poa, contId, instanceName, interfaceName);
+ return O->getId() ;
+ }
+}
+