| [0b990d] | 1 | // | 
|---|
|  | 2 | // repltest.cc | 
|---|
|  | 3 | // | 
|---|
|  | 4 | // Copyright (C) 1996 Limit Point Systems, Inc. | 
|---|
|  | 5 | // | 
|---|
|  | 6 | // Author: Curtis Janssen <cljanss@limitpt.com> | 
|---|
|  | 7 | // Maintainer: LPS | 
|---|
|  | 8 | // | 
|---|
|  | 9 | // This file is part of the SC Toolkit. | 
|---|
|  | 10 | // | 
|---|
|  | 11 | // The SC Toolkit is free software; you can redistribute it and/or modify | 
|---|
|  | 12 | // it under the terms of the GNU Library General Public License as published by | 
|---|
|  | 13 | // the Free Software Foundation; either version 2, or (at your option) | 
|---|
|  | 14 | // any later version. | 
|---|
|  | 15 | // | 
|---|
|  | 16 | // The SC Toolkit is distributed in the hope that it will be useful, | 
|---|
|  | 17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
|  | 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
|  | 19 | // GNU Library General Public License for more details. | 
|---|
|  | 20 | // | 
|---|
|  | 21 | // You should have received a copy of the GNU Library General Public License | 
|---|
|  | 22 | // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to | 
|---|
|  | 23 | // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 
|---|
|  | 24 | // | 
|---|
|  | 25 | // The U.S. Government is granted a limited license as per AL 91-7. | 
|---|
|  | 26 | // | 
|---|
|  | 27 |  | 
|---|
|  | 28 | #include <util/misc/formio.h> | 
|---|
|  | 29 | #include <util/group/pregtime.h> | 
|---|
|  | 30 | #include <util/group/messshm.h> | 
|---|
|  | 31 | #include <math/scmat/repl.h> | 
|---|
|  | 32 |  | 
|---|
|  | 33 | #include <util/group/linkage.h> | 
|---|
|  | 34 |  | 
|---|
|  | 35 | using namespace sc; | 
|---|
|  | 36 |  | 
|---|
|  | 37 | void matrixtest(Ref<SCMatrixKit> kit, Ref<KeyVal> keyval, | 
|---|
|  | 38 | RefSCDimension d1,RefSCDimension d2,RefSCDimension d3, | 
|---|
|  | 39 | bool have_svd); | 
|---|
|  | 40 |  | 
|---|
|  | 41 | main(int argc, char** argv) | 
|---|
|  | 42 | { | 
|---|
|  | 43 | char *infile = SRCDIR "/matrixtest.in"; | 
|---|
|  | 44 |  | 
|---|
|  | 45 | if (argc > 1) | 
|---|
|  | 46 | infile = argv[1]; | 
|---|
|  | 47 |  | 
|---|
|  | 48 | Ref<KeyVal> keyval = new ParsedKeyVal(infile); | 
|---|
|  | 49 |  | 
|---|
|  | 50 | Ref<MessageGrp> msg = MessageGrp::initial_messagegrp(argc, argv); | 
|---|
|  | 51 |  | 
|---|
|  | 52 | if (msg.null()) { | 
|---|
|  | 53 | msg << keyval->describedclassvalue("messagegrp"); | 
|---|
|  | 54 |  | 
|---|
|  | 55 | if (msg.null()) { | 
|---|
|  | 56 | std::cerr << indent << "Couldn't initialize MessageGrp\n"; | 
|---|
|  | 57 | abort(); | 
|---|
|  | 58 | } | 
|---|
|  | 59 | } | 
|---|
|  | 60 |  | 
|---|
|  | 61 | MessageGrp::set_default_messagegrp(msg); | 
|---|
|  | 62 | Ref<RegionTimer> tim = new ParallelRegionTimer(msg,"matrixtest",1,1); | 
|---|
|  | 63 | RegionTimer::set_default_regiontimer(tim); | 
|---|
|  | 64 |  | 
|---|
|  | 65 | SCFormIO::set_printnode(0); | 
|---|
|  | 66 | if (msg->n() > 1) | 
|---|
|  | 67 | SCFormIO::init_mp(msg->me()); | 
|---|
|  | 68 |  | 
|---|
|  | 69 | Ref<SCMatrixKit> kit = new ReplSCMatrixKit; | 
|---|
|  | 70 | RefSCDimension d1; d1 << keyval->describedclassvalue("d1"); | 
|---|
|  | 71 | RefSCDimension d2; d2 << keyval->describedclassvalue("d2"); | 
|---|
|  | 72 | RefSCDimension d3; d3 << keyval->describedclassvalue("d3"); | 
|---|
|  | 73 |  | 
|---|
|  | 74 | matrixtest(kit,keyval,d1,d2,d3,true); | 
|---|
|  | 75 |  | 
|---|
|  | 76 | return 0; | 
|---|
|  | 77 | } | 
|---|
|  | 78 |  | 
|---|
|  | 79 | ///////////////////////////////////////////////////////////////////////////// | 
|---|
|  | 80 |  | 
|---|
|  | 81 | // Local Variables: | 
|---|
|  | 82 | // mode: c++ | 
|---|
|  | 83 | // c-file-style: "CLJ" | 
|---|
|  | 84 | // End: | 
|---|