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

start NodeFileNJ, but there is a conceptual problem with ObjVec

parent 636bd1df
No related branches found
No related tags found
No related merge requests found
...@@ -748,6 +748,31 @@ const RObj CNodeSessionNK::tree_val( const CContext& ctx ) const ...@@ -748,6 +748,31 @@ const RObj CNodeSessionNK::tree_val( const CContext& ctx ) const
} }
//**************************************************************************************************
//* CNodeFile: file-wide information
//**************************************************************************************************
/*
const RObj CNodeFile::tree_val( const CContext& ctx ) const
{
int k = ref->get_k( ctx );
POlo f = NOlm::mem_get(k);
if ( ctx.dim==CContext::_VI ) {
CContext myctx = ctx;
myctx.dim = CContext::_1;
PObjVecEnu pret( new CObjVecEnu( ctx.nv ) );
for ( int ii=0; ii<ctx.nv; ++ii ) {
myctx.i = ii;
// pret->v[ii] = f->V[j]->z[var->num]->to_r();
}
return pret;
} else {
// return f->V[j]->z[var->num];
}
return RObjInt( new CObjInt( 0 ) );
}
*/
//************************************************************************************************** //**************************************************************************************************
//* CNodeIva: indexed variable node //* CNodeIva: indexed variable node
//************************************************************************************************** //**************************************************************************************************
...@@ -770,10 +795,7 @@ const RObj CNodeIva::tree_val( const CContext& ctx ) const ...@@ -770,10 +795,7 @@ const RObj CNodeIva::tree_val( const CContext& ctx ) const
if ( !(var->pointwise() || var->slicewise() || var->filewise()) && ref->tk ) if ( !(var->pointwise() || var->slicewise() || var->filewise()) && ref->tk )
throw "reference "+var->var_info()+" does not admit an index"; throw "reference "+var->var_info()+" does not admit an index";
// Get k from context:
int k = ref->get_k( ctx ); int k = ref->get_k( ctx );
// Proceed with file reference f[k]:
POlo f = NOlm::mem_get(k); POlo f = NOlm::mem_get(k);
if ( var->categ == VCateg::NJ ) { if ( var->categ == VCateg::NJ ) {
......
...@@ -197,6 +197,28 @@ class CNodeSessionNK: public CNode { ...@@ -197,6 +197,28 @@ class CNodeSessionNK: public CNode {
}; };
//! File-wide information.
class CNodeFile: public CNode {
private:
RRef1 ref;
public:
CNodeFile( RRef1 _ref=RRef1( new CRef1() ) ) : ref(_ref) {}
const RObj tree_val( const CContext& ctx ) const;
void kdep_exec( bool *kd ) const { *kd = true; }
};
//! File-wide information: NJ = number of slices.
class CNodeFileNJ: public CNodeFile {
public:
CNodeFileNJ( RRef1 _ref=RRef1( new CRef1() ) ) : CNodeFile( _ref) {}
void set_coord( CCoord& ret, int k ) const { ret = CCoord("nj", ""); }
string tree_info() const { return "nj {number of slices}"; }
};
//! Indexed variable node. //! Indexed variable node.
class CNodeIva: public CNode { class CNodeIva: public CNode {
......
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