2.1.26.8 get_numerica_vector_treenode


Description

Get vector data from the current tree node

Syntax

bool get_numerica_vector_treenode( TreeNode & tr, vector<double> & vd )

Parameters

tr
[input]the source tree node
vd
[output]the output vector

Return

Returns true for success or false not.

Examples

EX1

void get_numerica_vector_treenode_Ex1()
{
    Tree tr;
    TreeNode trN = tr.AddNode("node1",1);
    vector<double> vdData = {1.1,2.2,3.3,4.4,5.5};
    trN.dVals = vdData;    //Assign doulbe values to tree node
    
    vector<double> vecCheck;
    
    if(get_numerica_vector_treenode(trN,vecCheck))
    {
    	for(int ii=0;ii<vecCheck.GetSize();ii++)
    		printf("vecCheck[%d]=%lf\n",ii,vecCheck[ii]);
    }
    else
    	printf("failed to obtain data from vector\n");
}

Remark

See Also

get_numerica_matrix_tree_node

Header to Include

origin.h

Reference