include/sparse-vector-node.hpp

00001 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
00002 /*
00003  * frpuniverse
00004  * Copyright (C) Peter L. Berghold 2008 <Peter@Berghold.net>
00005  * 
00006  * frpuniverse is free software.
00007  * 
00008  * You may redistribute it and/or modify it under the terms of the
00009  * GNU General Public License, as published by the Free Software
00010  * Foundation; either version 2 of the License, or (at your option)
00011  * any later version.
00012  * 
00013  * frpuniverse is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  * 
00018  * You should have received a copy of the GNU General Public License
00019  * along with frpuniverse.  If not, write to:
00020  *      The Free Software Foundation, Inc.,
00021  *      51 Franklin Street, Fifth Floor
00022  *      Boston, MA  02110-1301, USA.
00023  */
00024 
00025 #ifndef _SPARSE_VECTOR_NODE_HPP_
00026 #define _SPARSE_VECTOR_NODE_HPP_
00027 
00036 class sparseVectorNode
00037 {
00038 public:
00039                 
00043         sparseVectorNode(){
00044                 next=(sparseVectorNode *)0;
00045                 index=-1;
00046         };
00047         
00055         sparseVectorNode(int ix,sparseVectorNode* p){
00056                 next = p;
00057                 index = ix;
00058         };
00059         
00066         sparseVectorNode* getNext(){ return next; };
00067         
00074         void setNext(sparseVectorNode* p) { next=p;};
00075         
00081         int getIndex(){ return index; };
00082         
00088         void setIndex(int ix){ index=ix; };
00089         
00096         char* dumpAsXML();
00097         
00107         char *nodeSignature();
00108         
00109 protected:
00110 
00111 private:
00112         sparseVectorNode* next;
00113         int index;
00114 
00115 };
00116 
00117 #endif // _SPARSE_VECTOR_NODE_HPP_

Generated on Fri Mar 7 16:40:53 2008 for frpuniverse by  doxygen 1.4.7