Skip to content
Snippets Groups Projects
Commit b04ed07a authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

start using PObj valued tree_*_val functions.

parent 98d681d4
No related branches found
No related tags found
No related merge requests found
......@@ -33,17 +33,16 @@ void NCalc::Calculator( string s )
PNode T = user_xaxparse( s.c_str() );
if( T->has_dummy() )
throw "dummy argument t not allowed outside curve definitions";
double ret, dret;
NOlm::IterateO fiter( NOlm::IterTOL );
if( fiter.size()==0 || !T->k_dependent() ) {
cout << *(T->tree_point_val()) << "\n";
cout << T->tree_point_val().get() << "\n";
} else {
while ( (fiter()) ) {
int k = fiter.k();
if ( fiter.size()>1 )
cout << "f" << k <<":";
cout << *(T->tree_point_val( k )) << "\n";
cout << T->tree_point_val( k ).get() << "\n";
}
}
NReg::lastresult = ret;
// TODO: resuscitate NReg::lastresult = ret (aka $_);
}
......@@ -16,8 +16,8 @@ using boost::format;
#include <../trivia/string_ops.hpp>
#include "defs.hpp"
#include "coord.hpp"
#include "obj.hpp"
#include "ptr.hpp"
#include "obj.hpp"
#include "expr.hpp"
#include "geni.hpp"
#include "xax_lex.hpp"
......
......@@ -14,6 +14,7 @@
using namespace std;
#include "defs.hpp"
#include "ptr.hpp"
#include "obj.hpp"
......@@ -37,3 +38,15 @@ string CObjVecDble::result_info() const
else
return "CObjVecDble["+S(v.size())+"entries "+(dv.size()?"with":"without")+" errors]";
}
/*
ostream& operator<< (ostream& s, PObj& o )
{
if ( PObjDble po = PCAST<CObjDble>(o) )
return s << "DBLE" << *po;
else if ( PObjInt po = PCAST<CObjInt>(o) )
return s << "INT" << *po;
else
return s << "OUTSTREAM NOT IMPLEMENTED";
}
*/
......@@ -80,3 +80,5 @@ class CObjVecDble : public CObjVec {
double to_r( int i ) const { return v[i]; };
double to_dr( int i ) const { return dv.size() ? dv[i] : 0; } ;
};
ostream& operator<< (ostream& s, PObj& o );
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment