MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
subtest.cc File Reference
#include "mbconfig.h"
#include "submat.h"
#include "spmapmh.h"
Include dependency graph for subtest.cc:

Go to the source code of this file.

Functions

int main (void)
 

Function Documentation

int main ( void  )

Definition at line 38 of file subtest.cc.

References FullSubMatrixHandler::AddTo(), FullSubMatrixHandler::AddToT(), FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), FullMatrixHandler::Reset(), SpMapMatrixHandler::Reset(), FullSubMatrixHandler::ResizeReset(), FullSubMatrixHandler::SubFrom(), and FullSubMatrixHandler::SubFromT().

39 {
40  FullMatrixHandler FMH(4);
41  SpMapMatrixHandler SMH(4);
42 
43  FullSubMatrixHandler FSMH(2, 2);
44  FSMH.ResizeReset(2, 2);
45 
46  FSMH.PutRowIndex(1, 3);
47  FSMH.PutRowIndex(2, 4);
48 
49  FSMH.PutColIndex(1, 1);
50  FSMH.PutColIndex(2, 2);
51 
52  FSMH(1, 1) = 11.;
53  FSMH(1, 2) = 12.;
54  FSMH(2, 1) = 21.;
55  FSMH(2, 2) = 22.;
56 
57  std::cout << "FSMH: " << std::endl << FSMH << std::endl;
58 
59  FMH.Reset();
60  FSMH.AddTo(FMH);
61 
62  std::cout << "FMH = FSMH: " << std::endl << FMH << std::endl;
63 
64  FMH.Reset();
65  FSMH.SubFrom(FMH);
66 
67  std::cout << "FMH = -FSMH: " << std::endl << FMH << std::endl;
68 
69  FMH.Reset();
70  FSMH.AddToT(FMH);
71 
72  std::cout << "FMH = FSMH^T: " << std::endl << FMH << std::endl;
73 
74  FMH.Reset();
75  FSMH.SubFromT(FMH);
76 
77  std::cout << "FMH = -FSMH^T: " << std::endl << FMH << std::endl;
78 
79  SMH.Reset();
80  FSMH.AddTo(SMH);
81 
82  std::cout << "SMH = FSMH: " << std::endl << SMH << std::endl;
83 
84  SMH.Reset();
85  FSMH.SubFrom(SMH);
86 
87  std::cout << "SMH = -FSMH: " << std::endl << SMH << std::endl;
88 
89  SMH.Reset();
90  FSMH.AddToT(SMH);
91 
92  std::cout << "SMH = FSMH^T: " << std::endl << SMH << std::endl;
93 
94  SMH.Reset();
95  FSMH.SubFromT(SMH);
96 
97  std::cout << "SMH = -FSMH^T: " << std::endl << SMH << std::endl;
98 
99  return 0;
100 }

Here is the call graph for this function: