Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression class reflection #26

Open
lindahua opened this issue Jul 28, 2012 · 0 comments
Open

Expression class reflection #26

lindahua opened this issue Jul 28, 2012 · 0 comments
Assignees
Labels

Comments

@lindahua
Copy link
Owner

Devices to inspect the structure of an expression

The implementation should be non-instrusive, relying on external template class with specializations.

// some declarations

template<class Expr> 
class  matexpr_typeinfo;

template<typename T, class Expr>
matexpr_typeinfo<Expr>  get_matexpr_type(const IMatrixXpr<Expr, T>& )
{
    return matexpr_typeinfo<Expr>();
}

// some usage: let a be an matrix expression instance

// return a type name (e.g. "unary_expr", "dense", etc) as std::string
get_matexpr_type( a ).name();  

// return a short string (e.g. "add(dense, sqr(dense))") as std::string
get_matexpr_type( a ).short_repr();  
@ghost ghost assigned lindahua Jul 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant