blas/blas-test.cc

Test of blas classes.
00001 
00002 //
00003 // $Id: blas-test.cc,v 1.13 2006-05-01 14:24:13 cholm Exp $ 
00004 //  
00005 //  blas/blas-test.cc
00006 //  Copyright (C) 2002 Christian Holm Christensen <cholm@nbi.dk> 
00007 //
00008 //  This library is free software; you can redistribute it and/or 
00009 //  modify it under the terms of the GNU Lesser General Public License 
00010 //  as published by the Free Software Foundation; either version 2.1 
00011 //  of the License, or (at your option) any later version. 
00012 //
00013 //  This library 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.  See the GNU 
00016 //  Lesser General Public License for more details. 
00017 // 
00018 //  You should have received a copy of the GNU Lesser General Public 
00019 //  License along with this library; if not, write to the Free 
00020 //  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
00021 //  02111-1307 USA 
00022 //
00023 #ifndef __IOSTREAM__
00024 #include <iostream>
00025 #endif
00026 #ifndef GSLMM_math_type_trait
00027 #include <gslmm/math/type_trait.hh>
00028 #endif
00029 #ifndef GSLMM_blas
00030 #include <gslmm/blas/blas.hh>
00031 #endif
00032 #ifndef GSLMM_test_suite
00033 #include <gslmm/test/test_suite.hh>
00034 #endif
00035 #ifndef __FSTREAM__
00036 #include <fstream>
00037 #endif
00038 #ifndef __IOMANIP__
00039 #include <iomanip>
00040 #endif
00041 
00042 
00043 extern void do_test_amax(gslmm::test_suite& ts);
00044 extern void do_test_asum(gslmm::test_suite& ts);
00045 extern void do_test_gemv(gslmm::test_suite& ts);
00046 extern void do_test_symv(gslmm::test_suite& ts);
00047 extern void do_test_hemv(gslmm::test_suite& ts);
00048 extern void do_test_trmv(gslmm::test_suite& ts);
00049 extern void do_test_gemm(gslmm::test_suite& ts);
00050 extern void do_test_symm(gslmm::test_suite& ts);
00051 extern void do_test_hemm(gslmm::test_suite& ts);
00052 extern void do_test_trmm(gslmm::test_suite& ts);
00053 extern void do_test_herk(gslmm::test_suite& ts);
00054 extern void do_test_her2k(gslmm::test_suite& ts);
00055 extern void do_test_her(gslmm::test_suite& ts);
00056 extern void do_test_her2(gslmm::test_suite& ts);
00057 extern void do_test_syrk(gslmm::test_suite& ts);
00058 extern void do_test_syr2k(gslmm::test_suite& ts);
00059 extern void do_test_syr(gslmm::test_suite& ts);
00060 extern void do_test_syr2(gslmm::test_suite& ts);
00061 extern void do_test_ger(gslmm::test_suite& ts);
00062 
00071 //____________________________________________________________________  
00072 int main(int argc, char** argv) 
00073 {
00074   gslmm::test_suite ts("blas", argc, argv);
00075 
00076   gslmm::vector<float> v1(2);
00077   gslmm::vector<float> v2(2);
00078   v1[0] = v1[1] = 1;
00079   v2[0] = v2[1] = 2;
00080 
00081   float v1dotv2 = dot(v1, v2);
00082   (void)v1dotv2;
00083   // std::cout << v1dotv2 << std::endl;
00084   
00085   // Test trmm 
00086   ts.message("Level 1");
00087   do_test_amax(ts);
00088   do_test_asum(ts);
00089   ts.message("Level 2");
00090   do_test_gemv(ts);
00091   do_test_symv(ts);
00092   do_test_hemv(ts);
00093   do_test_trmv(ts);
00094   do_test_ger(ts);
00095   do_test_syr(ts);
00096   do_test_syr2(ts);
00097   do_test_her(ts);
00098   do_test_her2(ts);
00099   ts.message("Level 3");
00100   do_test_gemm(ts);
00101   do_test_symm(ts);
00102   do_test_hemm(ts);
00103   do_test_syrk(ts);
00104   do_test_syr2k(ts);
00105   do_test_herk(ts);
00106   do_test_her2k(ts);
00107   do_test_trmm(ts);
00108   
00109   return ts.summary() ? 0 : 1;
00110 }
00111 
00112 //____________________________________________________________________  
00113 //
00114 // EOF
00115 //  
Top of page Last update Tue May 9 10:11:10 2006
Christian Holm
Created by DoxyGen 1.4.6