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