00001 ///////////////////////////////////////////////////////////////////////////// 00002 /// 00003 /// \file 00004 /// 00005 /// Alexander-Whitney diagonal of a chain. 00006 /// 00007 ///////////////////////////////////////////////////////////////////////////// 00008 00009 // Copyright (C) 2009-2011 by Pawel Pilarczyk. 00010 // 00011 // This file is part of my research software package. This is free software: 00012 // you can redistribute it and/or modify it under the terms of the GNU 00013 // General Public License as published by the Free Software Foundation, 00014 // either version 3 of the License, or (at your option) any later version. 00015 // 00016 // This software is distributed in the hope that it will be useful, 00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 // GNU General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU General Public License 00022 // along with this software; see the file "license.txt". If not, 00023 // please, see <http://www.gnu.org/licenses/>. 00024 00025 // Started on March 24, 2009. Last revision: March 6, 2011. 00026 00027 00028 #ifndef _CHAINCON_AWDIAG_H_ 00029 #define _CHAINCON_AWDIAG_H_ 00030 00031 00032 // include some standard C++ header files 00033 #include <istream> 00034 #include <ostream> 00035 00036 // include selected header files from the CHomP library 00037 #include "chomp/system/config.h" 00038 00039 // include relevant local header files 00040 #include "chaincon/combtensor.h" 00041 00042 00043 // -------------------------------------------------- 00044 // ------------------ AW diagonal ------------------- 00045 // -------------------------------------------------- 00046 00047 /// Computes the Alexander-Whitney diagonal of a chain, 00048 /// using the procedure defined for individual cells. 00049 template <class CellT> 00050 inline tCombTensor<CellT> AWdiagonal (const tCombChain<CellT> &ch) 00051 { 00052 tCombTensor<CellT> tensor; 00053 int_t size = ch. size (); 00054 for (int_t n = 0; n < size; ++ n) 00055 tensor. add (AWdiagonal (ch [n])); 00056 return tensor; 00057 } /* AWdiagonal */ 00058 00059 00060 #endif // _CHAINCON_AWDIAG_H_ 00061