// -*- C++ -*- /*************************************************************************** * blitz/array/asexpr.h Declaration of the asExpr helper functions * * $Id$ * * Copyright (C) 1997-2011 Todd Veldhuizen * * This file is a part of Blitz. * * Blitz is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. * * Blitz is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with Blitz. If not, see . * * Suggestions: blitz-devel@lists.sourceforge.net * Bugs: blitz-support@lists.sourceforge.net * * For more information, please see the Blitz++ Home Page: * https://sourceforge.net/projects/blitz/ * ***************************************************************************/ #ifndef BZ_ASEXPR_CC #define BZ_ASEXPR_CC #include #include #include #include #include // implementations of asexpr functions. BZ_NAMESPACE(blitz) // default to scalar template _bz_typename asExpr::T_expr asExpr::getExpr(const T& x) { return T_expr(x); } // expression template term just returns itself template const _bz_typename asExpr<_bz_ArrayExpr >::T_expr& asExpr<_bz_ArrayExpr >::getExpr(const T_expr& x) { return x; } // array operand returns iterator template _bz_typename asExpr >::T_expr asExpr >::getExpr(const Array& x) { return x.beginFast(); } // tinyvector operand returns iterator template _bz_typename asExpr >::T_expr asExpr >::getExpr(const TinyVector& x) { return x.beginFast(); } // tinymatrix operands returns iterator template _bz_typename asExpr >::T_expr asExpr >::getExpr(const TinyMatrix& x) { return x.beginFast(); } // Index placeholder returns itself template _bz_typename asExpr >::T_expr asExpr >::getExpr(const T_expr& x) { return x; } // the levi-civita symbol inline asExpr::T_expr asExpr::getExpr(T_expr x) { return T_expr(x); } // Range inline asExpr::T_expr asExpr::getExpr(T_expr x) { return T_expr(x); } BZ_NAMESPACE_END #endif