diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2003-03-21 04:36:07 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2003-03-21 04:36:07 +0000 |
commit | 5697ebe98e16f1438d6feba09cb075b6a0f2a653 (patch) | |
tree | caf213e0ce7a992096d10246878fd56c7eda9793 /externals/grill/vasp/source/ops_arith.cpp | |
parent | 9056179fcd52793c16112471d1d7fed45722194c (diff) |
""
svn path=/trunk/; revision=488
Diffstat (limited to 'externals/grill/vasp/source/ops_arith.cpp')
-rw-r--r-- | externals/grill/vasp/source/ops_arith.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/externals/grill/vasp/source/ops_arith.cpp b/externals/grill/vasp/source/ops_arith.cpp index fb8ad4b7..2239fc46 100644 --- a/externals/grill/vasp/source/ops_arith.cpp +++ b/externals/grill/vasp/source/ops_arith.cpp @@ -33,3 +33,47 @@ VASP_UNARY("vasp.ssqr",ssqr,true,"Calculates the square with preservation of the VASP_UNARY("vasp.sign",sign,true,"Calculates the sign (signum function)") VASP_UNARY("vasp.abs",abs,true,"Calculates the absolute value") + + +/*! \class vasp_qsum + \remark \b vasp.sum? + \brief Get sum of sample values + \since 0.1.3 + \param inlet vasp - is stored and output triggered + \param inlet bang - triggers output + \param inlet set - vasp to be stored + \retval outlet float - sample value sum + + \todo Should we provide a cmdln default vasp? + \todo Should we inhibit output for invalid vasps? + \remark Returns 0 for a vasp with 0 frames +*/ +class vasp_qsum: + public vasp_unop +{ + FLEXT_HEADER(vasp_qsum,vasp_unop) + +public: + vasp_qsum(): vasp_unop(true,XletCode(xlet::tp_float,0)) {} + + virtual Vasp *do_opt(OpParam &p) + { + p.norm.minmax = 0; + CVasp cref(ref); + Vasp *ret = VaspOp::m_qsum(p,cref); + return ret; + } + + virtual Vasp *tx_work() + { + OpParam p(thisName(),0); + Vasp *ret = do_opt(p); + ToOutFloat(1,p.norm.minmax); + return ret; + } + + virtual V m_help() { post("%s - Get the sum of a vasp's sample values",thisName()); } +}; + +FLEXT_LIB("vasp, vasp.sum?",vasp_qsum) + |