Last change
on this file since 3416 was 2615, checked in by cmv, 21 years ago |
using namespace sophya enleve de machdefs.h, nouveau sopnamsp.h cmv 10/09/2004
|
File size:
1.3 KB
|
Line | |
---|
1 | //--------------------------------------------------------------------------
|
---|
2 | //
|
---|
3 | // Description:
|
---|
4 | // class ProxTuple : see header file for description.
|
---|
5 | //
|
---|
6 | //------------------------------------------------------------------------
|
---|
7 | //-----------------------
|
---|
8 | // This Class's Header --
|
---|
9 | //-----------------------
|
---|
10 | #include "sopnamsp.h"
|
---|
11 | #include "proxtuple.h"
|
---|
12 | //---------------
|
---|
13 | // STL
|
---|
14 | //-----------------
|
---|
15 | using namespace std;
|
---|
16 | //-------------------------------
|
---|
17 | // Collaborating Class Headers --
|
---|
18 | //-------------------------------
|
---|
19 | //-----------------------------------------------------------------------
|
---|
20 | // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
|
---|
21 | //-----------------------------------------------------------------------
|
---|
22 |
|
---|
23 |
|
---|
24 | //-----------------
|
---|
25 | // Member functions --
|
---|
26 | //-----------------
|
---|
27 | void
|
---|
28 | ProxTuple::fill(float v,const char* n){
|
---|
29 |
|
---|
30 | if (_tuple==0) {
|
---|
31 | _name.push_back(string(n));
|
---|
32 | }
|
---|
33 | _val.push_back(v);
|
---|
34 |
|
---|
35 | }
|
---|
36 |
|
---|
37 | void
|
---|
38 | ProxTuple::dump(){
|
---|
39 |
|
---|
40 | int N=_val.size();
|
---|
41 | if (_tuple==0) {
|
---|
42 | char** names=new char* [N];
|
---|
43 | for (int i=0;i<N;i++) names[i]=const_cast<char*>(_name[i].c_str());
|
---|
44 | _tuple=new NTuple(N,names);
|
---|
45 | delete[] names;
|
---|
46 | }
|
---|
47 | float* xnt=new float[N];
|
---|
48 | for (int i=0;i<N;i++) xnt[i]=_val[i];
|
---|
49 | _tuple->Fill(xnt);
|
---|
50 |
|
---|
51 | delete xnt;
|
---|
52 | _val.clear();
|
---|
53 |
|
---|
54 |
|
---|
55 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.