VMTK
Loading...
Searching...
No Matches
DifferentialGeometry
vtkvmtkLinearSystem.cxx
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: VMTK
4
Module: $RCSfile: vtkvmtkLinearSystem.cxx,v $
5
Language: C++
6
Date: $Date: 2006/02/23 09:31:41 $
7
Version: $Revision: 1.3 $
8
9
Copyright (c) Luca Antiga, David Steinman. All rights reserved.
10
See LICENSE file for details.
11
12
Portions of this code are covered under the VTK copyright.
13
See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
14
for details.
15
16
This software is distributed WITHOUT ANY WARRANTY; without even
17
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18
PURPOSE. See the above copyright notices for more information.
19
20
=========================================================================*/
21
22
#include "
vtkvmtkLinearSystem.h
"
23
#include "vtkObjectFactory.h"
24
25
26
vtkStandardNewMacro
(
vtkvmtkLinearSystem
);
27
28
vtkvmtkLinearSystem::vtkvmtkLinearSystem
()
29
{
30
this->
A
= NULL;
31
this->
X
= NULL;
32
this->
B
= NULL;
33
}
34
35
vtkvmtkLinearSystem::~vtkvmtkLinearSystem
()
36
{
37
if
(this->
A
)
38
{
39
this->
A
->Delete();
40
this->
A
= NULL;
41
}
42
43
if
(this->
X
)
44
{
45
this->
X
->Delete();
46
this->
X
= NULL;
47
}
48
49
if
(this->
B
)
50
{
51
this->
B
->Delete();
52
this->
B
= NULL;
53
}
54
}
55
56
int
vtkvmtkLinearSystem::CheckSystem
()
57
{
58
if
(this->
A
==NULL)
59
{
60
vtkErrorMacro(<<
"System matrix (A) not set!"
);
61
return
-1;
62
}
63
64
if
(this->
X
==NULL)
65
{
66
vtkErrorMacro(<<
"Unknown vector (x) not provided!"
);
67
return
-1;
68
}
69
70
if
(this->
B
==NULL)
71
{
72
vtkErrorMacro(<<
"Right-hand side vector (b) not set!"
);
73
return
-1;
74
}
75
76
if
((this->
A
->GetNumberOfRows()!=this->X->GetNumberOfElements())||(this->B->GetNumberOfElements()!=this->X->GetNumberOfElements()))
77
{
78
vtkErrorMacro(<<
"System matrix size, unknown vector size and right-hand side vector size do not match!"
);
79
return
-1;
80
}
81
82
return
0;
83
}
84
vtkvmtkLinearSystem
Serves as the base container holding sparse matrix objects that represent a linear system of equation...
Definition
vtkvmtkLinearSystem.h:44
vtkvmtkLinearSystem::B
vtkvmtkDoubleVector * B
Definition
vtkvmtkLinearSystem.h:87
vtkvmtkLinearSystem::CheckSystem
int CheckSystem()
Definition
vtkvmtkLinearSystem.cxx:56
vtkvmtkLinearSystem::~vtkvmtkLinearSystem
~vtkvmtkLinearSystem()
Definition
vtkvmtkLinearSystem.cxx:35
vtkvmtkLinearSystem::vtkvmtkLinearSystem
vtkvmtkLinearSystem()
Definition
vtkvmtkLinearSystem.cxx:28
vtkvmtkLinearSystem::A
vtkvmtkSparseMatrix * A
Definition
vtkvmtkLinearSystem.h:85
vtkvmtkLinearSystem::X
vtkvmtkDoubleVector * X
Definition
vtkvmtkLinearSystem.h:86
vtkStandardNewMacro
vtkStandardNewMacro(vtkvmtkLinearSystem)
vtkvmtkLinearSystem.h
Generated by
1.15.0