test-bin/test-spvect-main.cxx

00001 // This program is free software; you can redistribute it and/or modify
00002 // it under the terms of the GNU General Public License as published by
00003 // the Free Software Foundation; either version 2 of the License, or
00004 // (at your option) any later version.
00005 // 
00006 // This program is distributed in the hope that it will be useful,
00007 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00008 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00009 // GNU Library General Public License for more details.
00010 // 
00011 // You should have received a copy of the GNU General Public License
00012 // along with this program; if not, write to the Free Software
00013 // Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
00014 
00015 #include <iostream>
00016 #include "sparse-vector.hpp"
00017 
00018 static sparseVector* sp;
00019 
00020 void dumpXML(){
00021         std::cout << "Dumping XML: " << std::endl;
00022         
00023         char * s = sp->dumpAsXML();
00024         std::cout << s << std::endl;
00025 }
00026 
00027 void testInsert(){
00028         std::cout << "Inserting a node... (index 2)....";
00029         
00030         sp->addAt(2,new sparseVectorNode());
00031         
00032         std::cout << "(index 3)...";
00033         sp->addAt(3,new sparseVectorNode());
00034         
00035         std::cout << "(index 5)...";
00036         sp->addAt(5,new sparseVectorNode());
00037         
00038         std::cout << "(index 4)..." ;
00039         
00040         sp->addAt(4,new sparseVectorNode());
00041         
00042         std::cout <<"done" <<std::endl;
00043         
00044                 
00045 }
00046 
00047 void createVector(){
00048         std::cout << "Creating...";
00049         sp = new sparseVector();
00050         std::cout<<"done." << std::endl;
00051         
00052 }
00053 
00054 int main()
00055 {
00056         std::cout << "test of the sparse vector library module...." << std::endl;
00057         createVector();
00058         testInsert();
00059         dumpXML();
00060         
00061         return 0;
00062 }

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