00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
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 }