VMTK
vtkvmtkSparseMatrixRow.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: VMTK
4  Module: $RCSfile: vtkvmtkSparseMatrixRow.h,v $
5  Language: C++
6 
7  Copyright (c) Luca Antiga, David Steinman. All rights reserved.
8  See LICENSE file for details.
9 
10  Portions of this code are covered under the VTK copyright.
11  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
12  for details.
13 
14  This software is distributed WITHOUT ANY WARRANTY; without even
15  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16  PURPOSE. See the above copyright notices for more information.
17 
18 =========================================================================*/
28 #ifndef __vtkvmtkSparseMatrixRow_h
29 #define __vtkvmtkSparseMatrixRow_h
30 
31 #include "vtkObject.h"
32 #include "vtkvmtkStencil.h"
33 #include "vtkvmtkNeighborhood.h"
34 #include "vtkvmtkConstants.h"
35 #include "vtkvmtkWin32Header.h"
36 
37 class VTK_VMTK_DIFFERENTIAL_GEOMETRY_EXPORT vtkvmtkSparseMatrixRow : public vtkObject
38 {
39 public:
40 
41  static vtkvmtkSparseMatrixRow *New();
42  vtkTypeMacro(vtkvmtkSparseMatrixRow,vtkObject);
43 
44  vtkIdType GetElementId(vtkIdType i) { return this->ElementIds[i]; }
45  void SetElementId(vtkIdType i, vtkIdType id) { this->ElementIds[i] = id; }
46 
47  double GetElement(vtkIdType i) { return this->Elements[i]; }
48  void SetElement(vtkIdType i, double element) { this->Elements[i] = element; }
49 
50  vtkIdType GetElementIndex(vtkIdType id);
51 
52  vtkIdType GetNumberOfElements() { return this->NElements; }
53  void SetNumberOfElements(vtkIdType numberOfElements);
54 
55  vtkSetMacro(DiagonalElement,double);
56  vtkGetMacro(DiagonalElement,double);
57 
58  void Initialize();
59 
60  void CopyStencil(vtkvmtkStencil* stencil);
61  void CopyNeighborhood(vtkvmtkNeighborhood* neighborhood);
62 
65  void DeepCopy(vtkvmtkSparseMatrixRow *src);
66 
67 protected:
70 
71  vtkIdType* ElementIds;
72  double* Elements;
74  vtkIdType NElements;
75 
76 private:
77  vtkvmtkSparseMatrixRow(const vtkvmtkSparseMatrixRow&); // Not implemented.
78  void operator=(const vtkvmtkSparseMatrixRow&); // Not implemented.
79 };
80 
81 #endif
82 
void SetElement(vtkIdType i, double element)
double GetElement(vtkIdType i)
vtkIdType GetElementId(vtkIdType i)
void SetElementId(vtkIdType i, vtkIdType id)
Class to handle operating on rows of a sparse matrix.
Apply a weighting matrix to a single neighborhood of a data set.
Query the neighborhood surrounding the set point id in an data set item.